Skip to content

Commit

Permalink
Add working examples for support and plugins.
Browse files Browse the repository at this point in the history
  • Loading branch information
sainthkh committed Apr 13, 2020
1 parent 079e94e commit 04d0ef9
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 26 deletions.
Original file line number Diff line number Diff line change
@@ -1 +1,17 @@
export default () => {}
// Copied an example from https://docs.cypress.io/api/plugins/browser-launch-api.html#Use-fake-video-for-webcam-testing

/// <reference types="cypress" />

export default (on: Cypress.PluginEvents, config: Cypress.PluginConfigOptions) => {
on('before:browser:launch', (browser, launchOptions) => {
if (browser.family === 'chromium' && browser.name !== 'electron') {
// Mac/Linux
//launchOptions.args.push('--use-file-for-fake-video-capture=cypress/fixtures/my-video.y4m')

// Windows
// launchOptions.args.push('--use-file-for-fake-video-capture=c:\\path\\to\\video\\my-video.y4m')
}

return launchOptions
})
}
Original file line number Diff line number Diff line change
@@ -1,25 +1,6 @@
// ***********************************************
// This example commands.js 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) => { ... })
/// <reference types="cypress" />

// Copied an example command from https://on.cypress.io/custom-commands
Cypress.Commands.add('clickLink', (label: string | number | RegExp) => {
cy.get('a').contains(label).click()
})

0 comments on commit 04d0ef9

Please sign in to comment.