Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

develop e2e improvements (testing the build) #881

Merged
merged 27 commits into from
Mar 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
ba6147f
testing the updated CI build
SimonasB88 Feb 19, 2024
14f82de
reverting the updates for CI
SimonasB88 Feb 19, 2024
4c09147
makefile improvements
SimonasB88 Feb 19, 2024
f1fe467
makefile small update
SimonasB88 Feb 19, 2024
431411b
small E2E test code refactoring
SimonasB88 Feb 19, 2024
57db158
updated cloudsync cases
SimonasB88 Feb 19, 2024
b470018
testrail extension updates
SimonasB88 Feb 20, 2024
af4aeba
updating cloudsync tests
SimonasB88 Feb 20, 2024
b0aaa9c
Merge branch 'develop' into develop-e2e-improvements
SimonasB88 Feb 26, 2024
003f0ca
cypress update
SimonasB88 Feb 26, 2024
ea4eb82
sofort payment method removal
SimonasB88 Feb 26, 2024
d4e3835
small refactoring
SimonasB88 Feb 26, 2024
35da04a
small updates for test code
SimonasB88 Feb 26, 2024
d339d86
small typos
SimonasB88 Feb 26, 2024
5575c4c
adding different URL for tunneling
SimonasB88 Mar 4, 2024
36a51e2
small E2E tests update
SimonasB88 Mar 4, 2024
6c2d278
added stricked statements
SimonasB88 Mar 4, 2024
a275904
temporary skip
SimonasB88 Mar 4, 2024
dff4cc8
updating test specs
SimonasB88 Mar 4, 2024
8759215
reverting back from debug url
SimonasB88 Mar 4, 2024
1ab8eaf
adding new sql seed for testing
SimonasB88 Mar 4, 2024
2155534
database updates
SimonasB88 Mar 4, 2024
1ed718e
correcting ps8 seed
SimonasB88 Mar 4, 2024
5ab3ecf
Merge branch 'develop' into develop-e2e-improvements
SimonasB88 Mar 5, 2024
e0b8259
small test code fix
SimonasB88 Mar 6, 2024
20b1457
small test code fixes
SimonasB88 Mar 6, 2024
0a22ff0
small typo
SimonasB88 Mar 6, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
79 changes: 0 additions & 79 deletions .docker/.htaccess1785

This file was deleted.

53 changes: 29 additions & 24 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
ROOT_DIR:=$(shell dirname $(realpath $(firstword $(MAKEFILE_LIST))))
module = mollie

# target: fix-lint - Launch php cs fixer
fix-lint:
Expand All @@ -14,26 +15,15 @@ endif

# Local machine docker build with PS autoinstall
e2eh$(VERSION)_local:
composer install
# detaching containers
docker-compose -f docker-compose.$(VERSION).yml up -d --force-recreate
# sees what containers are running
docker-compose -f docker-compose.$(VERSION).yml ps
# waiting for app containers to build up
/bin/bash .docker/wait-loader.sh 8002
# seeding the customized settings for PS
mysql -h 127.0.0.1 -P 9002 --protocol=tcp -u root -pprestashop prestashop < ${PWD}/tests/seed/database/prestashop_$(VERSION).sql
# installing module
docker exec -i prestashop-mollie-$(VERSION) sh -c "cd /var/www/html && php bin/console prestashop:module install mollie"
# installing module (in case for Addons Marketplace)
docker exec -i prestashop-mollie-$(VERSION) sh -c "cd /var/www/html && php bin/console prestashop:module install mollie"
# uninstalling module
docker exec -i prestashop-mollie-$(VERSION) sh -c "cd /var/www/html && php bin/console prestashop:module uninstall mollie"
# installing the module again
docker exec -i prestashop-mollie-$(VERSION) sh -c "cd /var/www/html && php bin/console prestashop:module install mollie"
# enabling the module
docker exec -i prestashop-mollie-$(VERSION) sh -c "cd /var/www/html && php bin/console prestashop:module enable mollie"
# chmod all folders
docker exec -i prestashop-mollie-$(VERSION) sh -c "chmod -R 777 /var/www/html"
make waiting-for-containers-local
make seeding-customized-sql
make installing-uninstalling-enabling-module
make chmod-app
make open-e2e-tests-locally

# For CI build with PS autoinstall
Expand All @@ -42,20 +32,35 @@ e2eh$(VERSION):
docker-compose -f docker-compose.$(VERSION).yml up -d --force-recreate
# sees what containers are running
docker-compose -f docker-compose.$(VERSION).yml ps
make waiting-for-containers-CI
make seeding-customized-sql
make installing-uninstalling-enabling-module
make chmod-app

waiting-for-containers-CI:
# waiting for app containers to build up
sleep 90s
# configuring base database

waiting-for-containers-local:
# waiting for app containers to build up
/bin/bash .docker/wait-loader.sh 8002

seeding-customized-sql:
mysql -h 127.0.0.1 -P 9002 --protocol=tcp -u root -pprestashop prestashop < ${PWD}/tests/seed/database/prestashop_$(VERSION).sql

