Updates cypress

This commit is contained in:
Amir Raminfar
2022-06-29 13:30:40 -07:00
parent 6be73692ba
commit 965d1a52b1
9 changed files with 60 additions and 19 deletions

View File

@@ -1,4 +1,4 @@
FROM cypress/included:10.0.3
FROM cypress/included:10.3.0
RUN apt install curl && curl -f https://get.pnpm.io/v6.16.js | node - add --global pnpm
@@ -7,5 +7,5 @@ WORKDIR /e2e
COPY pnpm-lock.yaml ./
RUN pnpm fetch
COPY package.json ./
COPY package.json tsconfig.json ./
RUN pnpm install -r --offline

View File

@@ -3,4 +3,10 @@ import { defineConfig } from "cypress";
export default defineConfig({
fixturesFolder: false,
projectId: "8cua4m",
e2e: {
setupNodeEvents(on, config) {
// implement node event listeners here
},
},
});

View File

@@ -0,0 +1,5 @@
{
"name": "Using fixtures to represent data",
"email": "hello@cypress.io",
"body": "Fixtures are a great way to mock data for responses to routes"
}

View File

@@ -1,5 +1,6 @@
/// <reference types="cypress" />
// ***********************************************
// This example commands.js shows you how to
// This example commands.ts shows you how to
// create various custom commands and overwrite
// existing commands.
//
@@ -23,10 +24,17 @@
//
// -- This will overwrite an existing command --
// Cypress.Commands.overwrite('visit', (originalFn, url, options) => { ... })
// import { addMatchImageSnapshotCommand } from "cypress-image-snapshot/command";
// addMatchImageSnapshotCommand();
//
// 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>
// }
// }
// }
Cypress.Commands.add("removeDates", () => {
cy.window().then((win) => win.document.querySelectorAll("time").forEach((el) => el.remove()));

View File

@@ -1,5 +1,5 @@
// ***********************************************************
// This example support/index.js is processed and
// This example support/e2e.ts is processed and
// loaded automatically before your test files.
//
// This is a great place to put global configuration and
@@ -14,7 +14,7 @@
// ***********************************************************
// Import commands.js using ES2015 syntax:
import "./commands";
import './commands'
// Alternatively you can use CommonJS syntax:
// require('./commands')
// require('./commands')

14
e2e/cypress/tsconfig.json Normal file
View File

@@ -0,0 +1,14 @@
{
"extends": "../tsconfig.json",
"compilerOptions": {
"noEmit": true,
// be explicit about types included
// to avoid clashing with Jest types
"types": ["cypress"]
},
"include": [
"../node_modules/cypress",
"./**/*.ts",
"./**/*.js"
]
}

View File

@@ -4,7 +4,7 @@
"scripts": {},
"license": "ISC",
"dependencies": {
"cypress": "^10.2.0",
"cypress": "^10.3.0",
"cypress-image-snapshot": "^4.0.1",
"typescript": "^4.7.4"
}

16
e2e/pnpm-lock.yaml generated
View File

@@ -1,13 +1,13 @@
lockfileVersion: 5.4
specifiers:
cypress: ^10.2.0
cypress: ^10.3.0
cypress-image-snapshot: ^4.0.1
typescript: ^4.7.4
dependencies:
cypress: 10.2.0
cypress-image-snapshot: 4.0.1_cypress@10.2.0
cypress: 10.3.0
cypress-image-snapshot: 4.0.1_cypress@10.3.0
typescript: 4.7.4
packages:
@@ -354,14 +354,14 @@ packages:
which: 2.0.2
dev: false
/cypress-image-snapshot/4.0.1_cypress@10.2.0:
/cypress-image-snapshot/4.0.1_cypress@10.3.0:
resolution: {integrity: sha512-PBpnhX/XItlx3/DAk5ozsXQHUi72exybBNH5Mpqj1DVmjq+S5Jd9WE5CRa4q5q0zuMZb2V2VpXHth6MjFpgj9Q==}
engines: {node: '>=8'}
peerDependencies:
cypress: ^4.5.0
dependencies:
chalk: 2.4.2
cypress: 10.2.0
cypress: 10.3.0
fs-extra: 7.0.1
glob: 7.2.0
jest-image-snapshot: 4.2.0
@@ -371,8 +371,8 @@ packages:
- jest
dev: false
/cypress/10.2.0:
resolution: {integrity: sha512-+i9lY5ENlfi2mJwsggzR+XASOIgMd7S/Gd3/13NCpv596n3YSplMAueBTIxNLcxDpTcIksp+9pM3UaDrJDpFqA==}
/cypress/10.3.0:
resolution: {integrity: sha512-txkQWKzvBVnWdCuKs5Xc08gjpO89W2Dom2wpZgT9zWZT5jXxqPIxqP/NC1YArtkpmp3fN5HW8aDjYBizHLUFvg==}
engines: {node: '>=12.0.0'}
hasBin: true
requiresBuild: true
@@ -1288,7 +1288,7 @@ packages:
dev: false
/supports-color/2.0.0:
resolution: {integrity: sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=}
resolution: {integrity: sha512-KKNVtd6pCYgPIKU4cp2733HWYCpplQhddZLBUryaAHou723x+FRzQ5Df824Fj+IyyuiQTRoub4SnIFfIcrp70g==}
engines: {node: '>=0.8.0'}
dev: false

8
e2e/tsconfig.json Normal file
View File

@@ -0,0 +1,8 @@
{
"compilerOptions": {
"target": "es5",
"lib": ["es5", "dom"],
"types": ["cypress", "node"]
},
"include": ["**/*.ts"]
}