Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions source/api/cypress-api/isbrowser.md
Original file line number Diff line number Diff line change
Expand Up @@ -146,14 +146,14 @@ it('test', () => {
If you want to target a test or suite to run or be excluded when run in a specific browser, we suggest passing the `browser` within the {% url "test configuration" configuration#Test-Configuration %}. The `browser` option accepts the same {% urlHash "arguments" Arguments %} as `Cypress.isBrowser()`.

```js
it('Download extension in Firefox', { browser: 'firefox' } => {
it('Download extension in Firefox', { browser: 'firefox' }, () => {
cy.get('#dl-extension')
.should('contain', 'Download Firefox Extension')
})
```

```js
it('Show warning outside Chrome', { browser: '!chrome' } => {
it('Show warning outside Chrome', { browser: '!chrome' }, () => {
cy.get('.browser-warning')
.should('contain', 'For optimal viewing, use Chrome browser')
})
Expand Down
1 change: 1 addition & 0 deletions source/guides/guides/continuous-integration.md
Original file line number Diff line number Diff line change
Expand Up @@ -717,6 +717,7 @@ module.exports = (on, config) => {
})
}
```

## Xvfb

When running on Linux, Cypress needs an X11 server; otherwise it spawns its own X11 server during the test run. When running several Cypress instances in parallel, the spawning of multiple X11 servers at once can cause problems for some of them. In this case, you can separately start a single X11 server and pass the server's address to each Cypress instance using `DISPLAY` variable.
Expand Down
4 changes: 2 additions & 2 deletions source/guides/guides/cross-browser-testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ You can specify a browser to run or exclude by passing a matcher to the suite or

```js
// Run the test if Cypress is run via Firefox
it('Download extension in Firefox', { browser: 'firefox' } => {
it('Download extension in Firefox', { browser: 'firefox' }, () => {
cy.get('#dl-extension')
.should('contain', 'Download Firefox Extension')
})
Expand All @@ -206,7 +206,7 @@ describe('happy path suite', { browser: 'firefox' }, () => {

// Ignore test if Cypress is running via Chrome
// This test is not recorded to the Cypress Dashboard
it('Show warning outside Chrome', (), { browser: '!chrome' } => {
it('Show warning outside Chrome', { browser: '!chrome' }, () => {
cy.get('.browser-warning')
.should('contain', 'For optimal viewing, use Chrome browser')
})
Expand Down
8 changes: 4 additions & 4 deletions source/guides/guides/environment-variables.md
Original file line number Diff line number Diff line change
Expand Up @@ -244,20 +244,20 @@ describe('test against Spanish site', {

```js
// change environment variable for single test
it('smoke test develop api', (), {
it('smoke test develop api', {
env: {
api: 'https://dev.myapi.com'
}
} => {
}, () => {
cy.request(Cypress.env('api')).its('status').should('eq', 200)
})

// change environment variable for single test
it('smoke test staging api', (), {
it('smoke test staging api', {
env: {
api: 'https://staging.myapi.com'
}
} => {
}, () => {
cy.request(Cypress.env('api')).its('status').should('eq', 200)
})
```
Expand Down