Skip to content

Commit

Permalink
update cypress to v13
Browse files Browse the repository at this point in the history
  • Loading branch information
gsambrotta committed Oct 30, 2023
1 parent fb7d93c commit c9103dd
Show file tree
Hide file tree
Showing 6 changed files with 179 additions and 41 deletions.
25 changes: 15 additions & 10 deletions cypress.config.ts
Original file line number Diff line number Diff line change
@@ -1,30 +1,35 @@
import { defineConfig } from 'cypress'
import { defineConfig } from "cypress";

export default defineConfig({
videosFolder: 'cypress/videos',
videosFolder: "cypress/videos",
video: false,
screenshotsFolder: 'cypress/screenshots',
fixturesFolder: 'cypress/fixtures',
reporter: 'mochawesome',
screenshotsFolder: "cypress/screenshots",
fixturesFolder: "cypress/fixtures",
reporter: "mochawesome",

reporterOptions: {
reportDir: 'cypress/results',
reportDir: "cypress/results",
overwrite: false,
html: true,
json: true,
},

watchForFileChanges: false,
projectId: 'ebzwp1',
projectId: "ebzwp1",
pageLoadTimeout: 100000,
defaultCommandTimeout: 30000,

retries: {
runMode: 2,
openMode: 2,
},

experimentalStudio: true,

e2e: {
setupNodeEvents(on, config) {},
supportFile: false,
baseUrl: 'http://localhost:4200',
specPattern: 'cypress/e2e/**/*.{js,jsx,ts,tsx}',
baseUrl: "http://localhost:4200",
specPattern: "cypress/e2e/**/*.{js,jsx,ts,tsx}",
},
})
});
37 changes: 37 additions & 0 deletions cypress/support/commands.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
/// <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>
// }
// }
// }
12 changes: 12 additions & 0 deletions cypress/support/component-index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<!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>
</head>
<body>
<div data-cy-root></div>
</body>
</html>
39 changes: 39 additions & 0 deletions cypress/support/component.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
// ***********************************************************
// This example support/component.ts is processed and
// loaded automatically before your test files.
//
// This is a great place to put global configuration and
// behavior that modifies Cypress.
//
// You can change the location of this file or turn off
// automatically serving support files with the
// 'supportFile' configuration option.
//
// You can read more here:
// https://on.cypress.io/configuration
// ***********************************************************

// Import commands.js using ES2015 syntax:
import './commands'

// Alternatively you can use CommonJS syntax:
// require('./commands')

import { mount } from 'cypress/angular'

// Augment the Cypress namespace to include type definitions for
// your custom command.
// Alternatively, can be defined in cypress/support/component.d.ts
// with a <reference path="./component" /> at the top of your spec.
declare global {
namespace Cypress {
interface Chainable {
mount: typeof mount
}
}
}

Cypress.Commands.add('mount', mount)

// Example use:
// cy.mount(MyComponent)
105 changes: 75 additions & 30 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@
"@types/wavesurfer.js": "^2.0.2",
"@typescript-eslint/eslint-plugin": "5.48.2",
"@typescript-eslint/parser": "5.48.2",
"cypress": "^10.10.0",
"cypress": "^13.3.3",
"cypress-localstorage-commands": "^2.2.1",
"electron": "^23.1.3",
"eslint": "^8.33.0",
Expand Down

0 comments on commit c9103dd

Please sign in to comment.