New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create a Plugins / Extensions API #684
Comments
Example repos with TypeScript test compilation (using Cypress from source) |
The PR #888 implements the Plugins API. I'm keeping this issue open (as it is an epic) documenting many other plugin events that we are adding. We'll close the associated issues that are open and keep this issue open until all of them are complete. |
Any news about backend messaging? Is #794 still relevant and should I start using cypress-adapter-node? |
@laurentpayot we recently released This issue should now be closed since we've effectively created the plugins API. |
@brian-mann I made the switch to Cypress 3.0.1 yesterday. |
Hi, Is there any cypress function for Highlight and mark the text? Please confirm. |
@CharumathiA Not that I'm aware of. |
Documentation (https://docs.cypress.io/api/plugins/writing-a-plugin.html#List-of-events) says "We have many new plugin events we are adding." and links to this 2 year old closed issue. So I'm curious are there new events but undocumented or is the development still going? |
Yes actually there are new events planned here: #2840 I'll remove this link from the docs as it's outdated. |
The idea behind this
As it stands - while users can create custom commands in the
driver
, we do not expose any real way to alter, modify or change Cypress's behavior BEHIND the driver (in the node server code).Currently all we expose is a simple
cypress.json
to change the way Cypress works. This is heavily limiting.What we need to do is expose a public interface so users can write
node
code to modify and alter the internals.The use cases we're specifically trying to support are:
Custom Preprocessors
Swapping out the default
preprocessor
for custom ones. This is the thing that processes the spec files and ultimately serves them to the browser.Customizing the preprocess would enable users to write
typescript
,coffeescript 2.0
,clojurescript
, usewebpack
, customizebabel
options, use newerES7
features, etc, etc. Big win.Browser Configuration
Users would have access to the browser processes and launch configuration. This would enable them to change the flags used to launch browsers.
You could also use this to load in browser extensions.
Browser Finding
Changes / modifies the logic we use to find browsers on the system.
Custom Configuration
Having just a single
cypress.json
is limiting. Users have expressed a desire to have more programatic control over things like environment variables.Backend Messaging
While we currently expose
cy.exec
andcy.request
, there is still a desire to message / talk directly to your backend.Exposing this API would enable you to do things like call your application code directly to do things like setup / seed / create / update database records.
Screenshot Diffing
As we continue to expand the features of Cypress we would expand these API's to do things like letting you swap out the screenshot diffing algorithm.
The Cypress Ecosystem
Going down this route will enable us to develop a Cypress Ecosystem consisting of official extensions (created by us) as well as user submitted extensions.
We'll also need to create an "index" of extensions that enable users to search, browse, and submit new extensions.
Things to consider
process.versions.cypress
@cypress
npm namespace.cypress/plugins/index.js
with all of the API's that we support.node
code by passing a flag to Cypress which spawns the internal chrome inspector.node
environment that comes with Cypress.Examples of how we could do this
The text was updated successfully, but these errors were encountered: