diff --git a/circle.yml b/circle.yml index b8d7ab603050..ab6bae4b14cb 100644 --- a/circle.yml +++ b/circle.yml @@ -37,6 +37,24 @@ executors: PLATFORM: mac commands: + run-e2e-tests: + parameters: + browser: + description: browser shortname to target + type: string + chunk: + description: e2e test chunk number + type: integer + steps: + - attach_workspace: + at: ~/ + - run: + command: npm run test-e2e -- --chunk << parameters.chunk >> --browser << parameters.browser >> + working_directory: packages/server + - store_test_results: + path: /tmp/cypress + - store-npm-logs + store-npm-logs: description: Saves any NPM debug logs as artifacts in case there is a problem steps: @@ -331,101 +349,117 @@ jobs: path: /tmp/artifacts - store-npm-logs - "server-e2e-tests-1": + "server-e2e-tests-chrome-1": <<: *defaults steps: - - attach_workspace: - at: ~/ - - run: - command: npm run test-e2e -- --chunk 1 - working_directory: packages/server - - store_test_results: - path: /tmp/cypress - - store-npm-logs + - run-e2e-tests: + browser: chrome + chunk: 1 - "server-e2e-tests-2": + "server-e2e-tests-chrome-2": <<: *defaults steps: - - attach_workspace: - at: ~/ - - run: - command: npm run test-e2e -- --chunk 2 - working_directory: packages/server - - store_test_results: - path: /tmp/cypress - - store-npm-logs + - run-e2e-tests: + browser: chrome + chunk: 2 - "server-e2e-tests-3": + "server-e2e-tests-chrome-3": <<: *defaults steps: - - attach_workspace: - at: ~/ - - run: - command: npm run test-e2e -- --chunk 3 - working_directory: packages/server - - store_test_results: - path: /tmp/cypress + - run-e2e-tests: + browser: chrome + chunk: 3 + "server-e2e-tests-chrome-4": + <<: *defaults + steps: + - run-e2e-tests: + browser: chrome + chunk: 4 - "server-e2e-tests-4": + "server-e2e-tests-chrome-5": <<: *defaults steps: - - attach_workspace: - at: ~/ - - run: - command: npm run test-e2e -- --chunk 4 - working_directory: packages/server - - store_test_results: - path: /tmp/cypress - - store-npm-logs + - run-e2e-tests: + browser: chrome + chunk: 5 - "server-e2e-tests-5": + "server-e2e-tests-chrome-6": <<: *defaults steps: - - attach_workspace: - at: ~/ - - run: - command: npm run test-e2e -- --chunk 5 - working_directory: packages/server - - store_test_results: - path: /tmp/cypress - - store-npm-logs + - run-e2e-tests: + browser: chrome + chunk: 6 - "server-e2e-tests-6": + "server-e2e-tests-chrome-7": <<: *defaults steps: - - attach_workspace: - at: ~/ - - run: - command: npm run test-e2e -- --chunk 6 - working_directory: packages/server - - store_test_results: - path: /tmp/cypress - - store-npm-logs + - run-e2e-tests: + browser: chrome + chunk: 7 - "server-e2e-tests-7": + "server-e2e-tests-chrome-8": <<: *defaults steps: - - attach_workspace: - at: ~/ - - run: - command: npm run test-e2e -- --chunk 7 - working_directory: packages/server - - store_test_results: - path: /tmp/cypress - - store-npm-logs + - run-e2e-tests: + browser: chrome + chunk: 8 - "server-e2e-tests-8": - <<: *defaults - steps: - - attach_workspace: - at: ~/ - - run: - command: npm run test-e2e -- --chunk 8 - working_directory: packages/server - - store_test_results: - path: /tmp/cypress - - store-npm-logs + "server-e2e-tests-electron-1": + <<: *defaults + steps: + - run-e2e-tests: + browser: electron + chunk: 1 + + "server-e2e-tests-electron-2": + <<: *defaults + steps: + - run-e2e-tests: + browser: electron + chunk: 2 + + "server-e2e-tests-electron-3": + <<: *defaults + steps: + - run-e2e-tests: + browser: electron + chunk: 3 + + "server-e2e-tests-electron-4": + <<: *defaults + steps: + - run-e2e-tests: + browser: electron + chunk: 4 + + "server-e2e-tests-electron-5": + <<: *defaults + steps: + - run-e2e-tests: + browser: electron + chunk: 5 + + "server-e2e-tests-electron-6": + <<: *defaults + steps: + - run-e2e-tests: + browser: electron + chunk: 6 + + "server-e2e-tests-electron-7": + <<: *defaults + steps: + - run-e2e-tests: + browser: electron + chunk: 7 + + "server-e2e-tests-electron-8": + <<: *defaults + steps: + - run-e2e-tests: + browser: electron + chunk: 8 "driver-integration-tests-chrome": <<: *defaults @@ -829,28 +863,52 @@ linux-workflow: &linux-workflow - server-performance-tests: requires: - build - - server-e2e-tests-1: + - server-e2e-tests-chrome-1: + requires: + - build + - server-e2e-tests-chrome-2: + requires: + - build + - server-e2e-tests-chrome-3: + requires: + - build + - server-e2e-tests-chrome-4: + requires: + - build + - server-e2e-tests-chrome-5: + requires: + - build + - server-e2e-tests-chrome-6: + requires: + - build + - server-e2e-tests-chrome-7: + requires: + - build + - server-e2e-tests-chrome-8: + requires: + - build + - server-e2e-tests-electron-1: requires: - build - - server-e2e-tests-2: + - server-e2e-tests-electron-2: requires: - build - - server-e2e-tests-3: + - server-e2e-tests-electron-3: requires: - build - - server-e2e-tests-4: + - server-e2e-tests-electron-4: requires: - build - - server-e2e-tests-5: + - server-e2e-tests-electron-5: requires: - build - - server-e2e-tests-6: + - server-e2e-tests-electron-6: requires: - build - - server-e2e-tests-7: + - server-e2e-tests-electron-7: requires: - build - - server-e2e-tests-8: + - server-e2e-tests-electron-8: requires: - build - driver-integration-tests-chrome: diff --git a/cli/package.json b/cli/package.json index e39ca410e074..c8c3ec3900e5 100644 --- a/cli/package.json +++ b/cli/package.json @@ -86,7 +86,7 @@ "proxyquire": "2.1.0", "shelljs": "0.8.3", "sinon": "7.2.2", - "snap-shot-it": "7.8.0", + "snap-shot-it": "7.9.0", "spawn-mock": "1.0.0", "strip-ansi": "4.0.0" }, diff --git a/package.json b/package.json index b774bc5ad511..71de8a6e23c7 100644 --- a/package.json +++ b/package.json @@ -47,7 +47,7 @@ "set-next-ci-version": "node ./scripts/binary.js setNextVersion", "prestart": "npm run check-deps-pre", "start": "node ./cli/bin/cypress open --dev --global", - "stop-only": "npx stop-only --skip .cy,.publish,.projects,node_modules,dist,dist-test,fixtures,lib,bower_components,spec_helper.coffee", + "stop-only": "npx stop-only --skip .cy,.publish,.projects,node_modules,dist,dist-test,fixtures,lib,bower_components --exclude e2e.coffee", "stop-only-all": "npm run stop-only -- --folder packages", "test": "echo '⚠️ This root monorepo is only for local development and new contributions. There are no tests.'", "test-debug-package": "node ./scripts/test-debug-package.js", @@ -152,7 +152,7 @@ "shelljs": "0.8.3", "shx": "0.3.2", "sinon": "7.3.2", - "snap-shot-it": "7.8.0", + "snap-shot-it": "7.9.0", "stop-only": "3.0.1", "strip-ansi": "4.0.0", "terminal-banner": "1.1.0", diff --git a/packages/server/__snapshots__/1_base_url_spec.coffee.js b/packages/server/__snapshots__/1_base_url_spec.coffee.js index 4a6ffdac121e..ddb86519fed0 100644 --- a/packages/server/__snapshots__/1_base_url_spec.coffee.js +++ b/packages/server/__snapshots__/1_base_url_spec.coffee.js @@ -1,4 +1,4 @@ -exports['e2e baseUrl https passes 1'] = ` +exports['e2e baseUrl / https / passes'] = ` ==================================================================================================== @@ -59,7 +59,7 @@ exports['e2e baseUrl https passes 1'] = ` ` -exports['e2e baseUrl http passes 1'] = ` +exports['e2e baseUrl / http / passes'] = ` ==================================================================================================== diff --git a/packages/server/__snapshots__/1_commands_outside_of_test_spec.coffee.js b/packages/server/__snapshots__/1_commands_outside_of_test_spec.coffee.js index 605b1a5e23e4..f79031aa7bcf 100644 --- a/packages/server/__snapshots__/1_commands_outside_of_test_spec.coffee.js +++ b/packages/server/__snapshots__/1_commands_outside_of_test_spec.coffee.js @@ -1,4 +1,4 @@ -exports['e2e commands outside of test passes on passing assertions 1'] = ` +exports['e2e commands outside of test / passes on passing assertions'] = ` ==================================================================================================== @@ -55,179 +55,7 @@ exports['e2e commands outside of test passes on passing assertions 1'] = ` ` -exports['e2e commands outside of test [chrome] fails on cy commands 1'] = ` - -==================================================================================================== - - (Run Starting) - - ┌────────────────────────────────────────────────────────────────────────────────────────────────┐ - │ Cypress: 1.2.3 │ - │ Browser: FooBrowser 88 │ - │ Specs: 1 found (commands_outside_of_test_spec.coffee) │ - │ Searched: cypress/integration/commands_outside_of_test_spec.coffee │ - └────────────────────────────────────────────────────────────────────────────────────────────────┘ - - -──────────────────────────────────────────────────────────────────────────────────────────────────── - - Running: commands_outside_of_test_spec.coffee... (1 of 1) - - - 1) An uncaught error was detected outside of a test - - 0 passing - 1 failing - - 1) An uncaught error was detected outside of a test: - Uncaught CypressError: Cannot call "cy.viewport()" outside a running test. - -This usually happens when you accidentally write commands outside an it(...) test. - -If that is the case, just move these commands inside an it(...) test. - -Check your test file for errors. - -https://on.cypress.io/cannot-execute-commands-outside-test - -This error originated from your test code, not from Cypress. - -When Cypress detects uncaught errors originating from your test code it will automatically fail the current test. - -Cypress could not associate this error to any specific test. - -We dynamically generated a new test to display this failure. - at stack trace line - at stack trace line - at stack trace line - at stack trace line - at stack trace line - at stack trace line - at stack trace line - - - - - (Results) - - ┌────────────────────────────────────────────────────┐ - │ Tests: 1 │ - │ Passing: 0 │ - │ Failing: 1 │ - │ Pending: 0 │ - │ Skipped: 0 │ - │ Screenshots: 1 │ - │ Video: true │ - │ Duration: X seconds │ - │ Spec Ran: commands_outside_of_test_spec.coffee │ - └────────────────────────────────────────────────────┘ - - - (Screenshots) - - - /foo/bar/.projects/e2e/cypress/screenshots/commands_outside_of_test_spec.coffee/An uncaught error was detected outside of a test (failed).png (YYYYxZZZZ) - - - (Video) - - - Started processing: Compressing to 32 CRF - - Finished processing: /foo/bar/.projects/e2e/cypress/videos/abc123.mp4 (X seconds) - - -==================================================================================================== - - (Run Finished) - - - Spec Tests Passing Failing Pending Skipped - ┌────────────────────────────────────────────────────────────────────────────────────────────────┐ - │ ✖ commands_outside_of_test_spec.coffee XX:XX 1 - 1 - - │ - └────────────────────────────────────────────────────────────────────────────────────────────────┘ - 1 of 1 failed (100%) XX:XX 1 - 1 - - - - -` - -exports['e2e commands outside of test [chrome] fails on failing assertions 1'] = ` - -==================================================================================================== - - (Run Starting) - - ┌────────────────────────────────────────────────────────────────────────────────────────────────┐ - │ Cypress: 1.2.3 │ - │ Browser: FooBrowser 88 │ - │ Specs: 1 found (assertions_failing_outside_of_test_spec.coffee) │ - │ Searched: cypress/integration/assertions_failing_outside_of_test_spec.coffee │ - └────────────────────────────────────────────────────────────────────────────────────────────────┘ - - -──────────────────────────────────────────────────────────────────────────────────────────────────── - - Running: assertions_failing_outside_of_test_spec.coffee... (1 of 1) - - - 1) An uncaught error was detected outside of a test - - 0 passing - 1 failing - - 1) An uncaught error was detected outside of a test: - expected true to be false - -This error originated from your test code, not from Cypress. - -When Cypress detects uncaught errors originating from your test code it will automatically fail the current test. - -Cypress could not associate this error to any specific test. - -We dynamically generated a new test to display this failure. - AssertionError: expected true to be false - - - - - (Results) - - ┌──────────────────────────────────────────────────────────────┐ - │ Tests: 1 │ - │ Passing: 0 │ - │ Failing: 1 │ - │ Pending: 0 │ - │ Skipped: 0 │ - │ Screenshots: 1 │ - │ Video: true │ - │ Duration: X seconds │ - │ Spec Ran: assertions_failing_outside_of_test_spec.coffee │ - └──────────────────────────────────────────────────────────────┘ - - - (Screenshots) - - - /foo/bar/.projects/e2e/cypress/screenshots/assertions_failing_outside_of_test_spec.coffee/An uncaught error was detected outside of a test (failed).png (YYYYxZZZZ) - - - (Video) - - - Started processing: Compressing to 32 CRF - - Finished processing: /foo/bar/.projects/e2e/cypress/videos/abc123.mp4 (X seconds) - - -==================================================================================================== - - (Run Finished) - - - Spec Tests Passing Failing Pending Skipped - ┌────────────────────────────────────────────────────────────────────────────────────────────────┐ - │ ✖ assertions_failing_outside_of_test_s… XX:XX 1 - 1 - - │ - └────────────────────────────────────────────────────────────────────────────────────────────────┘ - 1 of 1 failed (100%) XX:XX 1 - 1 - - - - -` - -exports['e2e commands outside of test [electron] fails on cy commands 1'] = ` +exports['e2e commands outside of test / fails on cy commands'] = ` ==================================================================================================== @@ -320,7 +148,7 @@ We dynamically generated a new test to display this failure. ` -exports['e2e commands outside of test [electron] fails on failing assertions 1'] = ` +exports['e2e commands outside of test / fails on failing assertions'] = ` ==================================================================================================== diff --git a/packages/server/__snapshots__/2_cdp_spec.ts.js b/packages/server/__snapshots__/2_cdp_spec.ts.js index 9d4d4ccb30c1..81daa1fa80fe 100644 --- a/packages/server/__snapshots__/2_cdp_spec.ts.js +++ b/packages/server/__snapshots__/2_cdp_spec.ts.js @@ -1,4 +1,4 @@ -exports['e2e cdp fails when remote debugging port cannot be connected to 1'] = ` +exports['e2e cdp / fails when remote debugging port cannot be connected to'] = ` ==================================================================================================== diff --git a/packages/server/__snapshots__/2_cookies_spec.coffee.js b/packages/server/__snapshots__/2_cookies_spec.coffee.js index 6a4546431d17..61fbdc72ea6a 100644 --- a/packages/server/__snapshots__/2_cookies_spec.coffee.js +++ b/packages/server/__snapshots__/2_cookies_spec.coffee.js @@ -1,75 +1,4 @@ -exports['e2e cookies passes in chrome 1'] = ` - -==================================================================================================== - - (Run Starting) - - ┌────────────────────────────────────────────────────────────────────────────────────────────────┐ - │ Cypress: 1.2.3 │ - │ Browser: FooBrowser 88 │ - │ Specs: 1 found (cookies_spec.coffee) │ - │ Searched: cypress/integration/cookies_spec.coffee │ - └────────────────────────────────────────────────────────────────────────────────────────────────┘ - - -──────────────────────────────────────────────────────────────────────────────────────────────────── - - Running: cookies_spec.coffee... (1 of 1) - - - cookies - with whitelist - ✓ can get all cookies - ✓ resets cookies between tests correctly - ✓ should be only two left now - ✓ handles undefined cookies - without whitelist - ✓ sends cookies to localhost:2121 - ✓ handles expired cookies secure - ✓ issue: #224 sets expired cookies between redirects - ✓ issue: #1321 failing to set or parse cookie - ✓ issue: #2724 does not fail on invalid cookies - - - 9 passing - - - (Results) - - ┌───────────────────────────────────┐ - │ Tests: 9 │ - │ Passing: 9 │ - │ Failing: 0 │ - │ Pending: 0 │ - │ Skipped: 0 │ - │ Screenshots: 0 │ - │ Video: true │ - │ Duration: X seconds │ - │ Spec Ran: cookies_spec.coffee │ - └───────────────────────────────────┘ - - - (Video) - - - Started processing: Compressing to 32 CRF - - Finished processing: /foo/bar/.projects/e2e/cypress/videos/abc123.mp4 (X seconds) - - -==================================================================================================== - - (Run Finished) - - - Spec Tests Passing Failing Pending Skipped - ┌────────────────────────────────────────────────────────────────────────────────────────────────┐ - │ ✔ cookies_spec.coffee XX:XX 9 9 - - - │ - └────────────────────────────────────────────────────────────────────────────────────────────────┘ - All specs passed! XX:XX 9 9 - - - - - -` - -exports['e2e cookies passes in electron 1'] = ` +exports['e2e cookies / passes'] = ` ==================================================================================================== diff --git a/packages/server/__snapshots__/2_domain_spec.coffee.js b/packages/server/__snapshots__/2_domain_spec.coffee.js index 788b96e306b8..96293c3a2c75 100644 --- a/packages/server/__snapshots__/2_domain_spec.coffee.js +++ b/packages/server/__snapshots__/2_domain_spec.coffee.js @@ -1,4 +1,4 @@ -exports['e2e domain passing 1'] = ` +exports['e2e domain / passes'] = ` ==================================================================================================== diff --git a/packages/server/__snapshots__/2_form_submissions_spec.coffee.js b/packages/server/__snapshots__/2_form_submissions_spec.coffee.js index bffcf83f9916..17b61a841c90 100644 --- a/packages/server/__snapshots__/2_form_submissions_spec.coffee.js +++ b/packages/server/__snapshots__/2_form_submissions_spec.coffee.js @@ -1,4 +1,4 @@ -exports['e2e forms