Fixing CONFIG_VALIDATION_ERROR / SETUP_NODE_EVENTS_IS_NOT_FUNCTION errors

This commit is contained in:
Tim Griesser
2022-02-21 17:37:39 -05:00
parent 7e8370a2a5
commit 73def69360
25 changed files with 417 additions and 242 deletions

View File

@@ -0,0 +1,53 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Courier+Prime&display=swap" rel="stylesheet">
<style>
body {
font-family: "Courier Prime", Courier, monospace;
padding: 0 1em;
line-height: 1.4;
color: #eee;
background-color: #111;
}
pre {
padding: 0 0;
margin: 0 0;
font-family: "Courier Prime", Courier, monospace;
}
body {
margin: 5px;
padding: 0;
overflow: hidden;
}
pre {
white-space: pre-wrap;
word-break: break-word;
-webkit-font-smoothing: antialiased;
}
</style>
</head>
<body><pre><span style="color:#e05561">The <span style="color:#e5e510">component.devServer<span style="color:#e05561"> method must be a function with the following signature:<span style="color:#e6e6e6">
<span style="color:#e05561"><span style="color:#e6e6e6">
<span style="color:#e05561"><span style="color:#4ec4ff"><span style="color:#e05561"><span style="color:#e6e6e6">
<span style="color:#e05561"><span style="color:#4ec4ff"> devServer (cypressDevServerConfig, devServerConfig) {<span style="color:#e05561"><span style="color:#e6e6e6">
<span style="color:#e05561"><span style="color:#4ec4ff"> // start dev server here<span style="color:#e05561"><span style="color:#e6e6e6">
<span style="color:#e05561"><span style="color:#4ec4ff"> }<span style="color:#e05561"><span style="color:#e6e6e6">
<span style="color:#e05561"><span style="color:#4ec4ff"> <span style="color:#e05561"><span style="color:#e6e6e6">
<span style="color:#e05561"><span style="color:#e6e6e6">
<span style="color:#e05561">Instead, we saw: <span style="color:#e6e6e6">
<span style="color:#e05561"><span style="color:#e6e6e6">
<span style="color:#e05561"><span style="color:#de73ff">{}<span style="color:#e05561"><span style="color:#e6e6e6">
<span style="color:#e05561"><span style="color:#e6e6e6">
<span style="color:#e05561">This error is from: <span style="color:#de73ff">/path/to/config.ts<span style="color:#e05561"><span style="color:#e6e6e6">
<span style="color:#e05561"><span style="color:#e6e6e6">
<span style="color:#e05561">Learn more: https://on.cypress.io/dev-server<span style="color:#e6e6e6">
<span style="color:#e05561"><span style="color:#e6e6e6"></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span>
</pre></body></html>

View File

@@ -34,7 +34,7 @@
</style>
</head>
<body><pre><span style="color:#e05561">Your <span style="color:#e5e510">configFile<span style="color:#e05561"> set an invalid value from: <span style="color:#4ec4ff">cypress.json<span style="color:#e05561"><span style="color:#e6e6e6">
<body><pre><span style="color:#e05561">Your <span style="color:#e5e510">configFile<span style="color:#e05561"> at <span style="color:#4ec4ff">cypress.json<span style="color:#e05561"> set an invalid value:<span style="color:#e6e6e6">
<span style="color:#e05561"><span style="color:#e6e6e6">
<span style="color:#e05561">Expected <span style="color:#e5e510">defaultCommandTimeout<span style="color:#e05561"> to be a number.<span style="color:#e6e6e6">
<span style="color:#e05561"><span style="color:#e6e6e6">

View File

@@ -34,7 +34,7 @@
</style>
</head>
<body><pre><span style="color:#e05561">Your <span style="color:#e5e510">configFile<span style="color:#e05561"> set an invalid value from: <span style="color:#4ec4ff">cypress.json<span style="color:#e05561"><span style="color:#e6e6e6">
<body><pre><span style="color:#e05561">Your <span style="color:#e5e510">configFile<span style="color:#e05561"> at <span style="color:#4ec4ff">cypress.json<span style="color:#e05561"> set an invalid value:<span style="color:#e6e6e6">
<span style="color:#e05561"><span style="color:#e6e6e6">
<span style="color:#e05561">Expected <span style="color:#e5e510">defaultCommandTimeout<span style="color:#e05561"> to be a number.<span style="color:#e6e6e6">
<span style="color:#e05561"><span style="color:#e6e6e6">

View File

@@ -34,7 +34,7 @@
</style>
</head>
<body><pre><span style="color:#e05561">Your <span style="color:#e5e510">configFile<span style="color:#e05561"> set an invalid value from: <span style="color:#4ec4ff">cypress.json<span style="color:#e05561"><span style="color:#e6e6e6">
<body><pre><span style="color:#e05561">Your <span style="color:#e5e510">configFile<span style="color:#e05561"> at <span style="color:#4ec4ff">cypress.json<span style="color:#e05561"> set an invalid value:<span style="color:#e6e6e6">
<span style="color:#e05561"><span style="color:#e6e6e6">
<span style="color:#e05561">Expected <span style="color:#e5e510">defaultCommandTimeout<span style="color:#e05561"> to be a number.<span style="color:#e6e6e6">
<span style="color:#e05561"><span style="color:#e6e6e6">

View File

