Skip to content

Commit

Permalink
Merge pull request #896 from mollie/e2e-updates-march-april
Browse files Browse the repository at this point in the history
E2E updates march-april
  • Loading branch information
SimonasB88 authored Apr 4, 2024
2 parents 780e572 + 181d52b commit d9055d7
Show file tree
Hide file tree
Showing 17 changed files with 4,159 additions and 261 deletions.
2 changes: 1 addition & 1 deletion .docker/Dockerfile.8
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM prestashop/prestashop:8.1.3-apache
FROM prestashop/prestashop:8.1.5-apache

RUN cd /usr/local/etc/php/conf.d/ && \
echo 'memory_limit = 4096M' >> /usr/local/etc/php/conf.d/docker-php-memlimit.ini
Expand Down
17 changes: 9 additions & 8 deletions .github/workflows/E2E_On_PR.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,15 @@ jobs:
fail-fast: false
matrix:
include:
- prestashop: 'PS1785'
make: 'make VERSION=1785 e2eh1785'
subdomain: 'demoshop1785'
port: '8002'
yml: 'docker-compose.1785.yml'
url: 'https://demoshop1785.ngrok.io'
test_spec: '**/cypress/e2e/ps1785/**'
TestRailID: R4954
# temporary WIP for this PS version, possible bug blocker
# - prestashop: 'PS1785'
# make: 'make VERSION=1785 e2eh1785'
# subdomain: 'demoshop1785'
# port: '8002'
# yml: 'docker-compose.1785.yml'
# url: 'https://demoshop1785debug.ngrok.io'
# test_spec: '**/cypress/e2e/ps1785/**'
# TestRailID: R4954
- prestashop: 'PS8'
make: 'make VERSION=8 e2eh8'
subdomain: 'demoshop8'
Expand Down
2 changes: 1 addition & 1 deletion cypress.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ module.exports = defineConfig({
// return config;
// },
experimentalMemoryManagement: true,
excludeSpecPattern: ['index.php'],
excludeSpecPattern: ['index.php', 'cypress/e2e/ps1785'],
specPattern: 'cypress/e2e/**/*.{js,jsx,ts,tsx}',
},
})
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,12 @@ describe('PS1785 Module initial configuration setup', () => {
it('C339305: 01 Connecting test API successsfully', () => {
cy.visit('/admin1/')
cy.OpeningModuleDashboardURL()
cy.get('body')
.invoke('text').should('contain','Mollie')
.then((text) => {
cy.log(text) // Showing and asserting the text that loaded, to ensure the BO is loaded, not crashed with PHP fatals etc.
})
cy.iframe('[id^="uid_"]').find('button').click() // Cloudsync validation
cy.get('#MOLLIE_ACCOUNT_SWITCH_on').click({force:true})
cy.get('#MOLLIE_API_KEY_TEST').type((Cypress.env('MOLLIE_TEST_API_KEY')),{delay: 0, log: false})
cy.get('#module_form_submit_btn').click()
Expand Down
43 changes: 42 additions & 1 deletion cypress/e2e/ps1785/03_mollie.ps1785.PaymentTestsOrdersAPI.js
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,48 @@ it('C1860460: Pay with Klarna UK Checkouting [Orders API]', () => {
cy.get('[class="button form__button"]').click()
cy.get('#content-hook_order_confirmation > .card-block').should('be.visible')
});
it('C1860461: Pay with Klarna UK Order Shipping, Refunding [Orders API]', () => { // currently not supported for PS, skipping temporary
it('C1860461: Pay with Klarna UK Order Shipping, Refunding [Orders API]', () => {
cy.OrderShippingRefundingOrdersAPI()
})
// TODO - some reported possible bugs in the workflow, but still continuing on completing the tests...
it.only('Blik Checkouting [Orders API]', () => {
cy.visit('/en/order-history')
// switching the currency
cy.pause()
cy.contains('Reorder').click()
cy.contains('UK').click({force:true})
//Billing country LT, DE etc.
cy.get('.clearfix > .btn').click()
cy.get('#js-delivery > .continue').click()
//Payment method choosing
cy.contains('Blik').click({force:true})
cy.get('.condition-label > .js-terms').click({force:true})
cy.contains('Place order').click()
cy.get('[value="authorized"]').click()
cy.get('[class="button form__button"]').click()
cy.get('#content-hook_order_confirmation > .card-block').should('be.visible')
});
it.only('Blik Order Shipping, Refunding [Orders API]', () => {
cy.OrderShippingRefundingOrdersAPI()
})
it('TWINT Checkouting [Orders API]', () => {
cy.visit('/en/order-history')
// switching the currency
cy.pause()
cy.contains('Reorder').click()
cy.contains('UK').click({force:true})
//Billing country LT, DE etc.
cy.get('.clearfix > .btn').click()
cy.get('#js-delivery > .continue').click()
//Payment method choosing
cy.contains('TWINT').click({force:true})
cy.get('.condition-label > .js-terms').click({force:true})
cy.contains('Place order').click()
cy.get('[value="authorized"]').click()
cy.get('[class="button form__button"]').click()
cy.get('#content-hook_order_confirmation > .card-block').should('be.visible')
});
it('TWINT Order Shipping, Refunding [Orders API]', () => {
cy.OrderShippingRefundingOrdersAPI()
})
})
30 changes: 26 additions & 4 deletions cypress/e2e/ps1785/05_mollie.ps1785.PaymentTestsPaymentsAPI.js
Original file line number Diff line number Diff line change
Expand Up @@ -251,22 +251,44 @@ it('C339401: 66 Bank Transfer Checkouting [Payments API]', () => {
it('C339402: 67 Bank Transfer BO Refunding, Partial Refunding [Payments API]', () => {
cy.OrderRefundingPartialPaymentsAPI()
});
it.skip('C1860462: Pay with Klarna UK Checkouting [Payments API]', () => { // TODO - temporary skip, issue, Orders API is available to Order
// TODO - some reported possible bugs in the workflow, but still continuing on completing the tests...
it.only('Blik Checkouting [Payments API]', () => {
cy.visit('/en/order-history')
// switching the currency
cy.pause()
cy.contains('UK').click({force:true})
//Billing country LT, DE etc.
cy.get('.clearfix > .btn').click()
cy.get('#js-delivery > .continue').click()
//Payment method choosing
cy.contains('Blik').click({force:true})
cy.get('.condition-label > .js-terms').click({force:true})
cy.contains('Place order').click()
cy.get('[value="authorized"]').click()
cy.get('[class="button form__button"]').click()
cy.get('#content-hook_order_confirmation > .card-block').should('be.visible')
});
it.only('Blik Order Shipping, Refunding [Payments API]', () => {
cy.OrderRefundingPartialPaymentsAPI()
})
it('TWINT Checkouting [Payments API]', () => {
cy.visit('/en/order-history')
// switching the currency
cy.pause()
cy.contains('Reorder').click()
cy.contains('UK').click({force:true})
//Billing country LT, DE etc.
cy.get('.clearfix > .btn').click()
cy.get('#js-delivery > .continue').click()
//Payment method choosing
cy.contains('Pay with Klarna').click({force:true})
cy.contains('TWINT').click({force:true})
cy.get('.condition-label > .js-terms').click({force:true})
cy.get('.ps-shown-by-js > .btn').click()
cy.contains('Place order').click()
cy.get('[value="authorized"]').click()
cy.get('[class="button form__button"]').click()
cy.get('#content-hook_order_confirmation > .card-block').should('be.visible')
});
it.skip('C1860463: Pay with Klarna UK Order BO Refunding, Partial Refunding [Payments API]', () => { // TODO - temporary skip, issue, Orders API is available to Order
it('TWINT Order Shipping, Refunding [Payments API]', () => {
cy.OrderRefundingPartialPaymentsAPI()
})
})
5 changes: 4 additions & 1 deletion cypress/e2e/ps1785/07_mollie.ps1785.Cloudsync.specs.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,11 @@ describe('PS8 Cloudsync tests', () => {
cy.viewport(1920,1080)
cy.CachingBOFOPS1785()
})
it('Checking if Cloudsync UI is appearing in the module', () => {
it('Checking if CloudSync UI is appearing in the module', () => {
cy.OpeningModuleDashboardURL()
cy.CloudSyncUI()
})
it('Linking the Shop to the PS CloudSync', () => {
cy.CloudSyncLink()
});
})
7 changes: 6 additions & 1 deletion cypress/e2e/ps8/01_mollie.ps8.ModuleConfiguration.specs.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,12 @@ it('C339305: Connecting test API successsfully', () => {
cy.visit('/admin1/')
cy.get('.mi-mollie').click({fore:true})
cy.get('#subtab-AdminMollieModule').click()
cy.get('body')
.invoke('text').should('contain','Mollie')
.then((text) => {
cy.log(text) // Showing and asserting the text that loaded, to ensure the BO is loaded, not crashed with PHP fatals etc.
})
cy.iframe('[id^="uid_"]').find('button').click() // Cloudsync validation
cy.get('#MOLLIE_ACCOUNT_SWITCH_on').click({force:true})
cy.get('#MOLLIE_API_KEY_TEST').type((Cypress.env('MOLLIE_TEST_API_KEY')),{delay: 0, log: false})
cy.get('#module_form_submit_btn').click()
Expand Down Expand Up @@ -89,6 +95,5 @@ it('C688473: Checking the Subscriptions FAQ, and console errors', () => {
cy.get(':nth-child(5) > .col-lg-12 > .card').should('be.visible')
cy.get(':nth-child(6) > .col-lg-12 > .card').should('be.visible')
cy.matchImage(); // let's make a snapshot for visual regression testing later, if UI matches

});
})
6 changes: 3 additions & 3 deletions cypress/e2e/ps8/03_mollie.ps8.PaymentTestsOrdersAPI.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,14 +132,14 @@ it('C339357: 20 IN3 Checkouting [Orders API]', () => { // wip
cy.navigatingToThePaymentPS8()
//Payment method choosing
// waiting for enabling IN3 payment
cy.contains('in3').click({force:true})
cy.contains('in 3').click({force:true})
cy.get('.condition-label > .js-terms').click({force:true})
cy.contains('Place order').click()
cy.get('[value="paid"]').click()
cy.get('[class="button form__button"]').click()
cy.get('#content-hook_order_confirmation > .card-block').should('be.visible')
})
it('C339358: 21 IN3 Order BO Shipping, Refunding [Orders API]', () => { // checking why payment div is not loaded in the Orders for some reason
it('C339358: 21 IN3 Order BO Shipping, Refunding [Orders API]', () => {
cy.OrderRefundingShippingOrdersAPI()
})
it('C339359: 22 IN3 should not be shown under 5000 EUR [Orders API]', () => {
Expand All @@ -153,7 +153,7 @@ it('C339359: 22 IN3 should not be shown under 5000 EUR [Orders API]', () => {
cy.get('.clearfix > .btn').click()
cy.get('#js-delivery > .continue').click()
//Payment method choosing
cy.contains('in3').should('not.exist')
cy.contains('in 3').should('not.exist')
})
it('C339360: 23 IN3 Checking that IN3 logo exists OK [Orders API]', () => {
cy.visit('/admin1/')
Expand Down
45 changes: 17 additions & 28 deletions cypress/e2e/ps8/05_mollie.ps8.PaymentTestsPaymentsAPI.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,29 +55,31 @@ it('C339383: 48 Credit Card Checkouting [Payments API]', () => {
it('C339384: 49 Credit Card Order BO Refunding, Partial Refunding [Payments API]', () => {
cy.OrderRefundingPartialPaymentsAPI()
})
it.skip('C339385: 50 Credit Card Guest Checkouting [Payments API]', () => { // possibly a PS8 issue, that Cart is celaning the cookies...
it.skip('C339385: 50 Credit Card Guest Checkouting [Payments API]', () => { // possibly a PS8 / Cypress compatibility issue, that Cart is celaning the cookies...
cy.clearCookies()
//Payments API item
cy.visit('/en/', { headers: {"Accept-Encoding": "gzip, deflate"}})
cy.get('[class="h3 product-title"]').eq(0).click()
cy.get('.add > .btn').click()
cy.get('.cart-content-btn > .btn-primary').click()
cy.wait(2000)
cy.visit('/en/')
cy.get('.blockcart').click()
cy.get('.text-sm-center > .btn').click()
cy.visit('/en/order')
// Creating random user all the time
cy.get(':nth-child(1) > .custom-radio > input').check()
cy.get('#field-firstname').type('AUT',{delay:0})
cy.get(':nth-child(3) > .col-md-6 > .form-control').type('AUT',{delay:0})
cy.get('#field-firstname').type('AUT')
cy.get('#field-lastname').type('AUT')
cy.get('#field-company').type('AUT')
cy.get('#field-siret').type('123')
const uuid = () => Cypress._.random(0, 1e6)
const id = uuid()
const testname = `testemail${id}@testing.com`
cy.get(':nth-child(4) > .col-md-6 > .form-control').type(testname, {delay: 0})
cy.get(':nth-child(6) > .col-md-6 > .input-group > .form-control').type('123456',{delay:0})
cy.get(':nth-child(9) > .col-md-6 > .custom-checkbox > label > input').check()
cy.get(':nth-child(6) > .col-md-6 > #field-email').type(testname, {delay: 0})
cy.get('.field-password-policy > .form-group > .col-md-6 > .input-group > #field-password').type('123456',{delay:0})
cy.get(':nth-child(11) > .col-md-6 > .custom-checkbox > label').click({force:true})
cy.get(':nth-child(13) > .col-md-6 > .custom-checkbox > label').click({force:true})
cy.get('#customer-form > .form-footer > .continue').click()
cy.reload()
cy.wait(2000)
cy.visit('/en/order')
cy.get(':nth-child(6) > .col-md-6 > .form-control').type('123456',{delay:0})
cy.get(':nth-child(7) > .col-md-6 > .form-control').type('123456',{delay:0}).as('vat number')
cy.get(':nth-child(8) > .col-md-6 > .form-control').type('ADDR',{delay:0}).as('address')
Expand All @@ -97,7 +99,7 @@ it.skip('C339385: 50 Credit Card Guest Checkouting [Payments API]', () => { // p
cy.get('[class="button form__button"]').click()
cy.get('#content-hook_order_confirmation > .card-block').should('be.visible')
})
it.skip('C339386: 51 Credit Card Guest Checkouting with not 3DS secure card [Payments API]', () => {
it.skip('C339386: 51 Credit Card Guest Checkouting with not 3DS secure card [Payments API]', () => { // possibly a PS8 / Cypress compatibility issue, that Cart is celaning the cookies...
cy.clearCookies()
//Payments API item
cy.visit('/en/', { headers: {"Accept-Encoding": "gzip, deflate"}})
Expand Down Expand Up @@ -178,7 +180,7 @@ it('C339393: 58 Giropay Checkouting [Payments API]', () => {
cy.get('[class="button form__button"]').click()
cy.get('#content-hook_order_confirmation > .card-block').should('be.visible')
});
it.skip('C339394: 59 Giropay BO Refunding, Partial Refunding [Payments API]', () => { // temporary skipping, because Mollie block is not loaded properly
it('C339394: 59 Giropay BO Refunding, Partial Refunding [Payments API]', () => {
cy.OrderRefundingPartialPaymentsAPI()
});
it('C339395: 60 EPS Checkouting [Payments API]', () => {
Expand All @@ -191,7 +193,7 @@ it('C339395: 60 EPS Checkouting [Payments API]', () => {
cy.get('[class="button form__button"]').click()
cy.get('#content-hook_order_confirmation > .card-block').should('be.visible')
});
it.skip('C339396: 61 EPS BO Refunding, Partial Refunding [Payments API]', () => { // temporary skipping, because Mollie block is not loaded properly
it('C339396: 61 EPS BO Refunding, Partial Refunding [Payments API]', () => {
cy.OrderRefundingPartialPaymentsAPI()
});
it('C339397: 62 KBC/CBC Checkouting [Payments API]', () => {
Expand All @@ -205,7 +207,7 @@ it('C339397: 62 KBC/CBC Checkouting [Payments API]', () => {
cy.get('[class="button form__button"]').click()
cy.get('#content-hook_order_confirmation > .card-block').should('be.visible')
});
it.skip('C339398: 63 KBC/CBC BO Refunding, Partial Refunding [Payments API]', () => { // temporary skipping, because Mollie block is not loaded properly
it('C339398: 63 KBC/CBC BO Refunding, Partial Refunding [Payments API]', () => {
cy.OrderRefundingPartialPaymentsAPI()
});
it('C339399: 64 Belfius Checkouting [Payments API]', () => {
Expand All @@ -218,7 +220,7 @@ it('C339399: 64 Belfius Checkouting [Payments API]', () => {
cy.get('[class="button form__button"]').click()
cy.get('#content-hook_order_confirmation > .card-block').should('be.visible')
});
it.skip('C339400: 65 Belfius BO Refunding, Partial Refunding [Payments API]', () => { // temporary skipping, because Mollie block is not loaded properly
it('C339400: 65 Belfius BO Refunding, Partial Refunding [Payments API]', () => {
cy.OrderRefundingPartialPaymentsAPI()
});
it('C339401: 66 Bank Transfer Checkouting [Payments API]', () => {
Expand All @@ -234,17 +236,4 @@ it('C339401: 66 Bank Transfer Checkouting [Payments API]', () => {
it.skip('C339402: 67 Bank Transfer BO Refunding, Partial Refunding [Payments API]', () => { // somehow an error in console is thrown, will check why. Temporary skipping, because Mollie block is not loaded properly
cy.OrderRefundingPartialPaymentsAPI()
})
it('C1860462: Pay with Klarna UK Checkouting [Payments API]', () => {
cy.navigatingToThePaymentPS8()
//Payment method choosing
cy.contains('Pay with Klarna').click({force:true})
cy.get('.condition-label > .js-terms').click({force:true})
cy.contains('Place order').click()
cy.get('[value="authorized"]').click()
cy.get('[class="button form__button"]').click()
cy.get('#content-hook_order_confirmation > .card-block').should('be.visible')
});
it('C1860463: Pay with Klarna UK Order BO Refunding, Partial Refunding [Payments API]', () => {
cy.OrderRefundingPartialPaymentsAPI()
})
})
8 changes: 6 additions & 2 deletions cypress/e2e/ps8/07_mollie.ps8.Cloudsync.specs.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,17 @@ afterEach(() => {
afterEach(function() {
if (this.currentTest.state === "failed") failEarly = true
});
describe('PS8 Cloudsync tests', () => {
describe('PS8 CloudSync tests', () => {
beforeEach(() => {
cy.viewport(1920,1080)
cy.CachingBOFOPS8()
})
it('Checking if Cloudsync UI is appearing in the module', () => {
it('C2885757: Checking if the CloudSync UI is appearing in the module', () => {
cy.OpeningModuleDashboardURL()
cy.CloudSyncUI()
})
it('C2885758: Checking if the PS Accounts / Popup UI is appearing in the module', () => {
cy.OpeningModuleDashboardURL()
cy.PsAccountsUI()
});
})
21 changes: 15 additions & 6 deletions cypress/support/commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ import 'cypress-iframe';
// Cypress.Commands.add("login", (email, password) => { ... })
Cypress.Commands.add("ConfOrdersAPI1784", () => {

const paymentMethods = ["applepay", "ideal", "creditcard", "in3", "klarnapaylater", "klarnapaynow", "klarnasliceit", "paypal", "banktransfer", "giftcard", "bancontact", "eps", "giropay", "przelewy24", "kbc", "belfius", "voucher", "directdebit", "billie", "klarna", "twint"];
const paymentMethods = ["applepay", "ideal", "creditcard", "in3", "klarnapaylater", "klarnapaynow", "klarnasliceit", "paypal", "banktransfer", "giftcard", "bancontact", "eps", "giropay", "przelewy24", "kbc", "belfius", "voucher", "directdebit", "billie", "klarna", "twint", "blik"];

// Iterate through the paymentMethods array using forEach
paymentMethods.forEach(method => {
Expand All @@ -59,7 +59,7 @@ Cypress.Commands.add("ConfOrdersAPI1784", () => {
})
Cypress.Commands.add("ConfPaymentsAPI1784", () => {

const paymentMethods = ["giropay", "eps", "przelewy24", "kbc", "belfius", "bancontact", "creditcard", "ideal", "banktransfer", "paypal", "applepay"];
const paymentMethods = ["giropay", "eps", "przelewy24", "kbc", "belfius", "bancontact", "creditcard", "ideal", "banktransfer", "paypal", "applepay", "twint", "blik"];

// Iterate through the paymentMethods array using forEach
paymentMethods.forEach(method => {
Expand Down Expand Up @@ -252,8 +252,17 @@ Cypress.Commands.add("selectSubscriptionsCarriersCheck", {cacheAcrossSpecs: true
cy.contains('Options saved successfully.').should('be.visible') //checking if saving returns green alert
})
Cypress.Commands.add("CloudSyncUI", {cacheAcrossSpecs: true}, () => {
cy.get('prestashop-accounts').should('be.visible')
cy.get('[id="prestashop-cloudsync"]').should('be.visible')
cy.get('prestashop-accounts').click(1650, 100)
// wip, looking for modal inner interaction
cy.wait(3000)
cy.iframe('[id^="uid_"]').find('button').should('be.visible')
})
Cypress.Commands.add("PsAccountsUI", {cacheAcrossSpecs: true}, () => {
cy.wait(3000)
cy.get('prestashop-accounts').shadow().find('[id="associate-shop-button"]').click()
// Wait for the popup window to open
cy.window().then(win => {
// Access the popup window's document
const popupDocument = win.document;
// Perform actions within the popup window
cy.wrap(popupDocument).find('body')
});
})
2 changes: 2 additions & 0 deletions cypress/support/e2e.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,3 +58,5 @@ import "@frsource/cypress-plugin-visual-regression-diff";

// javascript
require("@frsource/cypress-plugin-visual-regression-diff");

import 'cypress-shadow-dom';
2 changes: 1 addition & 1 deletion docker-compose.1785.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ services:
DB_PASSWD: $DB_PASSWD
DB_NAME: prestashop
DB_SERVER: mysql
PS_DOMAIN: demoshop1785.ngrok.io
PS_DOMAIN: demoshop1785debug.ngrok.io
PS_FOLDER_INSTALL: install
PS_FOLDER_ADMIN: admin1
depends_on:
Expand Down
Loading

0 comments on commit d9055d7

Please sign in to comment.