-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Added function to resolve issues (in addition to delete) * Added tabs in dashboard * Added Popups in dashboard * Improved styling of entry on mobile Co-authored-by: Florian Schmidt <[email protected]> Co-authored-by: Maurice22 <[email protected]>
- Loading branch information
1 parent
5d67f7f
commit dd93655
Showing
27 changed files
with
1,920 additions
and
831 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
export default function createAskForHelpPosting(postalCode, description) { | ||
cy.visit('localhost:3000/#/ask-for-help'); | ||
cy.get('[data-cy=location-search-input]').type(`${postalCode}{enter}`); | ||
cy.get('[data-cy=autocomplete-suggestion]').first().click(); | ||
cy.get('[data-cy=ask-for-help-text-input]').type(description); | ||
cy.get('[data-cy=ask-for-help-submit]').click(); | ||
cy.get('[data-cy=success-link-to-dashboard]').click(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
export default function createResponseForPosting(responseText, email) { | ||
cy.visit('localhost:3000/#/dashboard'); | ||
cy.wait(1000); // wait for data to load | ||
cy.get('[data-cy=ask-for-help-entry]').invoke('attr', 'data-id').as('askForHelpId'); | ||
cy.get('@askForHelpId') | ||
.then((askForHelpId) => { | ||
cy.visit(`localhost:3000/#/offer-help/${askForHelpId}`); | ||
cy.get('[data-cy=offer-help-text-input]').type(`${responseText}{enter}`); | ||
cy.get('[data-cy=mail-input]').type(`${email}`); | ||
cy.get('[data-cy=offer-help-submit]').click(); | ||
cy.get('[data-cy=success-offer-link]').click(); | ||
}); | ||
cy.wait(1000); // wait for data be updated | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
export default function loginVerifiedUser(email, password) { | ||
cy.visit('localhost:3000'); | ||
|
||
// TODO: This yells ANTI-PATTERN. We should find a way to fix this | ||
cy.wait(3000); | ||
cy.get('body').then(($body) => { | ||
if ($body.find('[data-cy=btn-sign-out]').length > 0) { | ||
cy.get('[data-cy=btn-sign-out]').click(); | ||
} | ||
}); | ||
|
||
cy.visit('localhost:3000/#/signin'); | ||
cy.get('form input[type="email"]').type(`${email}{enter}`); | ||
cy.get('form input[type="password"]').type(`${password}{enter}`); | ||
|
||
// TODO: Why do we redirect to ask-for-help here! | ||
cy.hash().should('equal', '#/ask-for-help'); | ||
|
||
cy.visit('localhost:3000'); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
export function removeAskForHelpEntryWithoutResponses() { | ||
cy.get('[data-cy=ask-for-help-entry]').should('be.visible'); | ||
cy.get('[data-cy=btn-entry-solve]').should('not.be.visible'); | ||
cy.get('[data-cy=btn-entry-delete]').should('be.visible'); | ||
cy.get('[data-cy=btn-entry-delete]').first().click(); | ||
|
||
// engage with popup content | ||
cy.get('.popup-content').should('be.visible'); | ||
cy.get('[data-cy=btn-popup-cancel-positive]').should('be.visible'); | ||
cy.get('[data-cy=btn-popup-delete-terminally]').should('be.visible'); | ||
cy.get('[data-cy=btn-popup-delete-terminally]').click(); | ||
|
||
// click "ZURÜCK ZUR ÜBERSICHT" in the following popup | ||
cy.get('[data-cy=btn-popup-ask-for-help]').should('be.visible'); | ||
cy.get('[data-cy=btn-popup-back-to-overview]').should('be.visible'); | ||
cy.get('[data-cy=btn-popup-back-to-overview]').click(); | ||
cy.wait(1000); // wait for deletion | ||
cy.get('.popup-content').should('not.be.visible'); | ||
} | ||
|
||
export function removeAskForHelpEntryWithResponses() { | ||
cy.get('[data-cy=ask-for-help-entry-with-responses]').should('be.visible'); | ||
cy.get('[data-cy=btn-entry-solve]').should('be.visible'); | ||
cy.get('[data-cy=btn-entry-delete]').should('be.visible'); | ||
cy.get('[data-cy=btn-entry-delete]').first().click(); | ||
|
||
// engage with popup content | ||
cy.get('.popup-content').should('be.visible'); | ||
cy.get('[data-cy=btn-popup-hero-found]').should('be.visible'); | ||
cy.get('[data-cy=btn-popup-delete-anyway]').should('be.visible'); | ||
cy.get('[data-cy=btn-popup-delete-anyway]').click(); | ||
|
||
// click "ZURÜCK ZUR ÜBERSICHT" in the following popup | ||
cy.get('[data-cy=btn-popup-ask-for-help]').should('be.visible'); | ||
cy.get('[data-cy=btn-popup-back-to-overview]').should('be.visible'); | ||
cy.get('[data-cy=btn-popup-back-to-overview]').click(); | ||
cy.wait(1000); // wait for deletion | ||
cy.get('.popup-content').should('not.be.visible'); | ||
} | ||
|
||
export function removeSolvedAskForHelpEntry() { | ||
cy.get('[data-cy=tabs-solved]').click(); | ||
cy.get('[data-cy=tabs-solved-content]').should('be.visible'); | ||
|
||
// get entry | ||
cy.get('[data-cy=ask-for-help-entry-with-responses]').should('be.visible'); | ||
cy.get('[data-cy=btn-entry-solve]').should('be.visible'); | ||
cy.get('[data-cy=btn-entry-delete]').should('be.visible'); | ||
cy.get('[data-cy=btn-entry-delete]').first().click(); | ||
// engage popup content | ||
cy.get('[data-cy=btn-popup-cancel-positive]').should('be.visible'); | ||
cy.get('[data-cy=btn-popup-delete-terminally]').should('be.visible'); | ||
cy.get('[data-cy=btn-popup-delete-terminally]').click({ force: true }); | ||
cy.wait(500); // wait for popup | ||
|
||
// click "ZURÜCK ZUR ÜBERSICHT" in the following popup | ||
cy.get('[data-cy=btn-popup-ask-for-help]').should('be.visible'); | ||
cy.get('[data-cy=btn-popup-back-to-overview]').should('be.visible'); | ||
cy.get('[data-cy=btn-popup-back-to-overview]').click(); | ||
cy.wait(1000); // wait for deletion | ||
cy.get('.popup-content').should('not.be.visible'); | ||
cy.wait(2000); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.