@@ -34,7 +34,7 @@
</style>
</head>
<body><pre><span style="color:#e05561">Your <span style="color:#e5e510">configFile<span style="color:#e05561"> set an invalid value from: <span style="color:#4ec4ff">cypress.json<span style="color:#e05561"><span style="color:#e6e6e6">
<body><pre><span style="color:#e05561">Your <span style="color:#e5e510">configFile<span style="color:#e05561"> at <span style="color:#4ec4ff">cypress.json<span style="color:#e05561"> set an invalid value:<span style="color:#e6e6e6">
<span style="color:#e05561"><span style="color:#e6e6e6">
<span style="color:#e05561">The error occurred while validating the <span style="color:#de73ff">browsers<span style="color:#e05561"> list.<span style="color:#e6e6e6">
<span style="color:#e05561"><span style="color:#e6e6e6">

View File

@@ -34,7 +34,7 @@
</style>
</head>
<body><pre><span style="color:#e05561">Your <span style="color:#e5e510">pluginsFile<span style="color:#e05561"> set an invalid value from: <span style="color:#4ec4ff">cypress/plugins/index.js<span style="color:#e05561"><span style="color:#e6e6e6">
<body><pre><span style="color:#e05561">Your <span style="color:#e5e510">pluginsFile<span style="color:#e05561"> at <span style="color:#4ec4ff">cypress/plugins/index.js<span style="color:#e05561"> set an invalid value:<span style="color:#e6e6e6">
<span style="color:#e05561"><span style="color:#e6e6e6">
<span style="color:#e05561">Expected <span style="color:#e5e510">defaultCommandTimeout<span style="color:#e05561"> to be a number.<span style="color:#e6e6e6">
<span style="color:#e05561"><span style="color:#e6e6e6">

View File

@@ -34,7 +34,7 @@
</style>
</head>
<body><pre><span style="color:#e05561">Your <span style="color:#e5e510">configFile<span style="color:#e05561"> set an invalid value from: <span style="color:#4ec4ff">cypress.json<span style="color:#e05561"><span style="color:#e6e6e6">
<body><pre><span style="color:#e05561">Your <span style="color:#e5e510">configFile<span style="color:#e05561"> at <span style="color:#4ec4ff">cypress.json<span style="color:#e05561"> set an invalid value:<span style="color:#e6e6e6">
<span style="color:#e05561"><span style="color:#e6e6e6">
<span style="color:#e05561">Expected <span style="color:#e5e510">defaultCommandTimeout<span style="color:#e05561"> to be a number.<span style="color:#e6e6e6">
<span style="color:#e05561"><span style="color:#e6e6e6">

View File

@@ -34,7 +34,7 @@
</style>
</head>
<body><pre><span style="color:#e05561">Your <span style="color:#e5e510">configFile<span style="color:#e05561"> set an invalid value from: <span style="color:#4ec4ff">cypress.json<span style="color:#e05561"><span style="color:#e6e6e6">
<body><pre><span style="color:#e05561">Your <span style="color:#e5e510">configFile<span style="color:#e05561"> as <span style="color:#4ec4ff">cypress.json<span style="color:#e05561"> set an invalid value:<span style="color:#e6e6e6">
<span style="color:#e05561"><span style="color:#e6e6e6">
<span style="color:#e05561"><span style="color:#e5e510">`something` was not right<span style="color:#e05561"><span style="color:#e6e6e6"></span></span></span></span></span></span></span></span></span></span></span></span>
</pre></body></html>

View File