installing-uninstalling-enabling-module:
# installing module
docker exec -i prestashop-mollie-$(VERSION) sh -c "cd /var/www/html && php bin/console prestashop:module install mollie"
docker exec -i prestashop-$(module)-$(VERSION) sh -c "cd /var/www/html && php bin/console prestashop:module install $(module)"
# uninstalling module
docker exec -i prestashop-mollie-$(VERSION) sh -c "cd /var/www/html && php bin/console prestashop:module uninstall mollie"
docker exec -i prestashop-$(module)-$(VERSION) sh -c "cd /var/www/html && php bin/console prestashop:module uninstall $(module)"
# installing the module again
docker exec -i prestashop-mollie-$(VERSION) sh -c "cd /var/www/html && php bin/console prestashop:module install mollie"
docker exec -i prestashop-$(module)-$(VERSION) sh -c "cd /var/www/html && php bin/console prestashop:module install $(module)"
# enabling the module
docker exec -i prestashop-mollie-$(VERSION) sh -c "cd /var/www/html && php bin/console prestashop:module enable mollie"
docker exec -i prestashop-$(module)-$(VERSION) sh -c "cd /var/www/html && php bin/console prestashop:module enable $(module)"

chmod-app:
# chmod all folders
docker exec -i prestashop-mollie-$(VERSION) sh -c "chmod -R 777 /var/www/html"
docker exec -i prestashop-$(module)-$(VERSION) sh -c "chmod -R 777 /var/www/html"

open-e2e-tests-locally:
npm install -D cypress
Expand All @@ -73,11 +78,11 @@ upgrading-module-test-$(VERSION):
git checkout v5.2.0 .
composer install
# installing 5.2.0 module
docker exec -i prestashop-mollie-$(VERSION) sh -c "cd /var/www/html && php bin/console prestashop:module install mollie"
docker exec -i prestashop-$(module)-$(VERSION) sh -c "cd /var/www/html && php bin/console prestashop:module install $(module)"
# installing develop branch module
git checkout -- .
git checkout develop --force
docker exec -i prestashop-mollie-$(VERSION) sh -c "cd /var/www/html && php bin/console prestashop:module install mollie"
docker exec -i prestashop-$(module)-$(VERSION) sh -c "cd /var/www/html && php bin/console prestashop:module install $(module)"

npm-package-install:
cd views/assets && npm i && npm run build
18 changes: 2 additions & 16 deletions cypress/e2e/ps1785/01_mollie.ps1785.ModuleConfiguration.specs.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,5 @@
/// <reference types="Cypress" />
//Caching the BO and FO session
const login = (MollieBOFOLoggingIn) => {
cy.session(MollieBOFOLoggingIn,() => {
cy.visit('/admin1/')
cy.url().should('contain', 'https').as('Check if HTTPS exists')
cy.get('#email').type('[email protected]',{delay: 0, log: false})
cy.get('#passwd').type('demodemo',{delay: 0, log: false})
cy.get('#submit_login').click().wait(1000).as('Connection successsful')
cy.visit('/en/my-account')
cy.get('#login-form [name="email"]').eq(0).type('[email protected]')
cy.get('#login-form [name="password"]').eq(0).type('demodemo')
cy.get('#login-form [type="submit"]').eq(0).click({force:true})
cy.get('#history-link > .link-item').click()
})
}

