Skip to content

Commit

Permalink
Cypress 13 (#7)
Browse files Browse the repository at this point in the history
* tests and test attempts data

* screenshots data structure and tests with attempts sent as expected with cypress 13

* remove yarn

* chore: wip

* added types and quick fix for removing not relevant attempts and screenshots to spec file

* fix: combine standalone with spec:after results

* chore: fixing types

* feat: support cypres@13+

* added types and quick fix for removing not relevant attempts and screenshots to spec file

* chore: fixing types

* chore: release v1.10.0-beta.1

* fix: set test id for pending tests

* chore: release v1.10.0-beta.2

* validation tests for cypress 12 and 13 with the latest modification based on the results from cypress 12 without modification

* added viewer for results comparison

* fix: issue 179 fixes

* chore: release v1.10.0-beta.3

* automated test validation

* fix for cypress 13 ccy 1.10

* added test full pipeline

* log fixes

* fix: coverage uploads

* fix: backfill config

* chore: release v1.10.0-beta.4

* added avoided properties to make the tests pass

* fixing .env variables

* ci files implementation

* chore: remove debug [skip ci]

* functions refactor

* fixes to cypress cloud and tests

* added throw error test

* fix spec properties

* fix: pick test:after results explicitly

* chore: release v1.10.0-beta.5

* removed avoidable properties

* fix ci files

* added properties to comply with ci runner

* fix for comply with ci runner properties avoid

* fix last avoidable properties for cypress 13

* cypress 12 ccy 1.9.4 fixes

* fix ci cypress version installation

* fix cypress config to support e2e_smoke spec patttern

* attempt to fix e2e-exports ci

* attempt 2 to fix e2e-exports ci

* attempt 1 fix e2e-smoke-windows ci

* roolback attempt 1 fix e2e-smoke-windows ci

* fix ts errors and added api test property avoided

* fix unit tests

* make cy 12 test work

* chore: ..

* fix

* fix remove require cypress

* chore: change script name

* chore: wip [skip ci]

* chore: .. [skip ci]

* chore: add warnings

* chore: fix tests

* chore: ..

* chore: add dataFlow tests

* fix: videoUploadOnPasses [skip ci]

* fix: update snapshots

* chore: fix warnings

* chore: testing CI

* fix: spec.name

* chore: ..

* chore: ..

* chore: ..

* chore: ..

* fix: custom screenshot name

* chore: e2e cy 13

* chore: ..

* chore: ..

* fix: reimplement cy13 comatibility tests

* chore: readd e2e tests

* chore: remove node 14

---------

Co-authored-by: Miguel Langarano <[email protected]>
  • Loading branch information
agoldis and miguelangarano authored Sep 19, 2023
1 parent 209b64f commit c2ddfb3
Show file tree
Hide file tree
Showing 249 changed files with 15,516 additions and 5,744 deletions.
2 changes: 1 addition & 1 deletion .github/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Integrate Cypress with alternative cloud services like Currents or Sorry Cypress
## Requirements

- Cypress version 10+
- NodeJS 14.7.0+
- NodeJS 16+

## Setup

Expand Down
41 changes: 41 additions & 0 deletions .github/_workflows/e2e-cypress-12-ccy-1.10.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: e2e-cypress-12-ccy-1_10

on:
push:

jobs:
e2e-cypress-12-ccy-1_10:
if: "!contains(toJSON(github.event.commits.*.message), '[skip ci]')"
runs-on: ubuntu-latest
env:
DEBUG: currents:*

strategy:
matrix:
node-version: ["18"]

steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}

- name: Install dependencies
run: npm ci

- name: Install Cypress 12.17.4
run: npm install [email protected]

- name: Build
run: npm run build

- name: Run compatibility tests
working-directory: ./e2e/cypress-12-demo
env:
CURRENTS_API_KEY: ${{ secrets.CURRENTS_API_KEY }}
CURRENTS_RUN_BASE_URL: ${{ secrets.CURRENTS_RUN_BASE_URL }}
CURRENTS_PROJECT_ID: ${{ secrets.CURRENTS_PROJECT_ID }}
CURRENTS_RECORD_KEY: ${{ secrets.CURRENTS_RECORD_KEY }}

run: >
npm run runtest
File renamed without changes.
41 changes: 41 additions & 0 deletions .github/workflows/e2e-cypress-13-ccy-1.10.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: e2e-cypress-13-ccy-1_10

on:
push:

