diff --git a/cypress/integration/formError.spec.js b/cypress/integration/formError.spec.js index 3db750d8..2716bbda 100644 --- a/cypress/integration/formError.spec.js +++ b/cypress/integration/formError.spec.js @@ -83,11 +83,14 @@ describe("Form Error Tests", () => { cy.get('[data-test-id="test-address"]').type("Unbekannt 1"); cy.get('[data-test-id="test-city"]').clear() cy.get('[data-test-id="test-zipCode"]').clear().type("82449") - cy.get('[data-test-id="test-country"]').clear().type("Germany{enter}").get('body').click(0, 0) - //cy.get('[data-test-id="test-continueToPayment"]').click() - cy.get('.form-errors').should("have.text", "City is required") - cy.get('[data-test-id="test-city"]').click().type("Uffing am Staffelsee") - cy.get('body').should("not.have.text", "City is required") + cy.get('[data-test-id="test-country"]').clear().type("Germany{enter}").get('body').click(0, 0).then(() => { + cy.get('[data-test-id="test-continueDisabled"]').click().then(() => { + cy.get('.form-errors').should("have.text", "City is required") + cy.get('[data-test-id="test-city"]').click().type("Uffing am Staffelsee").then(() => { + cy.get('body').should("not.have.text", "City is required") + }) + }) + }) }) it("ZipCode error", () => { @@ -104,10 +107,13 @@ describe("Form Error Tests", () => { cy.get('[data-test-id="test-address"]').type("Unbekannt 1"); cy.get('[data-test-id="test-city"]').clear().type("Uffing am Staffelsee") cy.get('[data-test-id="test-zipCode"]').clear() - cy.get('[data-test-id="test-country"]').clear().type(`${selectedCountry}{enter}`).get('body').click(0, 0) - //cy.get('[data-test-id="test-continueToPayment"]').click() - cy.get('.form-errors').should("have.text", "ZipCode is invalid") - cy.get('[data-test-id="test-zipCode"]').click().type(new RandExp(fiteredCountry[0].postal).gen()) - cy.get('body').should("not.have.text", "ZipCode is invalid") + cy.get('[data-test-id="test-country"]').clear().type(`${selectedCountry}{enter}`).get('body').click(0, 0).then (() => { + cy.get('[data-test-id="test-continueDisabled"]').click().then(() => { + cy.get('.form-errors').should("have.text", "ZipCode is invalid") + cy.get('[data-test-id="test-zipCode"]').click().type(new RandExp(fiteredCountry[0].postal).gen()).then(() => { + cy.get('body').should("not.have.text", "ZipCode is invalid") + }) + }) + }) }) }) \ No newline at end of file diff --git a/cypress/support/commands.js b/cypress/support/commands.js index 4650845c..e7d06592 100644 --- a/cypress/support/commands.js +++ b/cypress/support/commands.js @@ -232,12 +232,15 @@ Cypress.Commands.add('bankTransfer', () => { cy.wait(5000) // cy.get('.frequency-selection-option').eq(0).should("have.text", "Once").click() cy.contactForm("Peter", "Payer", "peter.payer@gmail.com", "Unbekannt 1", "Uffing am Staffelsee", "Germany{enter}", "82449") - cy.wait(15000) - cy.get('[data-test-id="bankTransfer"]').click() - cy.get('[data-test-id="bankDonateContinue"]').click() - cy.wait(10000) - cy.get('[data-test-id="test-thankYou"]').should("exist") - + cy.wait(15000).then(() => { + cy.get('[data-test-id="bankTransfer"]').click().then(() => { + cy.get('[data-test-id="bankDonateContinue"]').click().then(() => { + cy.wait(15000).then(() => { + cy.get('[data-test-id="test-thankYou"]').should("exist") + }) + }) + }) + }) }) diff --git a/src/Donations/Components/ContactsForm.tsx b/src/Donations/Components/ContactsForm.tsx index f48e56a1..9ce95df9 100644 --- a/src/Donations/Components/ContactsForm.tsx +++ b/src/Donations/Components/ContactsForm.tsx @@ -434,7 +434,10 @@ function ContactsForm({}: Props): ReactElement { errors.city || errors.zipCode || errors.country ? ( - ) : (