//Checking the console for errors
let windowConsoleError;
Cypress.on('window:before:load', (win) => {
Expand All @@ -30,7 +16,7 @@ afterEach(function() {
describe('PS1785 Module initial configuration setup', () => {
beforeEach(() => {
cy.viewport(1920,1080)
login('MollieBOFOLoggingIn')
cy.CachingBOFOPS1785()
})
it('C339305: 01 Connecting test API successsfully', () => {
cy.visit('/admin1/')
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,5 @@
/// <reference types="Cypress" />
//Caching the BO and FO session
const login = (MollieBOFOLoggingIn) => {
cy.session(MollieBOFOLoggingIn,() => {
cy.visit('/admin1/')
cy.url().should('contain', 'https').as('Check if HTTPS exists')
cy.get('#email').type('[email protected]',{delay: 0, log: false})
cy.get('#passwd').type('demodemo',{delay: 0, log: false})
cy.get('#submit_login').click().wait(1000).as('Connection successsful')
})
}

//Checking the console for errors
let windowConsoleError;
Cypress.on('window:before:load', (win) => {
Expand All @@ -25,7 +16,7 @@ afterEach(function() {
describe('PS1785 Enabling Payments', () => {
beforeEach(() => {
cy.viewport(1920,1080)
login('MollieBOFOLoggingIn')
cy.CachingBOFOPS1785()
})
it('C339341: 04 Enabling All payments in Module BO [Orders API]', () => {
cy.visit('/admin1/')
Expand Down
47 changes: 4 additions & 43 deletions cypress/e2e/ps1785/03_mollie.ps1785.PaymentTestsOrdersAPI.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,5 @@
/// <reference types="Cypress" />
//Caching the BO and FO session
const login = (MollieBOFOLoggingIn) => {
cy.session(MollieBOFOLoggingIn,() => {
cy.visit('/admin1/')
cy.url().should('contain', 'https').as('Check if HTTPS exists')
cy.get('#email').type('[email protected]',{delay: 0, log: false})
cy.get('#passwd').type('demodemo',{delay: 0, log: false})
cy.get('#submit_login').click().wait(1000).as('Connection successsful')
cy.visit('/en/my-account')
cy.get('#login-form [name="email"]').eq(0).type('[email protected]')
cy.get('#login-form [name="password"]').eq(0).type('demodemo')
cy.get('#login-form [type="submit"]').eq(0).click({force:true})
cy.get('#history-link > .link-item').click()
})
}

//Checking the console for errors
let windowConsoleError;
Cypress.on('window:before:load', (win) => {
Expand All @@ -28,8 +14,8 @@ describe('PS1785 Tests Suite [Orders API]', {
},
}, () => {
beforeEach(() => {
login('MollieBOFOLoggingIn')
cy.viewport(1920,1080)
cy.CachingBOFOPS1785()
})
it.skip('C339342: 05 Vouchers Checkouting [Orders API]', () => { //possible bug
cy.navigatingToThePayment()
Expand Down Expand Up @@ -216,31 +202,6 @@ it('C339361: 24 Paypal Checkouting [Orders API]', () => {
it('C339362: 25 Paypal Order Shipping, Refunding [Orders API]', () => {
cy.OrderRefundingShippingOrdersAPI()
})
it('C339363: 26 SOFORT Checkouting [Orders API]', () => {
cy.navigatingToThePayment()
//Payment method choosing
cy.contains('SOFORT').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('C339364: 27 SOFORT Order Shipping, Refunding [Orders API]', () => {
cy.visit('/admin1/index.php?controller=AdminOrders')
cy.get(':nth-child(1) > .column-payment').click()
//Shipping button in React
cy.get('.btn-group > .btn-primary').click()
cy.get('[class="swal-button swal-button--confirm"]').click()
cy.get('.swal-modal').should('exist')
cy.get('#input-carrier').clear({force: true}).type('FedEx',{delay:0})
cy.get('#input-code').clear({force: true}).type('123456',{delay:0})
cy.get('#input-url').clear({force: true}).type('https://www.invertus.eu',{delay:0})
cy.get(':nth-child(2) > .swal-button').click()
cy.get('#mollie_order > :nth-child(1) > .alert').contains('Shipment was made successfully!')
cy.get('[class="alert alert-success"]').should('be.visible')
//Refunding not possible because "We haven't received the payment on our bank accounts yet" message from Mollie Dashboard
})
it('C339365: 28 Przelewy24 Checkouting [Orders API]', () => {
cy.navigatingToThePayment()
//Payment method choosing
Expand Down Expand Up @@ -357,7 +318,7 @@ it('C1765085: Billie Checkouting [Orders API]', () => {
it('C1765086: Billie Order Shipping, Refunding [Orders API]', () => {
cy.OrderShippingRefundingOrdersAPI()
})
it.skip('C1860460: Pay with Klarna UK Checkouting [Orders API]', () => { // currently not supported for PS, skipping temporary
it('C1860460: Pay with Klarna UK Checkouting [Orders API]', () => {
cy.visit('/en/order-history')
cy.contains('Reorder').click()
cy.contains('UK').click({force:true})
Expand All @@ -372,7 +333,7 @@ it.skip('C1860460: Pay with Klarna UK Checkouting [Orders API]', () => { // curr
cy.get('[class="button form__button"]').click()
cy.get('#content-hook_order_confirmation > .card-block').should('be.visible')
});
it.skip('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]', () => { // currently not supported for PS, skipping temporary
cy.OrderShippingRefundingOrdersAPI()
})
})
Original file line number Diff line number Diff line change
@@ -1,14 +1,5 @@
/// <reference types="Cypress" />
//Caching the BO and FO session
const login = (MollieBOFOLoggingIn) => {
cy.session(MollieBOFOLoggingIn,() => {
cy.visit('/admin1/')
cy.url().should('contain', 'https').as('Check if HTTPS exists')
cy.get('#email').type('[email protected]',{delay: 0, log: false})
cy.get('#passwd').type('demodemo',{delay: 0, log: false})
cy.get('#submit_login').click().wait(1000).as('Connection successsful')
})
}

//Checking the console for errors
let windowConsoleError;
Cypress.on('window:before:load', (win) => {
Expand All @@ -25,7 +16,7 @@ afterEach(function() {
describe('PS1785 Enabling Payments', () => {
beforeEach(() => {
cy.viewport(1920,1080)
login('MollieBOFOLoggingIn')
cy.CachingBOFOPS1785()
})
it('C339377: 42 [SWITCH TO PAYMENTS API] Enabling All payments in Module BO [Payments API]', () => {
cy.visit('/admin1/')
Expand Down
Loading
Loading