diff --git a/cypress/e2e/01-moduleConfig.cy.js b/cypress/e2e/01-moduleConfig.cy.js index deb65e40..6bd5a915 100644 --- a/cypress/e2e/01-moduleConfig.cy.js +++ b/cypress/e2e/01-moduleConfig.cy.js @@ -6,14 +6,14 @@ Cypress.on('window:before:load', (win) => { afterEach(() => { expect(windowConsoleError).to.not.be.called; }) -describe('PS1786 Module Configuration', { +describe('PS817 Module Configuration', { failFast: { enabled: false, }, }, () => { beforeEach(() => { cy.viewport(1920, 1080) - cy.CachingBOFOPS1789() + cy.CachingBOFO() }) it('01 Connecting the Test API information to module', () => { cy.visit('/admin1/') @@ -25,12 +25,12 @@ describe('PS1786 Module Configuration', { cy.get('[name="SAFERPAY_MERCHANT_EMAILS_TEST"]').type((Cypress.env('SAFERPAY_MERCHANT_EMAILS_TEST')), { delay: 0, log: false }) cy.get('[name="SAFERPAY_FIELDS_ACCESS_TOKEN_TEST"]').type((Cypress.env('SAFERPAY_FIELDS_ACCESS_TOKEN_TEST')), { delay: 0, log: false }) cy.get('#configuration_fieldset_1 > .panel-footer > .btn').click() - cy.get(':nth-child(4) > .alert').should('exist') + cy.get(':nth-child(1) > .alert').should('exist') }) it('02 Enabling Saferpay carriers and countries successfully', () => { cy.visit('/admin1/') cy.get('[id="subtab-AdminPaymentPreferences"]').find('[href]').eq(0).click({ force: true }) - cy.get('[class="js-multiple-choice-table-select-column"]').eq(7).click() + cy.get('[class="js-multiple-choice-table-select-column"]').eq(11).click() cy.get('[class="btn btn-primary"]').eq(3).click() }) it('03 Enabling All payments in Module BO', () => { diff --git a/cypress/e2e/02-authorizeAfterAuthorization.cy.js b/cypress/e2e/02-authorizeAfterAuthorization.cy.js index f42c55a9..8dc60cd7 100644 --- a/cypress/e2e/02-authorizeAfterAuthorization.cy.js +++ b/cypress/e2e/02-authorizeAfterAuthorization.cy.js @@ -6,14 +6,14 @@ Cypress.on('window:before:load', (win) => { afterEach(() => { expect(windowConsoleError).to.not.be.called; }) -describe('PS1789 Tests Suite -> Authorization + After order creation', { +describe('PS817 Tests Suite -> Authorization + After order creation', { failFast: { enabled: false, }, }, () => { beforeEach(() => { cy.viewport(1920, 1080) - cy.CachingBOFOPS1789() + cy.CachingBOFO() }) @@ -41,8 +41,7 @@ describe('PS1789 Tests Suite -> Authorization + After order creation', { it('Twint guest success', () => { cy.clearCookies() - cy.visit('/en/home/1-spproduct.html', { headers: {"Accept-Encoding": "gzip, deflate"}}) - //cy.changeCurrencyCHF() + cy.visit('/en/women/2-9-brown-bear-printed-sweater.html#/1-size-s') cy.guestCheckoutCHF() cy.contains('Twint').click({ force: true }) cy.get('.condition-label > .js-terms').click({ force: true }) diff --git a/cypress/support/commands.js b/cypress/support/commands.js index e0d55834..a7e64488 100755 --- a/cypress/support/commands.js +++ b/cypress/support/commands.js @@ -63,7 +63,7 @@ Cypress.Commands.add( }) }); - Cypress.Commands.add("CachingBOFOPS1789", () => { + Cypress.Commands.add("CachingBOFO", () => { //Caching the BO and FO session const login = (SaferPayBOFOLoggingIn) => { cy.session(SaferPayBOFOLoggingIn,() => { @@ -76,7 +76,6 @@ Cypress.Commands.add( cy.get('#login-form [name="email"]').eq(0).type((Cypress.env('SAFERPAY_EMAIL')),{delay: 0, log: false}) cy.get('#login-form [name="password"]').eq(0).type((Cypress.env('SAFERPAY_PASSWORD')),{delay: 0, log: false}) cy.get('#login-form [type="submit"]').eq(0).click({force:true}) - cy.get('#history-link > .link-item').click() }) } login('SaferPayBOFOLoggingIn') @@ -108,6 +107,7 @@ Cypress.Commands.add( Cypress.Commands.add("guestCheckoutCHF", () => { cy.get('.add > .btn').click() cy.get('.cart-content-btn > .btn-primary').click() + cy.changeCurrencyCHF() cy.get('.text-sm-center > .btn').click() // Creating random user all the time cy.get(':nth-child(1) > .custom-radio > input').check() @@ -118,7 +118,7 @@ Cypress.Commands.add( const testname = `testemail${id}@testing.com` cy.get('[name="email"]').first().type(testname, {delay: 0}) cy.contains('Customer data privacy').click() - //cy.contains('I agree').click() + cy.contains('I agree').click() cy.get('#customer-form > .form-footer > .continue').click() cy.get('#field-address1').type('ADDR',{delay:0}).as('address 1') cy.get('#field-address2').type('ADDR2',{delay:0}).as('address2') @@ -143,7 +143,7 @@ Cypress.Commands.add( const testname = `testemail${id}@testing.com` cy.get('[name="email"]').first().type(testname, {delay: 0}) cy.contains('Customer data privacy').click() - //cy.contains('I agree').click() + cy.contains('I agree').click() cy.get('#customer-form > .form-footer > .continue').click() cy.get('#field-address1').type('ADDR',{delay:0}).as('address 1') cy.get('#field-address2').type('ADDR2',{delay:0}).as('address2') diff --git a/cypress/support/e2e.js b/cypress/support/e2e.js index 0e7290a1..e213e13e 100644 --- a/cypress/support/e2e.js +++ b/cypress/support/e2e.js @@ -16,5 +16,10 @@ // Import commands.js using ES2015 syntax: import './commands' +Cypress.on('uncaught:exception', (err, runnable) => { + console.error('Uncaught exception:', err); + return false; // Prevent Cypress from failing the test + }); + // Alternatively you can use CommonJS syntax: // require('./commands') \ No newline at end of file