Tags: Tohaker/cypress-skip-test
Tags
feat: add skipOn and onlyOn with headed or headless mode (cypress-io#39) * add skipOn headed or headless * add onlyOn and tests
feat: add environment variable support (cypress-io#12) ```js // run tests with // CYPRESS_ENVIRONMENT=staging npx cypress run import {onlyOn} from '@cypress/skip-test' const stubServer = () => { cy.server() cy.route('/api/me', 'fx:me.json') cy.route('/api/permissions', 'fx:permissions.json') // Lots of fixtures ... } it('works', () => { onlyOn('staging', stubServer) ... }) ``` * chore: add prettier * add .vscode settings * feat: add ENVIRONMENT support
feat: add `isOn` function You can check the condition against a browser name or an environment yourself. ```js import {isOn} from '@cypress/skip-test' it('loads users', () => { // when running on Windows locally, the backend is not running // thus we need to stub XHR requests if (isOn('windows') && isOn('localhost')) { cy.server() cy.route('/users', 'fixture:users') } cy.visit('/') cy.get('.user').should('have.length', 10) }) ```
feat: split functions from support file BREAKING CHANGE: if you want to use custom commands, you need to explicitly require the support file like this. ```js require('@cypress/skip-test/support') ``` This way you can import individual functions without adding them as custom commands.
PreviousNext