mirror of
https://github.com/cypress-io/cypress.git
synced 2025-12-30 19:19:53 -06:00
* chore: remove some devDeps * ignore used fonts in reporter * ignore multi-reporters + webpack cli dep * remove common-tags from runner package * replace older version of tough-cookie with type reference with server type * ignore webpack-cli from runner package * ignore used babel deps in web-config * ignore some deps from web-config * remove browser-resolve * remove unused sinon-chai dep from web-config * ignore polyfills in web-config * add test entrypoint to knip for server * remove unused repl.history devDep * remove unused supertest-session dep and calls * remove unused through2 devDep * ignore some used deps in server * ignore babel deps * ignore babel deps from system-tests * remove cachedir from system-tests devDeps * remove unused common-tags from system-tests * ignore deps in system-tests that are used * remove webpack from system-tests
Extension
This is the WebExtension responsible for automating the browser
Developing
Watching
Kicks off the gulp watcher that rebuilds the app/lib directories on change.
yarn workspace @packages/extension watch
Building
@packages/extension has a few different build processes occurring that are all driven by the gulpfile.
app- The web extension piece of the code, has two separate bundles:v2: Version 2 of the web extension which uses webpack to bundle theapp/v2directory and output it asbackground.jsv3: Version 3 of the web extension, which doesn't have any external dependencies so we are able to compile down to `ESM to run in the browser natively.
lib- the@packages/extensionmainentry that has utility methods on how to find/load the extension. This is transpiled to CommonJS as it is consumed in the Node context.
yarn workspace @packages/extension build
Testing
yarn workspace @packages/extension test
yarn workspace @packages/extension test-watch
yarn workspace @packages/extension test-debug
Debugging
In Chrome
- Open Chrome
- Go into Extensions (
chrome://extensions) - Check Developer Mode (top right of screen)
- Click Load unpacked extension... (top left of screen)
- Choose packages/extension/dist directory (v2)
- Click background page to debug
background.js(inspect viewsbackground page) - Click Reload (⌘R) to pull in changes to
manifest.json
In Firefox
- Launch Firefox via
cypress open. - Once Firefox is open, open an new tab and navigate to
about:debugging. - Click the
This Firefoxnavigation item on the left hand navigation pane and locate theCypressextension underTemporary Extensions. - Click
inspect. A console window should now appear in a separate window. - Close the
about:debuggingtab. - In the newly spawned console window, you should be able to see
background.jsin theDebuggertab. - Set breakpoints as needed to inspect what code you are trying to debug. Happy debugging!