# 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).


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.testery.io/framework-specific-guidance/cypress.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
