Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

License

NotificationsYou must be signed in to change notification settings

mbolotov/intellij-cypress

Repository files navigation

IntegratesCypress.io under the common Intellij test framework.

Compatibility

As the plugin depends onJavaLanguage andNodeJS plugins, so it requires a commercial version of IDEA (Ultimate, WebStorm etc)

Install

Plugin can be installed from the Jetbrains Marketplace. Open 'Settings/Preferences ->Plugins' menu item and type 'Cypress' in the search bar. Seehere for details.

Usage

Brief video overview:https://www.youtube.com/watch?v=1gjjy0RQeBw

Test run configurations

Plugin introduces a dedicated Cypressrun configuration typeYou can create a run config from either file view (directory, spec file) or directly from the code

file viewcode view

Notice thatcypress-intellij-reporter introducesmocha dependency that enables the mocha test framework in IDEA automatically. So please do not confuse Cypress and Mocha run types:

Running tests

Simply start your configurationand take a deep breath. You can watch test status live on the corresponding tab:

You can navigate from a test entry in the test tab to the source code of this test just by clicking on it.

Runner limitations:

  1. No rerun failed tests only feature because Cypress is unable to run testsdefined by a grep pattern
  2. Run a single test feature is implemented by modifying the sources on the fly and mark the test with.only modifier automatically. So it may work incorrectly when a test spec already contains '.only' tests

Debugging tests

Video overview:https://www.youtube.com/watch?v=FIo62E1OMO0

It supports all the common IDE debug features: step-by-step execution, run to cursor, variable examining, expression evaluation, breakpoints (including conditional), etc.
It works for both headed and headless modes as well as in the interactive mode

Debugger limitations:

  1. Firefox is not currently supported.
  2. In some rare cases IDE can't map sources correctly so breakpoints will not hit in this case. Usedebugger statement to suspend the execution
  3. IDE need some time (usually less than a second) to attach breakpoints to Chrome. So your breakpotins could not be hit when test case executed fast.
  4. Ansynchronous Cypress commands cannot be debugged as they would be synchrounous. Seehere for details and workarounds.

Opening test screenshot from the test tree view

Plugin has a shortcut action to open test screenshot from the test tree view:

If a test holds screenshots in the folder, action will either suggest selecting from the list or pick up the latest screenshot.

This behavior can be configured in the settings:

Running Cucumber-Cypress tests

Starting from version 1.6, the plugin can start a cucumber test.

The exectuion depends on thecypress-cucumber-preprocessor so you need to add the following dependency to your project:

npm install --save-dev cypress-cucumber-preprocessor

To start a single scenario, the plugin will automatically add (and remove at the end) a@focus tag.

Build plugin from the sources

./gradlew buildPlugin

Run

Either start IDE bundled with plugin via gradle:

./gradlew runIdea

Or install built plugin manually in the Settings->Plugin section of IDEA


[8]ページ先頭

©2009-2025 Movatter.jp