3.13.1 • Published 3 months ago

gatsby-cypress v3.13.1

Weekly downloads
7,163
License
MIT
Repository
github
Last release
3 months ago

gatsby-cypress

This package provides additional Cypress commands for testing Gatsby websites.

Please note: This package is not required to use Gatsby and Cypress together. It only exists to add extra commands for convenience.

If you want to find elements (e.g. by test ID or by text/label/etc.), consider using @testing-library/cypress.

Installation

To use these commands, first install the necessary packages:

npm install gatsby-cypress --save-dev

Adding custom Gatsby testing commands

Next, add a new file located at cypress/support/e2e.ts and add the Gatsby-specific Cypress commands:

import "gatsby-cypress/commands"

If you're using TypeScript, add its types to Cypress' tsconfig.json file:

{
  "compilerOptions": {
    // highlight-next-line
    "types": ["cypress", "gatsby-cypress"]
  },
  "include": ["."]
}

Once imported, the following additional commands are available:

  • cy.waitForRouteChange(): Waits for Gatsby to finish the route change, in order to ensure event handlers are properly setup. Example:

    cy.visit(`/page-2`).waitForRouteChange()
  • cy.waitForAPI('api-name'): Waits for a specific Gatsby API to finish. Example:

    cy.waitForAPI(`onRouteUpdate`).get(`#element-with-event-handler`).click()
  • cy.waitForAPIorTimeout('api-name'): Waits for a specific Gatsby API to finish. It timeouts if it doesn't finish. Example:

    cy.waitForAPIorTimeout(`onRouteUpdate`)

Running Cypress tests in Gatsby

Read the End-to-End Testing documentation to learn how to use Cypress and Gatsby together.

3.13.1

3 months ago

3.14.0-next.2

3 months ago

3.14.0-next.1

4 months ago

3.13.0

5 months ago

3.14.0-next.0

5 months ago

3.12.0

9 months ago

3.13.0-next.0

10 months ago

3.10.0

12 months ago

3.11.0-next.1

11 months ago

3.11.0-next.0

12 months ago

3.11.0

11 months ago

3.12.0-next.0

11 months ago

3.10.0-next.1

1 year ago

3.10.0-next.0

1 year ago

3.10.0-next.2

1 year ago

3.9.0

1 year ago

3.8.0-next.0

1 year ago

3.8.0

1 year ago

3.7.0

1 year ago

3.9.0-next.0

1 year ago

3.7.0-next.0

1 year ago

3.6.0-next.0

1 year ago

3.6.0

1 year ago

3.5.0

1 year ago

3.4.0

1 year ago

3.1.0-next.0

1 year ago

3.2.0

1 year ago

3.4.0-next.1

1 year ago

3.4.0-next.0

1 year ago

3.1.0

1 year ago

3.0.0-next.2

2 years ago

3.0.0-next.1

2 years ago

3.0.0-next.0

2 years ago

3.0.0

1 year ago

3.5.0-next.0

1 year ago

3.2.0-next.0

1 year ago

1.15.0

1 year ago

3.3.0-next.0

1 year ago

2.25.0

1 year ago

3.3.0

1 year ago

2.22.0

2 years ago

2.24.0-next.0

2 years ago

2.23.0-next.0

2 years ago

2.24.0

2 years ago

2.25.0-next.0

2 years ago

2.23.0

2 years ago

2.21.0-next.0

2 years ago

2.19.0

2 years ago

2.15.0

2 years ago

2.17.0-next.0

2 years ago

2.22.0-next.0

2 years ago

2.18.0

2 years ago

2.21.0

2 years ago

2.18.0-next.0

2 years ago

2.18.0-next.1

2 years ago

2.19.0-next.1

2 years ago

2.19.0-next.0

2 years ago

2.16.0-next.0

2 years ago

2.17.0

2 years ago

2.20.0

2 years ago

2.20.0-next.0

2 years ago

2.16.0

2 years ago

2.15.0-next.0

2 years ago

2.14.0

2 years ago

2.13.0

2 years ago

2.14.0-next.1

2 years ago

2.14.0-next.2

2 years ago

2.14.0-next.0

2 years ago

2.11.0

2 years ago

2.12.0-next.0

2 years ago

2.10.0

2 years ago

2.13.0-next.0

2 years ago

2.11.0-next.0

2 years ago

2.12.0

2 years ago

2.12.1

2 years ago

2.10.0-next.0

2 years ago

2.10.0-next.1

2 years ago

