diff --git a/dev/testv2/attributes/index.spec.js b/dev/testv2/attributes/index.spec.js index a761dd1..762c383 100644 --- a/dev/testv2/attributes/index.spec.js +++ b/dev/testv2/attributes/index.spec.js @@ -13,6 +13,10 @@ describe('Attributes endpoint', function () { describe('get', function () { it('should fetch attributes including extra fields for customer', async function () { + // @TODO Remove this line when the test is ready + let deliberateError = true; + expect(deliberateError).to.be.false; + const { attributes } = await this.magentoApi.execute('attributes', 'get', { type: 'customer' }); const mappedAttributes = mapAttributes(attributes); diff --git a/dev/testv2/cypress.config.js b/dev/testv2/cypress.config.js index 2e9eae6..40512d8 100644 --- a/dev/testv2/cypress.config.js +++ b/dev/testv2/cypress.config.js @@ -9,12 +9,9 @@ module.exports = defineConfig({ experimentalMemoryManagement: true, experimentalModifyObstructiveThirdPartyCode: true, modifyObstructiveCode: true, - chromeWebSecurity: false, - numTestsKeptInMemory: 0, blockHosts: ['*snippet.url.com', '*scarabresearch.com'], env: { - snippetUrl: 'http://snippet.url.com/main.js', - NODE_OPTIONS: "--max-old-space-size=4096" + snippetUrl: 'http://snippet.url.com/main.js' }, e2e: { // We've imported your old cypress plugins here. diff --git a/dev/testv2/cypress/integration/default-behaviour.spec.js b/dev/testv2/cypress/integration/default-behaviour.spec.js index ac79406..9f7f95d 100644 --- a/dev/testv2/cypress/integration/default-behaviour.spec.js +++ b/dev/testv2/cypress/integration/default-behaviour.spec.js @@ -23,6 +23,10 @@ describe('Default behaviour with everything turned off', function () { it('should not create customer_password_reset event', function () { const newPassword = 'newPassword1'; + // @TODO Remove this line when the test is ready + let deliberateError = true; + expect(deliberateError).to.be.false; + cy.loginWithCustomer(this.defaultCustomer); cy.changeCredentials(this.defaultCustomer.password, { password: newPassword }); diff --git a/dev/testv2/package.json b/dev/testv2/package.json index bf0344b..94adb8c 100644 --- a/dev/testv2/package.json +++ b/dev/testv2/package.json @@ -5,7 +5,7 @@ "scripts": { "postinstall": "if [ -d \"./../../.git\" ]; then npm run copy-git-hooks; fi", "test": "npm run mocha && npm run code-style", - "e2e": "cypress run --browser chrome", + "e2e": "cypress run --browser electron --headless", "e2e:ci": "cypress run --browser electron --headless --record --key 80ddf60c-0dca-4075-8074-31207092e038", "e2e:debug": "DEBUG=cypress:* cypress run --browser electron --headless", "quick-test": "npm run mocha", diff --git a/dev/testv2/tools/docker/Dockerfile-mage-node b/dev/testv2/tools/docker/Dockerfile-mage-node index 00550d4..da3a2ce 100644 --- a/dev/testv2/tools/docker/Dockerfile-mage-node +++ b/dev/testv2/tools/docker/Dockerfile-mage-node @@ -5,8 +5,8 @@ ENV NPM_TOKEN=${NPM_TOKEN} COPY testv2 /test WORKDIR /test -RUN npm ci && free -RUN ./node_modules/.bin/cypress install && free +RUN npm i +RUN ./node_modules/.bin/cypress install # RUN ./node_modules/.bin/cypress verify && free #CMD /usr/local/bin/shell.sh ; sleep infinity diff --git a/dev/testv2/tools/scripts/run-e2e.sh b/dev/testv2/tools/scripts/run-e2e.sh index ea67e5e..abc0bf7 100644 --- a/dev/testv2/tools/scripts/run-e2e.sh +++ b/dev/testv2/tools/scripts/run-e2e.sh @@ -24,12 +24,11 @@ echo "\n|--- Starting containers" docker compose -p mage_e2e_"$project_version" -f $composefile up --build -d echo "\n|--- Waiting for containers to initialize" sh ./wait.sh e2e >>/dev/null 2>&1 + echo "\n|--- Running frontend tests" -free -docker compose -p mage_e2e_"$project_version" -f $composefile run --rm node sh -c "free && npm run e2e" --exit-code-from node --abort-on-container-exit node +docker compose -p mage_e2e_"$project_version" -f $composefile run --rm node sh -c "npm run e2e" --exit-code-from node --abort-on-container-exit node exitcode=$? echo "\n\n|--- All tests passed" -free docker compose -p mage_e2e_"$project_version" -f $composefile down exit $exitcode diff --git a/dev/testv2/tools/scripts/run-unit.sh b/dev/testv2/tools/scripts/run-unit.sh index e0e82fe..0a4b805 100644 --- a/dev/testv2/tools/scripts/run-unit.sh +++ b/dev/testv2/tools/scripts/run-unit.sh @@ -27,12 +27,6 @@ docker compose -p mage_unit_$project_version -f $composefile up --build -d echo "\n|--- Waiting for containers to initialize" sh ./wait.sh unit >>/dev/null 2>&1 -if ![[ $VERSION =~ ^2\.3\.3 ]] -then - echo "\n|--- Testing Magento DI compilation" - docker compose -p mage_unit_$project_version -f $composefile exec -T --user application magento-test bash -c "bin/magento setup:di:compile" -fi - echo "\n|--- Running backend tests" docker compose -p mage_unit_$project_version -f $composefile run --rm node sh -c "npm run mocha" --exit-code-from node --abort-on-container-exit node exitcode=$?