Skip to content

Commit

Permalink
test: migrate plugins to config (#926)
Browse files Browse the repository at this point in the history
  • Loading branch information
MikeMcC399 committed Jun 1, 2023
1 parent 7eeddc2 commit db16930
Show file tree
Hide file tree
Showing 8 changed files with 39 additions and 51 deletions.
22 changes: 21 additions & 1 deletion examples/browser/cypress.config.js
@@ -1,10 +1,30 @@
const { defineConfig } = require('cypress')
const os = require('os')

module.exports = defineConfig({
fixturesFolder: false,
e2e: {
setupNodeEvents(on, config) {
return require('./cypress/plugins/index.js')(on, config)
on('before:browser:launch', (browser, launchOptions) => {
console.log('before launching browser')
console.log(browser)

if (browser.name === 'chrome') {
// https://www.ghacks.net/2013/10/06/list-useful-google-chrome-command-line-switches/
launchOptions.args.push('--window-size=1920,1080')

console.log('chrome launch args:')
console.log(launchOptions.args.join(os.EOL))
return launchOptions
}
})

on('task', {
log(message) {
console.log(message)
return null
}
})
},
supportFile: false,
},
Expand Down
23 changes: 0 additions & 23 deletions examples/browser/cypress/plugins/index.js

This file was deleted.

7 changes: 6 additions & 1 deletion examples/env/cypress.config.js
Expand Up @@ -4,7 +4,12 @@ module.exports = defineConfig({
fixturesFolder: false,
e2e: {
setupNodeEvents(on, config) {
return require('./cypress/plugins/index.js')(on, config)
console.log('logging from cypress.config.js')
console.log(
'process.env.CYPRESS_environmentName',
process.env.CYPRESS_environmentName
)
console.log('entire config.env', config.env)
},
supportFile: false,
},
Expand Down
8 changes: 0 additions & 8 deletions examples/env/cypress/plugins/index.js

This file was deleted.

7 changes: 6 additions & 1 deletion examples/firefox/cypress.config.js
Expand Up @@ -4,7 +4,12 @@ module.exports = defineConfig({
fixturesFolder: false,
e2e: {
setupNodeEvents(on, config) {
return require('./cypress/plugins/index.js')(on, config)
on('task', {
log(message) {
console.log(message)
return null
}
})
},
supportFile: false,
video: false
Expand Down
8 changes: 0 additions & 8 deletions examples/firefox/cypress/plugins/index.js

This file was deleted.

7 changes: 6 additions & 1 deletion examples/quiet/cypress.config.js
Expand Up @@ -4,7 +4,12 @@ module.exports = defineConfig({
fixturesFolder: false,
e2e: {
setupNodeEvents(on, config) {
return require('./cypress/plugins/index.js')(on, config)
on('task', {
log(message) {
console.log(message)
return null
}
})
},
supportFile: false,
},
Expand Down
8 changes: 0 additions & 8 deletions examples/quiet/cypress/plugins/index.js

This file was deleted.

0 comments on commit db16930

Please sign in to comment.