2.9.0

2 years ago

2.4.0

2 years ago

2.8.0

2 years ago

2.6.0-next.0

2 years ago

2.4.0-next.0

2 years ago

2.3.0

2 years ago

2.7.0

2 years ago

2.5.0-next.0

2 years ago

2.6.0

2 years ago

2.7.0-next.0

2 years ago

2.8.0-next.0

2 years ago

2.5.0

2 years ago

2.9.0-next.0

2 years ago

2.2.0

2 years ago

2.3.0-next.0

2 years ago

2.2.0-next.0

3 years ago

2.1.0

3 years ago

2.0.0

3 years ago

2.1.0-next.0

3 years ago

2.0.0-zz-next.2

3 years ago

1.14.0

3 years ago

2.0.0-zz-next.1

3 years ago

2.0.0-zz-next.8

3 years ago

2.0.0-next.0

3 years ago

2.0.0-next.1

3 years ago

1.14.0-next.2

3 years ago

1.14.0-next.1

3 years ago

1.13.0

3 years ago

1.14.0-next.0

3 years ago

1.12.0

3 years ago

1.13.0-next.0

3 years ago

1.12.0-next.3

3 years ago

1.12.0-next.1

3 years ago

1.12.0-next.2

3 years ago

1.11.0

3 years ago

1.12.0-next.0

3 years ago

1.10.0

3 years ago

1.11.0-next.0

3 years ago

1.10.0-next.1

3 years ago

1.9.0

3 years ago

1.10.0-next.0

3 years ago

1.8.0

3 years ago

1.9.0-next.0

3 years ago

1.6.0

3 years ago

1.7.0-next.1

3 years ago

1.7.1

3 years ago

1.7.0

3 years ago

1.7.0-next.2

3 years ago

1.8.0-next.0

3 years ago

1.8.0-next.1

3 years ago

1.4.0

3 years ago

1.5.0-next.0

3 years ago

1.6.0-next.0

3 years ago

1.7.0-next.0

3 years ago

1.5.0

3 years ago

1.3.0

3 years ago

1.4.0-next.0

3 years ago

1.3.0-next.1

3 years ago

1.2.0

3 years ago

1.3.0-next.0

3 years ago

1.1.0

3 years ago

1.2.0-next.0

3 years ago

1.1.0-next.2

3 years ago

1.0.0

3 years ago

1.0.0-v3rc.0

3 years ago

1.1.0-next.1

3 years ago

1.1.0-next.0

3 years ago

1.0.0-next.0

3 years ago

0.11.0

3 years ago

0.12.0-next.0

3 years ago

0.10.0

3 years ago

0.11.0-next.0

3 years ago

0.9.0

3 years ago

0.10.0-next.0

3 years ago

0.8.0

3 years ago

0.9.0-next.0

3 years ago

0.7.0

3 years ago

0.8.0-next.0

3 years ago

0.6.0

3 years ago

0.7.0-next.0

3 years ago

0.5.0

3 years ago

0.5.0-next.1

3 years ago

0.6.0-next.0

3 years ago

0.5.0-next.0

4 years ago

0.4.12

4 years ago

0.4.11

4 years ago

0.4.10

4 years ago

0.4.9

4 years ago

0.4.8

4 years ago

0.4.6

4 years ago

0.4.5

4 years ago

0.4.4

4 years ago

0.4.3

4 years ago

0.4.2

4 years ago

0.4.1

4 years ago

0.4.0

4 years ago

0.3.4

4 years ago

0.3.3

4 years ago

0.3.2

4 years ago

0.3.1

4 years ago

0.3.0

4 years ago

0.2.24

4 years ago

0.2.23

4 years ago

0.2.22

4 years ago

0.2.21

4 years ago

0.2.20

4 years ago

0.2.19

4 years ago

0.2.17

4 years ago

0.2.16

4 years ago

0.2.15

4 years ago

0.2.14

5 years ago

0.2.13

5 years ago

0.2.12

5 years ago

0.2.11

5 years ago

0.2.9

5 years ago

0.2.8

5 years ago

0.2.7

5 years ago

0.2.6

5 years ago

0.2.5

5 years ago

0.2.4

5 years ago

0.2.3

5 years ago

0.2.2

5 years ago

0.2.1

5 years ago

0.2.0

5 years ago

0.1.9

5 years ago

0.1.8

5 years ago

0.1.7

5 years ago

0.1.6

5 years ago

0.1.5

5 years ago

0.1.4

5 years ago