@@ -34,15 +34,15 @@
</style>
</head>
<body><pre><span style="color:#e05561">Your <span style="color:#e5e510">pluginsFile<span style="color:#e05561"> did not export a valid function from: <span style="color:#4ec4ff">/path/to/pluginsFile<span style="color:#e05561"><span style="color:#e6e6e6">
<body><pre><span style="color:#e05561">Your <span style="color:#e5e510">configFile<span style="color:#e05561"> is invalid: <span style="color:#4ec4ff">/path/to/pluginsFile<span style="color:#e05561"><span style="color:#e6e6e6">
<span style="color:#e05561"><span style="color:#e6e6e6">
<span style="color:#e05561">It must export a function with the following signature:<span style="color:#e6e6e6">
<span style="color:#e05561">The setupNodeEvents in your <span style="color:#e5e510">e2e<span style="color:#e05561"> config should define a function with the following signature:<span style="color:#e6e6e6">
<span style="color:#e05561"><span style="color:#e6e6e6">
<span style="color:#e05561"><span style="color:#4ec4ff">module.exports = (on, config) =&gt; {<span style="color:#e05561"><span style="color:#e6e6e6">
<span style="color:#e05561"><span style="color:#4ec4ff"> <span style="color:#4f5666">// configure plugins here<span style="color:#4ec4ff"><span style="color:#e05561"><span style="color:#e6e6e6">
<span style="color:#e05561"><span style="color:#4ec4ff">setupNodeEvents(on, config) {<span style="color:#e05561"><span style="color:#e6e6e6">
<span style="color:#e05561"><span style="color:#4ec4ff"> <span style="color:#4f5666">// configure tasks / plugins here<span style="color:#4ec4ff"><span style="color:#e05561"><span style="color:#e6e6e6">
<span style="color:#e05561"><span style="color:#4ec4ff">}<span style="color:#e05561"><span style="color:#e6e6e6">
<span style="color:#e05561"><span style="color:#e6e6e6">
<span style="color:#e05561">Instead it exported:<span style="color:#e6e6e6">
<span style="color:#e05561">Instead we saw:<span style="color:#e6e6e6">
<span style="color:#e05561"><span style="color:#e6e6e6">
<span style="color:#e05561"><span style="color:#de73ff">[<span style="color:#e05561"><span style="color:#e6e6e6">
<span style="color:#e05561"><span style="color:#de73ff"> &quot;some&quot;,<span style="color:#e05561"><span style="color:#e6e6e6">
@@ -50,5 +50,5 @@
<span style="color:#e05561"><span style="color:#de73ff">]<span style="color:#e05561"><span style="color:#e6e6e6">
<span style="color:#e05561"><span style="color:#e6e6e6">
<span style="color:#e05561">https://on.cypress.io/plugins-api<span style="color:#e6e6e6">
<span style="color:#e05561"><span style="color:#e6e6e6"></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span>
<span style="color:#e05561"><span style="color:#e6e6e6"></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span>
</pre></body></html>

View File

@@ -34,18 +34,18 @@
</style>
</head>
<body><pre><span style="color:#e05561">Your <span style="color:#e5e510">pluginsFile<span style="color:#e05561"> did not export a valid function from: <span style="color:#4ec4ff">/path/to/pluginsFile<span style="color:#e05561"><span style="color:#e6e6e6">
<body><pre><span style="color:#e05561">Your <span style="color:#e5e510">configFile<span style="color:#e05561"> is invalid: <span style="color:#4ec4ff">/path/to/pluginsFile<span style="color:#e05561"><span style="color:#e6e6e6">
<span style="color:#e05561"><span style="color:#e6e6e6">
<span style="color:#e05561">It must export a function with the following signature:<span style="color:#e6e6e6">
<span style="color:#e05561">The setupNodeEvents in your <span style="color:#e5e510">e2e<span style="color:#e05561"> config should define a function with the following signature:<span style="color:#e6e6e6">
<span style="color:#e05561"><span style="color:#e6e6e6">
<span style="color:#e05561"><span style="color:#4ec4ff">module.exports = (on, config) =&gt; {<span style="color:#e05561"><span style="color:#e6e6e6">
<span style="color:#e05561"><span style="color:#4ec4ff"> <span style="color:#4f5666">// configure plugins here<span style="color:#4ec4ff"><span style="color:#e05561"><span style="color:#e6e6e6">
<span style="color:#e05561"><span style="color:#4ec4ff">setupNodeEvents(on, config) {<span style="color:#e05561"><span style="color:#e6e6e6">
<span style="color:#e05561"><span style="color:#4ec4ff"> <span style="color:#4f5666">// configure tasks / plugins here<span style="color:#4ec4ff"><span style="color:#e05561"><span style="color:#e6e6e6">
<span style="color:#e05561"><span style="color:#4ec4ff">}<span style="color:#e05561"><span style="color:#e6e6e6">
<span style="color:#e05561"><span style="color:#e6e6e6">
<span style="color:#e05561">Instead it exported:<span style="color:#e6e6e6">
<span style="color:#e05561">Instead we saw:<span style="color:#e6e6e6">
<span style="color:#e05561"><span style="color:#e6e6e6">
<span style="color:#e05561"><span style="color:#de73ff">&quot;some string&quot;<span style="color:#e05561"><span style="color:#e6e6e6">
<span style="color:#e05561"><span style="color:#e6e6e6">
<span style="color:#e05561">https://on.cypress.io/plugins-api<span style="color:#e6e6e6">
<span style="color:#e05561"><span style="color:#e6e6e6"></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span>
<span style="color:#e05561"><span style="color:#e6e6e6"></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span>
</pre></body></html>

View File

@@ -34,20 +34,20 @@
</style>
</head>
<body><pre><span style="color:#e05561">Your <span style="color:#e5e510">pluginsFile<span style="color:#e05561"> did not export a valid function from: <span style="color:#4ec4ff">/path/to/pluginsFile<span style="color:#e05561"><span style="color:#e6e6e6">
<body><pre><span style="color:#e05561">Your <span style="color:#e5e510">configFile<span style="color:#e05561"> is invalid: <span style="color:#4ec4ff">/path/to/pluginsFile<span style="color:#e05561"><span style="color:#e6e6e6">
<span style="color:#e05561"><span style="color:#e6e6e6">
<span style="color:#e05561">It must export a function with the following signature:<span style="color:#e6e6e6">
<span style="color:#e05561">The setupNodeEvents in your <span style="color:#e5e510">e2e<span style="color:#e05561"> config should define a function with the following signature:<span style="color:#e6e6e6">
<span style="color:#e05561"><span style="color:#e6e6e6">
<span style="color:#e05561"><span style="color:#4ec4ff">module.exports = (on, config) =&gt; {<span style="color:#e05561"><span style="color:#e6e6e6">
<span style="color:#e05561"><span style="color:#4ec4ff"> <span style="color:#4f5666">// configure plugins here<span style="color:#4ec4ff"><span style="color:#e05561"><span style="color:#e6e6e6">
<span style="color:#e05561"><span style="color:#4ec4ff">setupNodeEvents(on, config) {<span style="color:#e05561"><span style="color:#e6e6e6">
<span style="color:#e05561"><span style="color:#4ec4ff"> <span style="color:#4f5666">// configure tasks / plugins here<span style="color:#4ec4ff"><span style="color:#e05561"><span style="color:#e6e6e6">
<span style="color:#e05561"><span style="color:#4ec4ff">}<span style="color:#e05561"><span style="color:#e6e6e6">
<span style="color:#e05561"><span style="color:#e6e6e6">
<span style="color:#e05561">Instead it exported:<span style="color:#e6e6e6">
<span style="color:#e05561">Instead we saw:<span style="color:#e6e6e6">
<span style="color:#e05561"><span style="color:#e6e6e6">
<span style="color:#e05561"><span style="color:#de73ff">{<span style="color:#e05561"><span style="color:#e6e6e6">
<span style="color:#e05561"><span style="color:#de73ff"> &quot;some&quot;: &quot;object&quot;<span style="color:#e05561"><span style="color:#e6e6e6">
<span style="color:#e05561"><span style="color:#de73ff">}<span style="color:#e05561"><span style="color:#e6e6e6">
<span style="color:#e05561"><span style="color:#e6e6e6">
<span style="color:#e05561">https://on.cypress.io/plugins-api<span style="color:#e6e6e6">
<span style="color:#e05561"><span style="color:#e6e6e6"></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span>
<span style="color:#e05561"><span style="color:#e6e6e6"></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span>
</pre></body></html>

View File

@@ -602,20 +602,20 @@ export const AllCypressErrors = {
`
},
// TODO: make this relative path, not absolute
SETUP_NODE_EVENTS_IS_NOT_FUNCTION: (testingType: string, pluginsFilePath: string, exported: any) => {
SETUP_NODE_EVENTS_IS_NOT_FUNCTION: (configFilePath: string, testingType: string, exported: any) => {
const code = errPartial`
setupNodeEvents(on, config) => {
setupNodeEvents(on, config) {
${fmt.comment(`// configure tasks / plugins here`)}
}`
return errTemplate`\
The setupNodeEvents in your ${fmt.highlight(`configFile.${testingType}`)} config did not export a valid function
Your ${fmt.highlight(`configFile`)} is invalid: ${fmt.path(configFilePath)}
It must export a function with the following signature:
The setupNodeEvents in your ${fmt.highlight(testingType)} config should define a function with the following signature:
${fmt.code(code)}
Instead it exported:
Instead we saw:
${fmt.stringify(exported)}

View File

@@ -658,9 +658,9 @@ describe('visual error templates', () => {
},
SETUP_NODE_EVENTS_IS_NOT_FUNCTION: () => {
return {
default: ['e2e', '/path/to/pluginsFile', { some: 'object' }],
string: ['e2e', '/path/to/pluginsFile', 'some string'],
array: ['e2e', '/path/to/pluginsFile', ['some', 'array']],
default: ['/path/to/pluginsFile', 'e2e', { some: 'object' }],
string: ['/path/to/pluginsFile', 'e2e', 'some string'],
array: ['/path/to/pluginsFile', 'e2e', ['some', 'array']],
}
},
CONFIG_FILE_SETUP_NODE_EVENTS_ERROR: () => {

View File

@@ -37,6 +37,10 @@ describe('Choose a Browser Page', () => {
cy.validateExternalLink({
href: 'https://on.cypress.io/customize-browsers',
})
cy.validateExternalLink({
href: 'https://on.cypress.io/troubleshooting-launching-browsers',
})
})
// Ensure warning can be dismissed

View File

@@ -242,10 +242,10 @@ export function updateWithPluginValues (cfg, overrides) {
}
if (_.isString(validationResult)) {
return errors.throwErr('CONFIG_VALIDATION_MSG_ERROR', 'pluginsFile', configFile, validationResult)
return errors.throwErr('CONFIG_VALIDATION_MSG_ERROR', 'configFile', configFile, validationResult)
}
return errors.throwErr('CONFIG_VALIDATION_ERROR', 'pluginsFile', configFile, validationResult)
return errors.throwErr('CONFIG_VALIDATION_ERROR', 'configFile', configFile, validationResult)
// return errors.throwErr('CONFIG_VALIDATION_ERROR', 'pluginsFile', relativePluginsPath, errMsg)
})

View File

@@ -52,10 +52,10 @@ function run (ipc, configFile, projectRoot) {
return false
})
const isValidSetupNodeEvents = (setupNodeEvents) => {
if (setupNodeEvents && typeof setupNodeEvents !== 'function') {
const isValidSetupNodeEvents = (config, testingType) => {
if (config[testingType] && config[testingType].setupNodeEvents && typeof config[testingType].setupNodeEvents !== 'function') {
ipc.send('setupTestingType:error', util.serializeError(
require('@packages/errors').getError('SETUP_NODE_EVENTS_IS_NOT_FUNCTION', configFile, setupNodeEvents),
require('@packages/errors').getError('SETUP_NODE_EVENTS_IS_NOT_FUNCTION', configFile, testingType, config[testingType].setupNodeEvents),
))
return false
@@ -104,8 +104,12 @@ function run (ipc, configFile, projectRoot) {
const runPlugins = new RunPlugins(ipc, projectRoot, configFile)
if (!isValidSetupNodeEvents(result, testingType)) {
return
}
if (testingType === 'component') {
if (!isValidSetupNodeEvents(result.setupNodeEvents) || !isValidDevServer((result.component || {}))) {
if (!isValidDevServer((result.component || {}))) {
return
}
@@ -119,10 +123,6 @@ function run (ipc, configFile, projectRoot) {
return setupNodeEvents(on, config)
})
} else if (testingType === 'e2e') {
if (!isValidSetupNodeEvents(result.e2e && result.e2e.setupNodeEvents)) {
return
}
const setupNodeEvents = result.e2e && result.e2e.setupNodeEvents || ((on, config) => {})
runPlugins.runSetupNodeEvents(options, setupNodeEvents)

View File

@@ -66,7 +66,7 @@ describe.skip('lib/plugins/child/run_plugins', () => {
it('sends error message if setupNodeEvents does not export a function', function () {
mockery.registerMock('plugins-file', null)
runPlugins(this.ipc, 'plugins-file', 'proj-root')
expect(this.ipc.send).to.be.calledWith('load:error', 'PLUGINS_DIDNT_EXPORT_FUNCTION', 'plugins-file')
expect(this.ipc.send).to.be.calledWith('load:error', 'SETUP_NODE_EVENTS_IS_NOT_FUNCTION', 'plugins-file')
})
it('sends error message if setupNodeEvents is not a function', function () {

View File

@@ -7,14 +7,14 @@ exports['e2e launching browsers by path works with an installed browser path 1']
┌────────────────────────────────────────────────────────────────────────────────────────────────┐
│ Cypress: 1.2.3 │
│ Browser: Custom FooBrowser 88 │
│ Specs: 1 found (simple.cy.js) │
│ Searched: cypress/e2e/simple.cy.js │
│ Specs: 1 found (simple.cy.js)
│ Searched: cypress/e2e/simple.cy.js
└────────────────────────────────────────────────────────────────────────────────────────────────┘
────────────────────────────────────────────────────────────────────────────────────────────────────
Running: simple.cy.js (1 of 1)
Running: simple.cy.js (1 of 1)
✓ is true
@@ -33,14 +33,14 @@ exports['e2e launching browsers by path works with an installed browser path 1']
│ Screenshots: 0 │
│ Video: true │
│ Duration: X seconds │
│ Spec Ran: simple.cy.js │
│ Spec Ran: simple.cy.js
└────────────────────────────────────────────────────────────────────────────────────────────────┘
(Video)
- Started processing: Compressing to 32 CRF
- Finished processing: /XXX/XXX/XXX/cypress/videos/simple.cy.js.mp4 (X second)
- Finished processing: /XXX/XXX/XXX/cypress/videos/simple.cy.js.mp4 (X second)
====================================================================================================
@@ -50,7 +50,7 @@ exports['e2e launching browsers by path works with an installed browser path 1']
Spec Tests Passing Failing Pending Skipped
┌────────────────────────────────────────────────────────────────────────────────────────────────┐
│ ✔ simple.cy.js XX:XX 1 1 - - - │
│ ✔ simple.cy.js XX:XX 1 1 - - - │
└────────────────────────────────────────────────────────────────────────────────────────────────┘
✔ All specs passed! XX:XX 1 1 - - -

View File

@@ -141,7 +141,7 @@ exports['e2e config applies defaultCommandTimeout globally 1'] = `
`
exports['e2e config throws error when invalid viewportWidth in the configuration file 1'] = `
Your configFile set an invalid value from: cypress.config.js
Your configFile set an invalid value from: /foo/bar/.projects/config-with-invalid-viewport/cypress.config.js
Expected viewportWidth to be a number.
@@ -150,7 +150,7 @@ Instead the value was: "foo"
`
exports['e2e config throws error when invalid browser in the configuration file 1'] = `
Your configFile set an invalid value from: cypress.config.js
Your configFile set an invalid value from: /foo/bar/.projects/config-with-invalid-browser/cypress.config.js
The error occurred while validating the browsers list.
@@ -172,62 +172,73 @@ Instead the value was:
exports['e2e config throws error when multiple default config file are found in project 1'] = `
There is both a cypress.config.js and a cypress.config.ts at the location below:
> /foo/bar/.projects/pristine
> /foo/bar/.projects/pristine-with-e2e-testing
Cypress does not know which one to read for config. Please remove one of the two and try again.
`
exports['e2e config throws error when cypress.json is found in project and need migration 1'] = `
There is a cypress.json file at the location below:
/foo/bar/.projects/pristine
There is both a cypress.config.js and a cypress.config.ts at the location below:
There is a cypress.json file at the path: /foo/bar/.projects/pristine
> /foo/bar/.projects/pristine
Cypress version 10.0.0 no longer supports cypress.json.
Cypress 10 no longer supports 'cypress.json'. Please run \`cypress open\` to launch the migration tool to migrate to 'cypress.config.{ts|js}'.
Please run cypress open to launch the migration tool to migrate to cypress.config.{ts|js}.
`
exports['e2e config throws error when cypress.json is found in project and cypress.config.{ts|js} exists as well 1'] = `
There is both a \`cypress.config.js\` and a cypress.json file at the location below:
There is both a cypress.config.js and a cypress.json file at the location below:
/foo/bar/.projects/multiple-config-files-with-json
Cypress no longer supports 'cypress.json' config, please remove it from your project.
Cypress no longer supports cypress.json, please remove it from your project.
`
exports['e2e config throws an error if supportFile is set on the root level 1'] = `
The \`supportFile\` configuration option was removed from the root in Cypress version \`10.0.0\`. Please update this option under each testing type property.
The supportFile configuration option was removed from the root of the Cypress config object in version 10.0.0.
Please update this option under each testing type property.
https://on.cypress.io/migration-guide
`
exports['e2e config throws an error if specPattern is set on the root level 1'] = `
The \`specPattern\` configuration option was removed from the root in Cypress version \`10.0.0\`. Please update this option under each testing type property.
The specPattern configuration option was removed from the root of the Cypress config object in version 10.0.0.
Please update this option under each testing type property.
https://on.cypress.io/migration-guide
`
exports['e2e config throws an error if excludeSpecPattern is set on the root level 1'] = `
The \`excludeSpecPattern\` configuration option was removed from the root in Cypress version \`10.0.0\`. Please update this option under each testing type property.
The excludeSpecPattern configuration option was removed from the root of the Cypress config object in version 10.0.0.
Please update this option under each testing type property.
https://on.cypress.io/migration-guide
`
exports['e2e config throws an error if baseUrl is set on the root level 1'] = `
The \`baseUrl\` configuration option was removed from the root in Cypress version \`10.0.0\`. Please update this option under e2e testing type property.
The baseUrl configuration option was removed from the root of the Cypress config object in version 10.0.0.
Please update this option under the e2e testing type property.
https://on.cypress.io/migration-guide
`
exports['e2e config throws an error if baseUrl is set on the component level 1'] = `
The \`baseUrl\` configuration option is not valid in Component testing. Please update this option under e2e testing type property.
The baseUrl configuration option is not valid in Component testing.
Please remove or add this option under e2e testing type property.
https://on.cypress.io/migration-guide

View File

@@ -18,7 +18,7 @@ exports['e2e plugins fails when spec does not exist 1'] = `
Oops...we found an error preparing this test file:
> cypress/integration/spec.js
> cypress/e2e/spec.js
The error was:

View File

@@ -1,3 +1,36 @@
exports['deprecated before:browser:launch args / fails when adding unknown properties to launchOptions'] = `
====================================================================================================
(Run Starting)
┌────────────────────────────────────────────────────────────────────────────────────────────────┐
│ Cypress: 1.2.3 │
│ Browser: FooBrowser 88 │
│ Specs: 1 found (app.cy.js) │
│ Searched: cypress/e2e/app.cy.js │
└────────────────────────────────────────────────────────────────────────────────────────────────┘
────────────────────────────────────────────────────────────────────────────────────────────────────
Running: app.cy.js (1 of 1)
The launchOptions object returned by your plugin's before:browser:launch handler contained unexpected properties:
- foo
- width
- height
launchOptions may only contain the properties:
- preferences
- extensions
- args
https://on.cypress.io/browser-launch-api
`
exports['deprecated before:browser:launch args / push and no return - warns user exactly once'] = `
====================================================================================================
@@ -109,6 +142,187 @@ exports['deprecated before:browser:launch args / using non-deprecated API - no w
✔ All specs passed! XX:XX 1 1 - - -
`
exports['deprecated before:browser:launch args / concat return returns once per spec - [electron]'] = `
====================================================================================================
(Run Starting)
┌────────────────────────────────────────────────────────────────────────────────────────────────┐
│ Cypress: 1.2.3 │
│ Browser: FooBrowser 88 │
│ Specs: 2 found (app.cy.js, app_spec2.js) │
│ Searched: cypress/e2e/app.cy.js, cypress/e2e/app_spec2.js │
└────────────────────────────────────────────────────────────────────────────────────────────────┘
────────────────────────────────────────────────────────────────────────────────────────────────────
Running: app.cy.js (1 of 2)
Deprecation Warning: The before:browser:launch plugin event changed its signature in Cypress version 4.0.0
The event switched from yielding the second argument as an array of browser arguments to an options object with an args property.
We've detected that your code is still using the previous, deprecated interface signature.
This code will not work in a future version of Cypress. Please see the upgrade guide: https://on.cypress.io/deprecated-before-browser-launch-args
✓ asserts on browser args
1 passing
(Results)
┌────────────────────────────────────────────────────────────────────────────────────────────────┐
│ Tests: 1 │
│ Passing: 1 │
│ Failing: 0 │
│ Pending: 0 │
│ Skipped: 0 │
│ Screenshots: 0 │
│ Video: false │
│ Duration: X seconds │
│ Spec Ran: app.cy.js │
└────────────────────────────────────────────────────────────────────────────────────────────────┘
────────────────────────────────────────────────────────────────────────────────────────────────────
Running: app_spec2.js (2 of 2)
Deprecation Warning: The before:browser:launch plugin event changed its signature in Cypress version 4.0.0
The event switched from yielding the second argument as an array of browser arguments to an options object with an args property.
We've detected that your code is still using the previous, deprecated interface signature.
This code will not work in a future version of Cypress. Please see the upgrade guide: https://on.cypress.io/deprecated-before-browser-launch-args
✓ 2 - asserts on browser args
1 passing
(Results)
┌────────────────────────────────────────────────────────────────────────────────────────────────┐
│ Tests: 1 │
│ Passing: 1 │
│ Failing: 0 │
│ Pending: 0 │
│ Skipped: 0 │
│ Screenshots: 0 │
│ Video: false │
│ Duration: X seconds │
│ Spec Ran: app_spec2.js │
└────────────────────────────────────────────────────────────────────────────────────────────────┘
====================================================================================================
(Run Finished)
Spec Tests Passing Failing Pending Skipped
┌────────────────────────────────────────────────────────────────────────────────────────────────┐
│ ✔ app.cy.js XX:XX 1 1 - - - │
├────────────────────────────────────────────────────────────────────────────────────────────────┤
│ ✔ app_spec2.js XX:XX 1 1 - - - │
└────────────────────────────────────────────────────────────────────────────────────────────────┘
✔ All specs passed! XX:XX 2 2 - - -
`
exports['deprecated before:browser:launch args / concat return returns once per test run - [firefox,chromium]'] = `
====================================================================================================
(Run Starting)
┌────────────────────────────────────────────────────────────────────────────────────────────────┐
│ Cypress: 1.2.3 │
│ Browser: FooBrowser 88 │
│ Specs: 2 found (app.cy.js, app_spec2.js) │
│ Searched: cypress/e2e/app.cy.js, cypress/e2e/app_spec2.js │
└────────────────────────────────────────────────────────────────────────────────────────────────┘
────────────────────────────────────────────────────────────────────────────────────────────────────
Running: app.cy.js (1 of 2)
Deprecation Warning: The before:browser:launch plugin event changed its signature in Cypress version 4.0.0
The event switched from yielding the second argument as an array of browser arguments to an options object with an args property.
We've detected that your code is still using the previous, deprecated interface signature.
This code will not work in a future version of Cypress. Please see the upgrade guide: https://on.cypress.io/deprecated-before-browser-launch-args
✓ asserts on browser args
1 passing
(Results)
┌────────────────────────────────────────────────────────────────────────────────────────────────┐
│ Tests: 1 │
│ Passing: 1 │
│ Failing: 0 │
│ Pending: 0 │
│ Skipped: 0 │
│ Screenshots: 0 │
│ Video: false │
│ Duration: X seconds │
│ Spec Ran: app.cy.js │
└────────────────────────────────────────────────────────────────────────────────────────────────┘
────────────────────────────────────────────────────────────────────────────────────────────────────
Running: app_spec2.js (2 of 2)
✓ 2 - asserts on browser args
1 passing
(Results)
┌────────────────────────────────────────────────────────────────────────────────────────────────┐
│ Tests: 1 │
│ Passing: 1 │
│ Failing: 0 │
│ Pending: 0 │
│ Skipped: 0 │
│ Screenshots: 0 │
│ Video: false │
│ Duration: X seconds │
│ Spec Ran: app_spec2.js │
└────────────────────────────────────────────────────────────────────────────────────────────────┘
====================================================================================================
(Run Finished)
Spec Tests Passing Failing Pending Skipped
┌────────────────────────────────────────────────────────────────────────────────────────────────┐
│ ✔ app.cy.js XX:XX 1 1 - - - │
├────────────────────────────────────────────────────────────────────────────────────────────────┤
│ ✔ app_spec2.js XX:XX 1 1 - - - │
└────────────────────────────────────────────────────────────────────────────────────────────────┘
✔ All specs passed! XX:XX 2 2 - - -
`
exports['deprecated before:browser:launch args / no mutate return'] = `
@@ -164,101 +378,7 @@ exports['deprecated before:browser:launch args / no mutate return'] = `
`
exports['deprecated before:browser:launch args / fails when adding unknown properties to launchOptions'] = `
====================================================================================================
(Run Starting)
┌────────────────────────────────────────────────────────────────────────────────────────────────┐
│ Cypress: 1.2.3 │
│ Browser: FooBrowser 88 │
│ Specs: 1 found (app.cy.js) │
│ Searched: cypress/e2e/app.cy.js │
└────────────────────────────────────────────────────────────────────────────────────────────────┘
────────────────────────────────────────────────────────────────────────────────────────────────────
Running: app_spec.js (1 of 2)
Deprecation Warning: The before:browser:launch plugin event changed its signature in Cypress version 4.0.0
The event switched from yielding the second argument as an array of browser arguments to an options object with an args property.
We've detected that your code is still using the previous, deprecated interface signature.
This code will not work in a future version of Cypress. Please see the upgrade guide: https://on.cypress.io/deprecated-before-browser-launch-args
✓ asserts on browser args
1 passing
(Results)
┌────────────────────────────────────────────────────────────────────────────────────────────────┐
│ Tests: 1 │
│ Passing: 1 │
│ Failing: 0 │
│ Pending: 0 │
│ Skipped: 0 │
│ Screenshots: 0 │
│ Video: false │
│ Duration: X seconds │
│ Spec Ran: app.cy.js │
└────────────────────────────────────────────────────────────────────────────────────────────────┘
────────────────────────────────────────────────────────────────────────────────────────────────────
Running: app_spec2.js (2 of 2)
Deprecation Warning: The before:browser:launch plugin event changed its signature in Cypress version 4.0.0
The event switched from yielding the second argument as an array of browser arguments to an options object with an args property.
We've detected that your code is still using the previous, deprecated interface signature.
This code will not work in a future version of Cypress. Please see the upgrade guide: https://on.cypress.io/deprecated-before-browser-launch-args
✓ 2 - asserts on browser args
1 passing
(Results)
┌────────────────────────────────────────────────────────────────────────────────────────────────┐
│ Tests: 1 │
│ Passing: 1 │
│ Failing: 0 │
│ Pending: 0 │
│ Skipped: 0 │
│ Screenshots: 0 │
│ Video: false │
│ Duration: X seconds │
│ Spec Ran: app_spec2.js │
└────────────────────────────────────────────────────────────────────────────────────────────────┘
====================================================================================================
(Run Finished)
Spec Tests Passing Failing Pending Skipped
┌────────────────────────────────────────────────────────────────────────────────────────────────┐
│ ✔ app.cy.js XX:XX 1 1 - - - │
├────────────────────────────────────────────────────────────────────────────────────────────────┤
│ ✔ app_spec2.js XX:XX 1 1 - - - │
└────────────────────────────────────────────────────────────────────────────────────────────────┘
✔ All specs passed! XX:XX 2 2 - - -
`
exports['deprecated before:browser:launch args / concat return returns once per spec - [electron]'] = `
exports['deprecated before:browser:launch args / displays errors thrown and aborts the run'] = `
====================================================================================================
@@ -274,84 +394,30 @@ exports['deprecated before:browser:launch args / concat return returns once per
────────────────────────────────────────────────────────────────────────────────────────────────────
Running: app_spec.js (1 of 1)
The launchOptions object returned by your plugin's before:browser:launch handler contained unexpected properties:
Running: app.cy.js (1 of 2)
Error thrown from plugins handler
Error: Error thrown from plugins handler
[stack trace lines]
`
- foo
- width
- height
exports['deprecated before:browser:launch args / displays promises rejected and aborts the run'] = `
launchOptions may only contain the properties:
====================================================================================================
- preferences
- extensions
- args
✓ asserts on browser args
1 passing
(Results)
(Run Starting)
┌────────────────────────────────────────────────────────────────────────────────────────────────┐
Tests: 1
Passing: 1
Failing: 0
Pending: 0
│ Skipped: 0 │
│ Screenshots: 0 │
│ Video: false │
│ Duration: X seconds │
│ Spec Ran: app.cy.js │
Cypress: 1.2.3
Browser: FooBrowser 88
Specs: 2 found (app.cy.js, app_spec2.js)
Searched: cypress/e2e/app.cy.js, cypress/e2e/app_spec2.js
└────────────────────────────────────────────────────────────────────────────────────────────────┘
────────────────────────────────────────────────────────────────────────────────────────────────────
Running: app_spec2.js (2 of 2)
Deprecation Warning: The \`before:browser:launch\` plugin event changed its signature in version \`4.0.0\`
The \`before:browser:launch\` plugin event switched from yielding the second argument as an \`array\` of browser arguments to an options \`object\` with an \`args\` property.
We've detected that your code is still using the previous, deprecated interface signature.
This code will not work in a future version of Cypress. Please see the upgrade guide: https://on.cypress.io/deprecated-before-browser-launch-args
✓ 2 - asserts on browser args
1 passing
(Results)
┌────────────────────────────────────────────────────────────────────────────────────────────────┐
│ Tests: 1 │
│ Passing: 1 │
│ Failing: 0 │
│ Pending: 0 │
│ Skipped: 0 │
│ Screenshots: 0 │
│ Video: false │
│ Duration: X seconds │
│ Spec Ran: app_spec2.js │
└────────────────────────────────────────────────────────────────────────────────────────────────┘
====================================================================================================
(Run Finished)
Spec Tests Passing Failing Pending Skipped
┌────────────────────────────────────────────────────────────────────────────────────────────────┐
│ ✔ app.cy.js XX:XX 1 1 - - - │
├────────────────────────────────────────────────────────────────────────────────────────────────┤
│ ✔ app_spec2.js XX:XX 1 1 - - - │
└────────────────────────────────────────────────────────────────────────────────────────────────┘
✔ All specs passed! XX:XX 2 2 - - -
Running: app.cy.js (1 of 2)
Promise rejected from plugins handler
Error: Promise rejected from plugins handler
[stack trace lines]
`

View File

@@ -119,14 +119,14 @@ exports['e2e plugins can modify config from plugins 1'] = `
`
exports['e2e plugins catches invalid browsers list returned from plugins 1'] = `
Your pluginsFile set an invalid value from: cypress/plugins/index.js
Your configFile as cypress.config.js set an invalid value:
Expected at least one browser
`
exports['e2e plugins catches invalid browser returned from plugins 1'] = `
Your pluginsFile set an invalid value from: cypress/plugins/index.js
Your configFile at cypress.config.js set an invalid value:
The error occurred while validating the browsers list.
@@ -159,8 +159,6 @@ You can also use a custom browser: https://on.cypress.io/customize-browsers
Available browsers found on your system are:
- electron
Read more about how to troubleshoot launching browsers: https://on.cypress.io/troubleshooting-launching-browsers
`
exports['e2e plugins / works with user extensions'] = `
@@ -358,7 +356,7 @@ exports['e2e plugins calls after:screenshot for cy.screenshot() and failure scre
`
exports['e2e plugins catches invalid viewportWidth returned from plugins 1'] = `
Your pluginsFile set an invalid value from: cypress/plugins/index.js
Your configFile at cypress.config.js set an invalid value:
Expected viewportWidth to be a number.
@@ -421,7 +419,7 @@ Error: Async error from plugins file
`
exports['e2e plugins fails when invalid event is registered 1'] = `
Your pluginsFile threw a validation error: /foo/bar/.projects/plugin-validation-error/cypress/plugins/index.js
Your configFile threw a validation error: /foo/bar/.projects/plugin-validation-error/cypress.config.js
You must pass a valid event name when registering a plugin.
@@ -564,3 +562,42 @@ The error was thrown while executing your e2e.setupNodeEvents function:
InvalidEventHandlerError: The handler for the event \`task\` must be an object
[stack trace lines]
`
exports['e2e plugins fails when setupNodeEvents is not a function 1'] = `
Your configFile is invalid: /foo/bar/.projects/plugin-empty/cypress.config.js
The setupNodeEvents in your configFile.e2e should define a function with the following signature:
setupNodeEvents(on, config) {
// configure tasks / plugins here
}
Instead we saw:
"foo"
https://on.cypress.io/plugins-api
`
exports['e2e plugins fails when there is no function exported 1'] = `
Your configFile is invalid: /foo/bar/.projects/plugin-no-function-return/cypress.config.js
The setupNodeEvents in your configFile.e2e should define a function with the following signature:
setupNodeEvents(on, config) {
// configure tasks / plugins here
}
Instead we saw:
{
"foo": "foo",
"bar": "bar"
}
https://on.cypress.io/plugins-api
`

View File

@@ -0,0 +1,9 @@
module.exports = {
e2e: {
supportFile: false,
setupNodeEvents: {
foo: 'foo',
bar: 'bar',
},
},
}

View File

@@ -1,4 +0,0 @@
module.exports = {
foo: 'foo',
bar: 'bar',
}