jobs:
e2e-cypress-13-ccy-1_10:
if: "!contains(toJSON(github.event.commits.*.message), '[skip ci]')"
runs-on: ubuntu-latest
env:
DEBUG: currents:*

strategy:
matrix:
node-version: ["18"]

steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}

- name: Install dependencies
run: npm ci

- name: Install Cypress 13
run: npm install cypress@13

- name: Build
run: npm run build

- name: Run compatibility tests
working-directory: ./e2e/cypress-13-demo
env:
CURRENTS_API_KEY: ${{ secrets.CURRENTS_API_KEY }}
CURRENTS_RUN_BASE_URL: ${{ secrets.CURRENTS_RUN_BASE_URL }}
CURRENTS_PROJECT_ID: ${{ secrets.CURRENTS_PROJECT_ID }}
CURRENTS_RECORD_KEY: ${{ secrets.CURRENTS_RECORD_KEY }}

run: >
npx jest
4 changes: 2 additions & 2 deletions .github/workflows/e2e-exports.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:

strategy:
matrix:
node-version: ["18", "16", "14"]
node-version: ["20", "18", "16"]

steps:
- uses: actions/checkout@v3
Expand All @@ -21,7 +21,7 @@ jobs:
node-version: ${{ matrix.node-version }}

- name: Install npm (node14)
run: npm install -g npm@latest
run: npm install -g npm@8.19.4

- name: Install dependencies
run: npm ci
Expand Down
4 changes: 4 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

npm run format
27 changes: 27 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,39 @@
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Launch ",

"program": "${workspaceFolder}/packages/cypress-cloud/dist/bin/cli.js",
"args": ["--parallel", "--record", "--ci-build-id", "${input:ciBuildId}"],
"request": "launch",
"skipFiles": ["<node_internals>/**"],
"cwd": "${workspaceFolder}/examples/webapp",
"env": {
"NODE_OPTIONS": "--inspect=9229",
"CURRENTS_PROJECT_ID": "mMsaes",
"CURRENTS_RECORD_KEY": "Fgt2j7QCjNedC2zG",
"CURRENTS_API_URL": "http://localhost:1234/"
},
"type": "node"
},
{
"name": "Attach",
"port": 9229,
"request": "attach",
"skipFiles": ["<node_internals>/**"],
"type": "node"
}
],
"inputs": [
{
"id": "ciBuildId",
"type": "command",
"command": "shellCommand.execute",
"args": {
"command": "date +%s",
"cwd": "${workspaceFolder}"
}
}
]
}
55 changes: 44 additions & 11 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,39 +1,72 @@
# [1.10.0-beta.5](https://github.com/currents-dev/cypress-cloud/compare/v1.10.0-beta.4...v1.10.0-beta.5) (2023-09-14)

### Bug Fixes

# [1.10.0-beta.0](https://github.com/currents-dev/cypress-cloud/compare/v1.9.3...v1.10.0-beta.0) (2023-08-25)
- pick test:after results explicitly ([67e6a0d](https://github.com/currents-dev/cypress-cloud/commit/67e6a0df78d3cff32d101d1bbe3f119c0766a9af))

# [1.10.0-beta.4](https://github.com/currents-dev/cypress-cloud/compare/v1.10.0-beta.3...v1.10.0-beta.4) (2023-09-11)

### Bug Fixes

- backfill config ([ed8a777](https://github.com/currents-dev/cypress-cloud/commit/ed8a777f6299f0778eeabe96534b52bcd3472d0f))
- coverage uploads ([6a26e40](https://github.com/currents-dev/cypress-cloud/commit/6a26e4077cab73f75c64235472e8695ebcf14087))

# [1.10.0-beta.3](https://github.com/currents-dev/cypress-cloud/compare/v1.10.0-beta.2...v1.10.0-beta.3) (2023-09-08)

### Bug Fixes

- issue 179 fixes ([cf8ca5d](https://github.com/currents-dev/cypress-cloud/commit/cf8ca5d5f71b69a6fc7d1098b1bb0b42d27427d2))

# [1.10.0-beta.2](https://github.com/currents-dev/cypress-cloud/compare/v1.10.0-beta.1...v1.10.0-beta.2) (2023-09-06)

### Bug Fixes

- combine standalone with spec:after results ([0d7b2eb](https://github.com/currents-dev/cypress-cloud/commit/0d7b2eb02ee8aeb0e6ff0627f3afbf0d641bd581))
- set test id for pending tests ([f37312e](https://github.com/currents-dev/cypress-cloud/commit/f37312e0651954481b1e3fb89552606bea3dde38))

### Features

* [CSR-213] Support Code Coverage ([#174](https://github.com/currents-dev/cypress-cloud/issues/174)) ([b29d738](https://github.com/currents-dev/cypress-cloud/commit/b29d738f9a5d54e3214dfd05b66fc053aa3194a8))
- support cypres@13+ ([45fd903](https://github.com/currents-dev/cypress-cloud/commit/45fd9036ad686f7edfcb7859db64ce79692dd429))

## [1.9.3](https://github.com/currents-dev/cypress-cloud/compare/v1.9.2...v1.9.3) (2023-07-27)
# [1.10.0-beta.1](https://github.com/currents-dev/cypress-cloud/compare/v1.10.0-beta.0...v1.10.0-beta.1) (2023-09-06)

### Bug Fixes

- combine standalone with spec:after results ([0d7b2eb](https://github.com/currents-dev/cypress-cloud/commit/0d7b2eb02ee8aeb0e6ff0627f3afbf0d641bd581))

### Features

- support cypres@13+ ([45fd903](https://github.com/currents-dev/cypress-cloud/commit/45fd9036ad686f7edfcb7859db64ce79692dd429))

# [1.10.0-beta.0](https://github.com/currents-dev/cypress-cloud/compare/v1.9.3...v1.10.0-beta.0) (2023-08-25)

### Features

- [CSR-213] Support Code Coverage ([#174](https://github.com/currents-dev/cypress-cloud/issues/174)) ([b29d738](https://github.com/currents-dev/cypress-cloud/commit/b29d738f9a5d54e3214dfd05b66fc053aa3194a8))

## [1.9.3](https://github.com/currents-dev/cypress-cloud/compare/v1.9.2...v1.9.3) (2023-07-27)

### Bug Fixes

* retry on ETIMEDOUT, add network req timeout ([#172](https://github.com/currents-dev/cypress-cloud/issues/172)) ([030ae70](https://github.com/currents-dev/cypress-cloud/commit/030ae7086eeb75397c729a79c8eefb9aa2e61d7a))
- retry on ETIMEDOUT, add network req timeout ([#172](https://github.com/currents-dev/cypress-cloud/issues/172)) ([030ae70](https://github.com/currents-dev/cypress-cloud/commit/030ae7086eeb75397c729a79c8eefb9aa2e61d7a))

## [1.9.2](https://github.com/currents-dev/cypress-cloud/compare/v1.9.1...v1.9.2) (2023-07-21)


### Bug Fixes

* exit with status 1 when no spec files found ([#169](https://github.com/currents-dev/cypress-cloud/issues/169)) ([9c7bfd2](https://github.com/currents-dev/cypress-cloud/commit/9c7bfd2a9bc7201af5ee9178c5b7c92cf224955e)), closes [#165](https://github.com/currents-dev/cypress-cloud/issues/165)
- exit with status 1 when no spec files found ([#169](https://github.com/currents-dev/cypress-cloud/issues/169)) ([9c7bfd2](https://github.com/currents-dev/cypress-cloud/commit/9c7bfd2a9bc7201af5ee9178c5b7c92cf224955e)), closes [#165](https://github.com/currents-dev/cypress-cloud/issues/165)

## [1.9.1](https://github.com/currents-dev/cypress-cloud/compare/v1.9.0...v1.9.1) (2023-07-06)


### Bug Fixes

* prevent shared execution state ([#157](https://github.com/currents-dev/cypress-cloud/issues/157)) ([48cf247](https://github.com/currents-dev/cypress-cloud/commit/48cf24712a5362f5557d3a689e891d25e1491638))
- prevent shared execution state ([#157](https://github.com/currents-dev/cypress-cloud/issues/157)) ([48cf247](https://github.com/currents-dev/cypress-cloud/commit/48cf24712a5362f5557d3a689e891d25e1491638))

## [1.9.1-beta.0](https://github.com/currents-dev/cypress-cloud/compare/v1.9.0...v1.9.1-beta.0) (2023-07-06)


### Bug Fixes

* prevent shared execution state ([f71ad89](https://github.com/currents-dev/cypress-cloud/commit/f71ad89b02df80d9bf5e9c0da7e4a2c0ad8212dc))
- prevent shared execution state ([f71ad89](https://github.com/currents-dev/cypress-cloud/commit/f71ad89b02df80d9bf5e9c0da7e4a2c0ad8212dc))

# [1.9.0](https://github.com/currents-dev/cypress-cloud/compare/v1.9.0-beta.0...v1.9.0) (2023-07-04)

Expand Down Expand Up @@ -330,4 +363,4 @@
- implement generic http client with retries ([a9711bd](https://github.com/currents-dev/cypress-cloud/commit/a9711bde1fbb2cd37dbc8979593159d183bfa866))
- improve setup steps ([9bf16fe](https://github.com/currents-dev/cypress-cloud/commit/9bf16fe5f3773db4aa2f169515303ea6d0973da6))
- separate stdout per spec file ([a9d01c3](https://github.com/currents-dev/cypress-cloud/commit/a9d01c349cbfe140a568a452b0e7163e6d27f2db))
- setup github actions ([d439f56](https://github.com/currents-dev/cypress-cloud/commit/d439f5660698177087fcc2e7a61c64ea263816f6))
- setup github actions ([d439f56](https://github.com/currents-dev/cypress-cloud/commit/d439f5660698177087fcc2e7a61c64ea263816f6))
13 changes: 13 additions & 0 deletions e2e/cypress-12-demo/currents.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
module.exports = {
e2e: {
batchSize: 4, // how many specs to send in one batch
},
component: {
batchSize: 5, // how many specs to send in one batch
},
// eslint-disable-next-line turbo/no-undeclared-env-vars
projectId: !!(process.env.GITHUB_ACTION || process.env.CIRCLE_BRANCH)
? "Ij0RfK"
: "l4zuz8",
// cloudServiceUrl: "http://localhost:1234",
};
26 changes: 26 additions & 0 deletions e2e/cypress-12-demo/cypress.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import { defineConfig } from "cypress";
import currents from "cypress-cloud/plugin";

module.exports = defineConfig({
e2e: {
baseUrl: "https://todomvc.com/examples/vanillajs",
supportFile: "cypress/support/e2e.ts",
specPattern: "cypress/*/**/*.spec.js",
setupNodeEvents(on, config) {
require("@cypress/grep/src/plugin")(config);
// require("cypress-terminal-report/src/installLogsPrinter")(on);
return currents(on, config);
},
},

component: {
specPattern: ["pages/__tests__/*.spec.tsx"],
setupNodeEvents(on, config) {
return currents(on, config);
},
devServer: {
framework: "next",
bundler: "webpack",
},
},
});
7 changes: 7 additions & 0 deletions e2e/cypress-12-demo/cypress/e2e/a.spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
describe('Failing test with 2 attempts', () => {
it('should try 2 times', {
retries: 2,
}, () => {
cy.wrap(false).should('be.true');
});
});
21 changes: 21 additions & 0 deletions e2e/cypress-12-demo/cypress/e2e/b.spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
let attempt = 0;
describe('Failing test with 2 attempts, passed test and flaky test with 2 attempts', () => {
it('should try 2 times', {
retries: 2,
}, () => {
cy.wrap(false).should('be.true');
});

it('should assert that true is true', () => {
cy.wrap(true).should('be.true');
});

it('should fail on the first attempt and pass on the second', { retries: 2 }, () => {
if (attempt === 0) {
attempt++;
cy.wrap(false).should('be.true'); // This will fail on the first attempt
} else {
cy.wrap(true).should('be.true'); // This will pass on the second attempt
}
});
});
5 changes: 5 additions & 0 deletions e2e/cypress-12-demo/cypress/e2e/c.spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
describe('Ignored test', () => {
it.skip('should be a skipped test', () => {
cy.wrap(false).should('be.true');
});
});
13 changes: 13 additions & 0 deletions e2e/cypress-12-demo/cypress/e2e/d.spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
describe('Passed test with screenshot, passed test with no screenshots', () => {
it('should assert and take a screenshot', () => {
// Assert that true is true
cy.wrap(true).should('be.true');

// Take a screenshot
cy.screenshot('internal-assert-screenshot');
});

it('should assert that true is true', () => {
cy.wrap(true).should('be.true');
});
});
5 changes: 5 additions & 0 deletions e2e/cypress-12-demo/cypress/e2e/e.spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
describe('Should throw an error', () => {
it('Should throw an error', () => {
throw new Error("test error")
});
});
Loading

0 comments on commit c2ddfb3

Please sign in to comment.