# Cypress

Testery has a [Cypress.io](http://cypress.io/) test runner so that Cypress tests can be run on the Testery platform. Cypress is a next generation front end testing tool built for the modern web. Here is an [overview](https://docs.cypress.io/guides/overview/why-cypress.html#In-a-nutshell) of Cypress.

[Here](https://docs.cypress.io/guides/overview/why-cypress.html#Features) is a list of things Cypress claims it can do that no other testing framework can.

Read about [what makes Cypress unique](https://docs.cypress.io/guides/overview/key-differences.html#Architecture).

When running Cypress tests in Testery, there are a few things to take note of:

* Testery supports screenshots and video recordings
* Testery supports Chrome browser only
* Due to limits within the Cypress framework, we can only parallelize tests runs at the file level.

### How to Take Screenshots & Videos with Cypress

In order to take high-resolution videos and screenshots with Cypress on Testery, you will need to configure some browser behavior in your `cypress.config.js` file.  Add the following code:

```javascript
module.exports = defineConfig({
  e2e: {
    // Other settings can go here
    viewportHeight: 1080,
    viewportWidth: 1920,
    setupNodeEvents(on, config) {
      on('before:browser:launch', (browser = {}, launchOptions) => {
        if (browser.name === 'chrome') {
          launchOptions.args.push(`--window-size=1920,1080`)
      
          // force screen to be non-retina and just use our given resolution
          launchOptions.args.push('--force-device-scale-factor=1')
        }
        return launchOptions
      });
  }
});
```

Videos will be automatically recorded, but screenshots need to be triggered using the `cy.screenshot()` directive in your test code.  Cypress' screenshot functionality provides a number of additional options you can explore [here](https://docs.cypress.io/api/commands/screenshot).
