dan-cooke / cypress-autostub Goto Github PK
View Code? Open in Web Editor NEWThis plugin for the Cypress automation framework alleviates the need to mantain brittle manual mocks by automating the recording and stubbing of requests.
This plugin for the Cypress automation framework alleviates the need to mantain brittle manual mocks by automating the recording and stubbing of requests.
When inserting the code below into the cypress/plugins/index.js, I am notified of an error in the plugins/index.js file and I can't run any test.
Cypress package version: 4.12.1
Cypress binary version: 4.12.1
// Import the plugin
import { autoStubSetup } from 'cypress-autostub'
module.exports = (on, config) => {
autoStubSetup(on, {
mockFileDirectory: 'cypress/fixtures'
})
}
Message: The plugins file is missing or invalid.
Your pluginsFile
is set to /cypress/plugins/index.js
, but either the file is missing, it contains a syntax error, or threw an error when required. The pluginsFile
must be a .js
, .ts
, or .coffee
file.
Or you might have renamed the extension of your pluginsFile
. If that's the case, restart the test runner.
Please fix this, or set pluginsFile
to false
if a plugins file is not necessary for your project.
**Details:** cypress/plugins/index.js:15
import { autoStubSetup } from 'cypress-autostub'
^^^^^^
SyntaxError: Cannot use import statement outside a module
at Module._compile (internal/modules/cjs/loader.js:896:18)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:986:10)
at Module.load (internal/modules/cjs/loader.js:816:32)
at Module._load (internal/modules/cjs/loader.js:728:14)
at Module._load (electron/js2c/asar.js:717:26)
at Function.Module._load (electron/js2c/asar.js:717:26)
at Module.require (internal/modules/cjs/loader.js:853:19)
at require (internal/modules/cjs/helpers.js:74:18)
at module.exports (/.cache/Cypress/4.12.1/Cypress/resources/app/packages/server/lib/plugins/child/run_plugins.js:208:15)
at Object.<anonymous> (/.cache/Cypress/4.12.1/Cypress/resources/app/packages/server/lib/plugins/child/index.js:6:25)
at Module._compile (internal/modules/cjs/loader.js:968:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:986:10)
at Module.load (internal/modules/cjs/loader.js:816:32)
at Module._load (internal/modules/cjs/loader.js:728:14)
at Module._load (electron/js2c/asar.js:717:26)
at Function.Module._load (electron/js2c/asar.js:717:26)
Stack trace:
Error: The plugins file is missing or invalid.
Your `pluginsFile` is set to `/cypress/plugins/index.js`, but either the file is missing, it contains a syntax error, or threw an error when required. The `pluginsFile` must be a `.js`, `.ts`, or `.coffee` file.
Or you might have renamed the extension of your `pluginsFile`. If that's the case, restart the test runner.
Please fix this, or set `pluginsFile` to `false` if a plugins file is not necessary for your project.
at Object.get (/.cache/Cypress/4.12.1/Cypress/resources/app/packages/server/lib/errors.js:946:15)
at EventEmitter.<anonymous> (/.cache/Cypress/4.12.1/Cypress/resources/app/packages/server/lib/plugins/index.js:123:21)
at EventEmitter.emit (events.js:210:5)
at ChildProcess.<anonymous> (/.cache/Cypress/4.12.1/Cypress/resources/app/packages/server/lib/plugins/util.js:19:22)
at ChildProcess.emit (events.js:210:5)
at emit (internal/child_process.js:876:12)
at processTicksAndRejections (internal/process/task_queues.js:81:21)
master
branch failed. π¨I recommend you give this issue a high priority, so other packages depending on you could benefit from your bug fixes and new features.
You can find below the list of errors reported by semantic-release. Each one of them has to be resolved in order to automatically publish your package. Iβm sure you can resolve this πͺ.
Errors are usually caused by a misconfiguration or an authentication problem. With each error reported below you will find explanation and guidance to help you to resolve it.
Once all the errors are resolved, semantic-release will release your package the next time you push a commit to the master
branch. You can also manually restart the failed CI job that runs semantic-release.
If you are not sure how to resolve this, here is some links that can help you:
If those donβt help, or if this issue is reporting something you think isnβt right, you can always ask the humans behind semantic-release.
An npm token must be created and set in the NPM_TOKEN
environment variable on your CI environment.
Please make sure to create an npm token and to set it in the NPM_TOKEN
environment variable on your CI environment. The token must allow to publish to the registry https://registry.npmjs.org/
.
Good luck with your project β¨
Your semantic-release bot π¦π
Hi team
trying to use the plug for auto mocking but at very first its failing as not mentioned in task
but as per the document there is not such option to mention in task
CypressError: `cy.task('getGlobalConfig')` failed with the following error:
The 'task' event has not been registered in the plugins file. You must register it before using cy.task()
Fix this in your plugins file here:
Are they any plans to upgarde this library to support the new cypress syntax that been introduced in cypress 10?
Are there any plans soon to support Cypress 6.*?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. πππ
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google β€οΈ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.