Skip to content

Commit

Permalink
fixed for ps81
Browse files Browse the repository at this point in the history
  • Loading branch information
Justas Vaitkus authored and Justas Vaitkus committed Aug 7, 2024
1 parent a81cfcb commit 9dc5323
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 12 deletions.
8 changes: 4 additions & 4 deletions cypress/e2e/01-moduleConfig.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -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/')
Expand All @@ -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', () => {
Expand Down
7 changes: 3 additions & 4 deletions cypress/e2e/02-authorizeAfterAuthorization.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -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()

})

Expand Down Expand Up @@ -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 })
Expand Down
8 changes: 4 additions & 4 deletions cypress/support/commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,() => {
Expand All @@ -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')
Expand Down Expand Up @@ -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()
Expand All @@ -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')
Expand All @@ -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')
Expand Down
5 changes: 5 additions & 0 deletions cypress/support/e2e.js
Original file line number Diff line number Diff line change
Expand Up @@ -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')

0 comments on commit 9dc5323

Please sign in to comment.