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

E2E improvements february #879

Merged
merged 14 commits into from
Feb 14, 2024
75 changes: 0 additions & 75 deletions .docker/.htaccess8

This file was deleted.

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
FROM prestashop/prestashop:8.1.3-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
4 changes: 2 additions & 2 deletions .github/workflows/upgrading_check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ jobs:
matrix:
include:
- prestashop: 'PS1785'
make: 'make e2eh1785'
make: 'make VERSION=1785 e2eh1785'
port: '8002'
yml: 'docker-compose.1785.yml'
ModuleUpgradeTest: 'make upgrading-module-test-1785'
ModuleUpgradeTest: 'make VERSION=1785 upgrading-module-test-1785'
steps:
- name: Checkout
uses: actions/[email protected]
Expand Down
8 changes: 5 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ e2eh$(VERSION)_local:
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
Expand Down Expand Up @@ -66,16 +68,16 @@ run-e2e-tests-locally:
npx cypress run

# checking the module upgrading - installs older module then installs from master branch
upgrading-module-test-1785:
upgrading-module-test-$(VERSION):
git fetch
git checkout v5.2.0 .
composer install
# installing 5.2.0 module
docker exec -i prestashop-mollie-1785 sh -c "cd /var/www/html && php bin/console prestashop:module install mollie"
docker exec -i prestashop-mollie-$(VERSION) sh -c "cd /var/www/html && php bin/console prestashop:module install mollie"
# installing develop branch module
git checkout -- .
git checkout develop --force
docker exec -i prestashop-mollie-1785 sh -c "cd /var/www/html && php bin/console prestashop:module install mollie"
docker exec -i prestashop-mollie-$(VERSION) sh -c "cd /var/www/html && php bin/console prestashop:module install mollie"

