{"id":13046,"library":"cypress-skip-and-only-ui","title":"Cypress Skip and Only UI Plugin","description":"cypress-skip-and-only-ui is a Cypress plugin that enhances the Cypress Test Runner UI by adding client-side buttons to `it` and `describe` blocks. These buttons allow developers to dynamically mark individual tests or test suites to run in isolation (`.only`) or to be skipped (`.skip`) directly from the browser interface, without modifying the test code. This provides a convenient way to focus on specific tests during development or debugging sessions. The package is currently stable at version 1.2.19, with releases occurring irregularly, primarily addressing compatibility with newer Cypress versions and updating internal dependencies like React. Its key differentiator is the direct UI integration for test isolation, offering an alternative to manually adding or removing `.only`/`.skip` modifiers in test files, which can be prone to accidental commits.","status":"active","version":"1.2.19","language":"javascript","source_language":"en","source_url":"https://github.com/bahmutov/cypress-skip-and-only-ui","tags":["javascript","cypress","cypress-io","cypress-plugin","typescript"],"install":[{"cmd":"npm install cypress-skip-and-only-ui","lang":"bash","label":"npm"},{"cmd":"yarn add cypress-skip-and-only-ui","lang":"bash","label":"yarn"},{"cmd":"pnpm add cypress-skip-and-only-ui","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"This package is a Cypress plugin and requires a compatible Cypress installation to function.","package":"cypress","optional":false}],"imports":[{"note":"This import activates the client-side UI and must be placed in your Cypress support file (e.g., `cypress/support/e2e.js` or `cypress/support/component.js`). Use ESM `import` syntax.","wrong":"require('cypress-skip-and-only-ui/support');","symbol":"support file","correct":"import 'cypress-skip-and-only-ui/support';"},{"note":"This is a named import for the Node.js tasks required by the plugin, used in `cypress.config.js|ts`. Modern Cypress configurations prefer ESM import style.","wrong":"const skipAndOnlyUiTasks = require('cypress-skip-and-only-ui/task');","symbol":"skipAndOnlyUiTasks","correct":"import skipAndOnlyUiTasks from 'cypress-skip-and-only-ui/task';"},{"note":"This is a standard Cypress configuration import. While not directly from this package, it's essential for proper plugin setup in `cypress.config.js|ts`.","wrong":"const { defineConfig } = require('cypress');","symbol":"defineConfig","correct":"import { defineConfig } from 'cypress';"}],"quickstart":{"code":"import { defineConfig } from 'cypress'\nimport skipAndOnlyUiTasks from 'cypress-skip-and-only-ui/task';\n\n// In cypress/support/e2e.js or cypress/support/component.js\nimport 'cypress-skip-and-only-ui/support';\n\nexport default defineConfig({\n  e2e: {\n    setupNodeEvents(on, config) {\n      // Ensure you merge with any other existing tasks\n      on('task', skipAndOnlyUiTasks)\n      // or if you have other tasks:\n      // on('task', {\n      //   ...otherTasks,\n      //   ...skipAndOnlyUiTasks\n      // })\n    }\n  },\n  // You might also need to configure for component testing\n  component: {\n    setupNodeEvents(on, config) {\n      on('task', skipAndOnlyUiTasks)\n    }\n  }\n});","lang":"typescript","description":"This quickstart demonstrates how to install and configure `cypress-skip-and-only-ui` by adding the support file import and registering the necessary Node.js tasks within your `cypress.config.ts` or `cypress.config.js`."},"warnings":[{"fix":"Ensure your `cypress-skip-and-only-ui` version is compatible with your installed Cypress version. Update `cypress-skip-and-only-ui` to the latest version if experiencing issues after a Cypress upgrade.","message":"The plugin's functionality depends on compatibility with the Cypress API. Upgrades to Cypress may require corresponding updates to this plugin. Always check the changelog for specific Cypress version support.","severity":"breaking","affected_versions":">=1.0.0"},{"fix":"Verify that both the support file import is present in your `cypress/support` file and the tasks are registered in your `cypress.config.js|ts`.","message":"The plugin requires both a client-side support file import (`import 'cypress-skip-and-only-ui/support';`) and a Node.js task registration (`on('task', skipAndOnlyUiTasks)`) to function correctly. Omitting either will result in incomplete functionality or errors.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Carefully review your `setupNodeEvents` function to confirm that `skipAndOnlyUiTasks` are merged without conflicts with any other task definitions.","message":"When merging tasks in `cypress.config.js|ts`, ensure you use the object spread syntax correctly (`on('task', { ...existingTasks, ...skipAndOnlyUiTasks })`) to avoid overwriting other essential tasks.","severity":"gotcha","affected_versions":">=1.0.0"}],"env_vars":null,"last_verified":"2026-04-19T00:00:00.000Z","next_check":"2026-07-18T00:00:00.000Z","problems":[{"fix":"Add `on('task', skipAndOnlyUiTasks)` to your `setupNodeEvents` function in `cypress.config.js|ts`.","cause":"The Node.js tasks for the plugin have not been registered in `cypress.config.js|ts`.","error":"CypressError: `cy.task()` received a task that does not exist: 'skip-test-by-id'"},{"fix":"Run `npm install -D cypress-skip-and-only-ui` (or `yarn add -D cypress-skip-and-only-ui`). Verify the import path `import 'cypress-skip-and-only-ui/support';` is exactly as specified.","cause":"The package is not installed, or the import path in your support file is incorrect.","error":"Error: Cannot find module 'cypress-skip-and-only-ui/support'"},{"fix":"Ensure your `cypress.config.js|ts` file uses `export default defineConfig({ e2e: { setupNodeEvents(on, config) { ... } } });` structure and that `on` is passed to your task registration correctly.","cause":"This error typically indicates that `setupNodeEvents` is not correctly receiving the `on` argument in `cypress.config.js|ts`, or the config file structure is incorrect.","error":"TypeError: on is not a function"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":""}