You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently you can change the configuration within tests mainly be setting Cypress.config(). This will change the configuration for the duration of the entirety of tests. Sometimes you just want configuration set for the current block of test/suite.
Furthermore, in order to filter certain tests/suites by the browser we're running in, we have to use Cypress.isBrowser() to do kinda of strange filters like below:
construnOn=(browser,fn)=>{if(Cypress.isBrowser(browser)){fn()}}constignoreOn=(browser,fn)=>{if(!Cypress.isBrowser(browser)){fn()}}// Run happy path tests if Cypress is run via FirefoxrunOn('firefox',()=>{describe('happy path suite',()=>{it('...')it('...')it('...')})})
Desired behavior:
users can add test configuration in object during test/suite declaration:
it('can test with config',{defaultCommandTimeout: 200},()=>{// test body})
run test only in certain browsers:
it('only runs in ff',{browser: 'firefox'},()=>{})
api for excluding browsers:
it('does not run in ff',{browser: '!firefox'},()=>{})
can apply same options for the whole suite:
describe('suite with config',{defaultCommandTimeout: 40},()=>{// all tests declared here will inherit the config})
Versions
4.5.0
The text was updated successfully, but these errors were encountered:
The code for this is done in cypress-io/cypress#5346, but has yet to be released.
We'll update this issue and reference the changelog when it's released.
Current behavior:
Currently you can change the configuration within tests mainly be setting
Cypress.config()
. This will change the configuration for the duration of the entirety of tests. Sometimes you just want configuration set for the current block of test/suite.Furthermore, in order to filter certain tests/suites by the browser we're running in, we have to use
Cypress.isBrowser()
to do kinda of strange filters like below:Desired behavior:
Versions
4.5.0
The text was updated successfully, but these errors were encountered: