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

Fix/cypress 13 validation #6

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
2258d7c
tests and test attempts data
miguelangarano Sep 5, 2023
a94d9f2
screenshots data structure and tests with attempts sent as expected w…
miguelangarano Sep 6, 2023
aeab2fb
remove yarn
miguelangarano Sep 6, 2023
5242604
chore: wip
agoldis Sep 6, 2023
0daa82c
added types and quick fix for removing not relevant attempts and scre…
miguelangarano Sep 6, 2023
0d7b2eb
fix: combine standalone with spec:after results
agoldis Sep 6, 2023
9a83d60
Merge branch 'fix/cypress-13-ml' of https://github.com/currents-dev/c…
agoldis Sep 6, 2023
640a163
chore: fixing types
agoldis Sep 6, 2023
45fd903
feat: support cypres@13+
agoldis Sep 6, 2023
22576f7
added types and quick fix for removing not relevant attempts and scre…
miguelangarano Sep 6, 2023
7d62eac
chore: fixing types
agoldis Sep 6, 2023
3e35acd
Merge branch 'fix/cypress-13-ml' of https://github.com/currents-dev/c…
agoldis Sep 6, 2023
3d19fee
chore: release v1.10.0-beta.1
agoldis Sep 6, 2023
f37312e
fix: set test id for pending tests
agoldis Sep 6, 2023
a3d70da
chore: release v1.10.0-beta.2
agoldis Sep 6, 2023
bfd11fe
validation tests for cypress 12 and 13 with the latest modification b…
miguelangarano Sep 7, 2023
675f830
added viewer for results comparison
miguelangarano Sep 7, 2023
cf8ca5d
fix: issue 179 fixes
agoldis Sep 8, 2023
11268e2
chore: release v1.10.0-beta.3
agoldis Sep 8, 2023
2c08548
automated test validation
miguelangarano Sep 8, 2023
bda5ae1
fix for cypress 13 ccy 1.10
miguelangarano Sep 9, 2023
9369b8e
added test full pipeline
miguelangarano Sep 11, 2023
cd64d3a
log fixes
miguelangarano Sep 11, 2023
6a26e40
fix: coverage uploads
agoldis Sep 11, 2023
ed8a777
fix: backfill config
agoldis Sep 11, 2023
d39a81d
chore: release v1.10.0-beta.4
agoldis Sep 11, 2023
917ab2c
added avoided properties to make the tests pass
miguelangarano Sep 12, 2023
be0620c
fixing .env variables
miguelangarano Sep 12, 2023
a45f17c
ci files implementation
miguelangarano Sep 12, 2023
6773bab
chore: remove debug [skip ci]
agoldis Sep 12, 2023
e6de37c
Merge branch 'fix/cypress-13-ml' into fix/cypress-13-validation
agoldis Sep 12, 2023
949701d
functions refactor
miguelangarano Sep 13, 2023
47940f2
fixes to cypress cloud and tests
miguelangarano Sep 14, 2023
25ed7c8
added throw error test
miguelangarano Sep 14, 2023
cfe03d0
fix spec properties
miguelangarano Sep 14, 2023
8025626
removed avoidable properties
miguelangarano Sep 14, 2023
8abf23e
fix ci files
miguelangarano Sep 14, 2023
505bc2c
added properties to comply with ci runner
miguelangarano Sep 14, 2023
61dabab
fix for comply with ci runner properties avoid
miguelangarano Sep 14, 2023
d8aa446
fix last avoidable properties for cypress 13
miguelangarano Sep 14, 2023
01c7371
cypress 12 ccy 1.9.4 fixes
miguelangarano Sep 15, 2023
e024cbf
fix ci cypress version installation
miguelangarano Sep 15, 2023
5317b24
fix cypress config to support e2e_smoke spec patttern
miguelangarano Sep 15, 2023
4ba5173
attempt to fix e2e-exports ci
miguelangarano Sep 15, 2023
c91d5f4
attempt 2 to fix e2e-exports ci
miguelangarano Sep 15, 2023
bb25f14
attempt 1 fix e2e-smoke-windows ci
miguelangarano Sep 15, 2023
c6f903a
roolback attempt 1 fix e2e-smoke-windows ci
miguelangarano Sep 15, 2023
6912895
fix ts errors and added api test property avoided
miguelangarano Sep 15, 2023
dc1792b
fix unit tests
miguelangarano Sep 15, 2023
7e228fe
make cy 12 test work
miguelangarano Sep 15, 2023
f6812d2
chore: ..
miguelangarano Sep 15, 2023
77c01fc
fix
miguelangarano Sep 15, 2023
67155b2
fix remove require cypress
miguelangarano Sep 15, 2023
13ba59a
chore: change script name
miguelangarano Sep 15, 2023
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
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
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.1.0
run: npm install [email protected]

- 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: >
npm run runtest
2 changes: 1 addition & 1 deletion .github/workflows/e2e-exports.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
40 changes: 40 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,45 @@


# [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

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

# [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)


Expand Down
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")
});
});
119 changes: 119 additions & 0 deletions e2e/cypress-12-demo/cypress/support/commands.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
/// <reference types="cypress" />
// ***********************************************
// This example commands.ts shows you how to
// create various custom commands and overwrite
// existing commands.
//
// For more comprehensive examples of custom
// commands please read more here:
// https://on.cypress.io/custom-commands
// ***********************************************
//
//
// -- This is a parent command --
// Cypress.Commands.add('login', (email, password) => { ... })
//
//
// -- This is a child command --
// Cypress.Commands.add('drag', { prevSubject: 'element'}, (subject, options) => { ... })
//
//
// -- This is a dual command --
// Cypress.Commands.add('dismiss', { prevSubject: 'optional'}, (subject, options) => { ... })
//
//
// -- This will overwrite an existing command --
// Cypress.Commands.overwrite('visit', (originalFn, url, options) => { ... })
//
// declare global {
// namespace Cypress {
// interface Chainable {
// login(email: string, password: string): Chainable<void>
// drag(subject: string, options?: Partial<TypeOptions>): Chainable<Element>
// dismiss(subject: string, options?: Partial<TypeOptions>): Chainable<Element>
// visit(originalFn: CommandOriginalFn, url: string, options: Partial<VisitOptions>): Chainable<Element>
// }
// }
// }

// ***********************************************
// This example commands.js shows you how to
// create the custom commands: 'createDefaultTodos'
// and 'createTodo'.
//
// The commands.js file is a great place to
// modify existing commands and create custom
// commands for use throughout your tests.
//
// You can read more about custom commands here:
// https://on.cypress.io/commands
// ***********************************************

Cypress.Commands.add("createDefaultTodos", function () {
let TODO_ITEM_ONE = "buy some cheese";
let TODO_ITEM_TWO = "feed the cat";
let TODO_ITEM_THREE = "book a doctors appointment";

// begin the command here, which by will display
// as a 'spinning blue state' in the UI to indicate
// the command is running
let cmd = Cypress.log({
name: "create default todos",
message: [],
consoleProps() {
// we're creating our own custom message here
// which will print out to our browsers console
// whenever we click on this command
return {
"Inserted Todos": [TODO_ITEM_ONE, TODO_ITEM_TWO, TODO_ITEM_THREE],
};
},
});

// additionally we pass {log: false} to all of our
// sub-commands so none of them will output to
// our command log

cy.get(".new-todo", { log: false })
.type(`${TODO_ITEM_ONE}{enter}`, { log: false })
.type(`${TODO_ITEM_TWO}{enter}`, { log: false })
.type(`${TODO_ITEM_THREE}{enter}`, { log: false });

cy.get(".todo-list li", { log: false }).then(function ($listItems) {
// once we're done inserting each of the todos
// above we want to return the .todo-list li's
// to allow for further chaining and then
// we want to snapshot the state of the DOM
// and end the command so it goes from that
// 'spinning blue state' to the 'finished state'
cmd.set({ $el: $listItems }).snapshot().end();
});
});

Cypress.Commands.add("createTodo", function (todo) {
let cmd = Cypress.log({
name: "create todo",
message: todo,
consoleProps() {
return {
"Inserted Todo": todo,
};
},
});

// create the todo
cy.get(".new-todo", { log: false }).type(`${todo}{enter}`, { log: false });

// now go find the actual todo
// in the todo list so we can
// easily alias this in our tests
// and set the $el so its highlighted
cy.get(".todo-list", { log: false })
.contains("li", todo.trim(), { log: false })
.then(function ($li) {
// set the $el for the command so
// it highlights when we hover over
// our command
cmd.set({ $el: $li }).snapshot().end();
});
});
14 changes: 14 additions & 0 deletions e2e/cypress-12-demo/cypress/support/component-index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<title>Components App</title>
<!-- Used by Next.js to inject CSS. -->
<div id="__next_css__DO_NOT_USE__"></div>
</head>
<body>
<div data-cy-root></div>
</body>
</html>
Loading
Loading