npm-package-install:
cd views/assets && npm i && npm run build
4 changes: 1 addition & 3 deletions cypress/e2e/ps8/01_mollie.ps8.ModuleConfiguration.specs.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const login = (MollieBOFOLoggingIn) => {
cy.get('#email').type('[email protected]',{delay: 0, log: false})
cy.get('#passwd').type('prestashop_demo',{delay: 0, log: false})
cy.get('#submit_login').click().wait(1000).as('Connection successsful')
cy.visit('/en/my-account')
cy.visit('/my-account')
cy.get('#login-form [name="email"]').eq(0).type('[email protected]')
cy.get('#login-form [name="password"]').eq(0).type('prestashop_demo')
cy.get('#login-form [type="submit"]').eq(0).click({force:true})
Expand Down Expand Up @@ -79,8 +79,6 @@ it('C339339: Checking the Advanced Settings tab, verifying the Front-end compone
cy.get('[id="MOLLIE_AS_STATUSES_info"]').should('exist')
cy.get('[name="MOLLIE_DISPLAY_ERRORS"]').should('exist')
cy.get('[name="MOLLIE_DEBUG_LOG"]').should('exist')
cy.get('[name="MOLLIE_SUBSCRIPTION_ORDER_CARRIER_ID"]').should('be.visible') // checking the Subscriptions carriers select
cy.get('[name="MOLLIE_SUBSCRIPTION_ORDER_CARRIER_ID"]').select('Click and collect')
cy.get('#module_form_submit_btn').click({force:true}) //checking the saving
cy.get('[class="alert alert-success"]').should('be.visible') //checking if saving returns green alert
cy.reload()
Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/ps8/03_mollie.ps8.PaymentTestsOrdersAPI.js
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ it('C339359: 22 IN3 should not be shown under 5000 EUR [Orders API]', () => {
cy.visit('/en/index.php?controller=history')
cy.contains('Reorder').click()
cy.visit('/en/cart?action=show')
cy.get('[class="js-cart-line-product-quantity form-control"]').clear().type('200')
cy.get('[class="js-cart-line-product-quantity form-control"]').eq(0).clear().type('250')
cy.contains('Proceed to checkout').click()
cy.contains('NL').click()
//Billing country LT, DE etc.
Expand Down
65 changes: 35 additions & 30 deletions cypress/e2e/ps8/06_mollie.ps8.Subscriptions.js
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -26,47 +26,52 @@ describe('PS8 Subscriptions Test Suite', () => {
beforeEach(() => {
cy.viewport(1920,1080)
login('MollieBOFOLoggingIn')
cy.intercept('GET', '**/*.jpg', { // intercepting the UI with no images, for faster test run
statusCode: 200,
body: '', // Empty response
})
cy.intercept('GET', '**/*.png', {
statusCode: 200,
body: '', // Empty response
})
})
it('C176305: Check if Subscription options added in Product BO', () => {
cy.visit('/admin1/')
cy.get('#subtab-AdminCatalog > :nth-child(1)').click()
cy.get('#subtab-AdminProducts > .link').click()
cy.get('[data-product-id="8"]').find('[class="btn tooltip-link product-edit"]').click()
cy.contains('Product with combinations').click()
cy.get('[id="tab_step3"]').click()
cy.get('tbody').find('tr:nth-child(12)').find('a').eq(0).click() // clicks on the product ID #8
cy.get('.product-type-preview').click()
cy.get('.modal-content').within(() => {
cy.get('[data-value="combinations"]').click()
cy.contains('Change product type').click()
cy.wait(1000)
cy.contains('Change product type').click()
})
cy.contains('Combinations').click()
cy.contains('Generate combinations').click()
cy.contains('Daily').click({force:true})
cy.contains('None').click({force:true})
cy.get('[class="token"]').should('be.visible')
cy.get('#create-combinations').click()
cy.wait(5000)
cy.reload()
cy.wait(5000)
cy.get('.modal-footer > .btn-primary').click()
cy.contains('Mollie Subscription - Daily').should('be.visible')
cy.contains('Mollie Subscription - None').should('be.visible')
cy.get('[class="attribute-quantity"]').first().find('[type="text"]').clear().type('999')
cy.get('[class="attribute-quantity"]').last().find('[type="text"]').clear().type('999')
cy.get('#submit').click()
cy.get('.growl-message').contains('Settings updated.')
cy.wait(3000)
cy.get('#combination_list')
.find('tr:contains("Mollie")') // Filter to only rows containing "Mollie"
.find('td')
.find('input[type="number"]')
.each(($input) => {
cy.wrap($input).clear().type('888')
})
cy.get('#save-combinations-edition').click()
cy.get('#product_footer_save').click()
cy.contains('Successful update').should('be.visible')
cy.wait(2000)
cy.screenshot()
})
it.skip('C1672516: Check if Subscription options are in Product Page FO and then register the Subscription product by purchasing it', () => { //PS805 test is not working on Cypress, deleting the Cart session somehow, checking for alternative test
it('C1672516: Check if Subscription options are in Product Page FO', () => { // PS 8.x test is not working on Cypress, deleting the Cart session somehow, checking for alternative test
cy.visit('/en/')
cy.get('[data-id-product="8"]').click()
cy.get('[aria-label="Subscription"]').should('be.visible') //asserting if there is a Subscription dropdown in product page
cy.contains('Add to cart').click()
cy.contains('Proceed to checkout').click()
cy.visit('/en/cart?action=show') //strangely, session is deleted somehow, but after the visit to the Cart page again, the Cart is with an item again
cy.contains('Proceed to checkout').click()
cy.contains('DE').click()
cy.get('.clearfix > .btn').click()
cy.get('#js-delivery > .continue').click()
//Payment method choosing
cy.contains('Card').click({force:true})
//Credit card inputing
cy.CreditCardFillingIframe()
cy.get('.condition-label > .js-terms').click({force:true})
cy.get('.ps-shown-by-js > .btn').click()
cy.get('[value="paid"]').click()
cy.get('[class="button form__button"]').click()
cy.get('[data-id-product="8"]').first().click()
cy.get('[aria-label="Subscription"]').should('be.visible') // asserting if there is a Subscription dropdown in product page
});
it('C1672517: Check if Subscription options are implemented in My Account FO', () => {
cy.visit('/en/')
Expand Down
1 change: 0 additions & 1 deletion docker-compose.1785.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ services:
- "8002:80"
volumes:
- ./:/var/www/html/modules/mollie
- ./.docker/.htaccess1785:/var/www/html/.htaccess
networks:
- prestashop_mollie_net_1785
healthcheck:
Expand Down
4 changes: 2 additions & 2 deletions docker-compose.8.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ services:
interval: 10s
networks:
- prestashop_mollie_net_8
prestashop-8:

prestashop-mollie-8:
platform: linux/amd64
container_name: prestashop-mollie-8
build:
Expand All @@ -37,7 +38,6 @@ services:
- "8002:80"
volumes:
- ./:/var/www/html/modules/mollie
- ./.docker/.htaccess8:/var/www/html/.htaccess
networks:
- prestashop_mollie_net_8
healthcheck:
Expand Down
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"homepage": "https://github.com/mollie/PrestaShop#readme",
"devDependencies": {
"@frsource/cypress-plugin-visual-regression-diff": "^3.3.10",
"cypress": "^13.6.3",
"cypress": "^13.6.4",
"cypress-fail-fast": "^7.0.3",
"cypress-iframe": "^1.0.1",
"cypress-terminal-report": "^5.3.3",
Expand Down
Loading
Loading