Advantages of Cypress
- Cypress Plugins: Cypress has very long list of supported plugins which make writing the code and incorporating new additional functionality to cypress very easy. Plugins can easily be added in cypress by adding it as dependency in package.json file.
- Time Travel ; Cypress framework captures snapshots for each command at the time of execution(during debug/code writing). This allows user to hover over a specific command in the command log to see exactly what happened at that particular step.
- Automatic Waiting : One doesn't need to add explicit or implicit wait commands in test scripts, unlike selenium, cypress waits for commands and assertions.
- Element Interaction : The automatic scrolling operation ensures that an element in view before performing any action(Example- Clicking a button).
- Custom commands : Using cypress we can create custom or modify existing in build commands.
- Debug ability :One can debug directly from developer tools. In addition to this when user writes commands, Cypress executes them in real time, providing visual feedback as they run(can be enable/disable with config).
- Screenshots and videos : Cypress take screenshots automatically on failure and record videos of entire test suite when running from the CLI.
- Execution Speed : As the cypress code is executed inside the browser it speed up the execution time.
- Documentation : Cypress carries excellent documentation.
Limitation of Cypress
- Cypress does not support multi-tabs operation so any operation which involve invocation of new tab will fail.
- Cypress only supports JavaScript for creating test cases.
- Cypress doesn't provide support for browsers like safari and IE at the moment.
- Cypress have limited support for iframes.