Skip to content

Commit

Permalink
ci(UMDExample): update for Cypress 10
Browse files Browse the repository at this point in the history
  • Loading branch information
thewtex committed Jul 2, 2022
1 parent 313566a commit 12928f9
Show file tree
Hide file tree
Showing 6 changed files with 322 additions and 246 deletions.
6 changes: 2 additions & 4 deletions .github/workflows/examples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,18 +87,16 @@ jobs:
test-umd-example:
name: UMD
runs-on: ubuntu-20.04
container: cypress/browsers:node16.13.2-chrome97-ff96

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: Test
uses: cypress-io/github-action@v2
uses: cypress-io/github-action@v4
with:
working-directory: ./examples/UMD
browser: chrome
start: npm start
config: defaultCommandTimeout=8000

test-webpack-example-chrome-electron:
name: Webpack, Chrome, Electron
Expand Down
2 changes: 1 addition & 1 deletion examples/UMD/cypress.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ module.exports = defineConfig({
// We've imported your old cypress plugins here.
// You may want to clean this up later by importing these.
setupNodeEvents(on, config) {
return require('./cypress/plugins/index.js')(on, config)
// implement node event listeners here
},
},
})
37 changes: 37 additions & 0 deletions examples/UMD/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>
// }
// }
// }
20 changes: 20 additions & 0 deletions examples/UMD/cypress/support/e2e.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
// ***********************************************************
// This example support/e2e.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')
Loading

0 comments on commit 12928f9

Please sign in to comment.