Coder Social home page Coder Social logo

dan-cooke / cypress-autostub Goto Github PK

View Code? Open in Web Editor NEW
9.0 2.0 0.0 199 KB

This plugin for the Cypress automation framework alleviates the need to mantain brittle manual mocks by automating the recording and stubbing of requests.

JavaScript 0.58% TypeScript 99.42%

cypress-autostub's People

Contributors

dan-cooke avatar dependabot[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

cypress-autostub's Issues

The plugins file is missing or invalid.

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)

typo "mantain"

There is a typo in the description and the README. It should be "maintain".

image

The automated release is failing 🚨

🚨 The automated release from the 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.


No npm token specified.

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 πŸ“¦πŸš€

Unable to import cypress-autostub

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:

Cypress 12 support?

Are they any plans to upgarde this library to support the new cypress syntax that been introduced in cypress 10?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.