|
| 1 | +import { defineComponentFramework } from 'cypress'; |
| 2 | + |
| 3 | +const qwik: Cypress.CypressComponentDependency = { |
| 4 | + type: 'cypress-ct-qwik', |
| 5 | + name: 'Qwik', |
| 6 | + package: '@builder.io/qwik', |
| 7 | + installer: '@builder.io/qwik', |
| 8 | + description: 'The HTML-first framework', |
| 9 | + minVersion: '^0.19.2', |
| 10 | +}; |
| 11 | + |
| 12 | +const qwikCity: Cypress.CypressComponentDependency = { |
| 13 | + type: 'cypress-ct-qwik', |
| 14 | + name: 'Qwik City', |
| 15 | + package: '@builder.io/qwik-city', |
| 16 | + installer: '@builder.io/qwik-city', |
| 17 | + description: 'The meta-framework for Qwik', |
| 18 | + minVersion: '^0.4.0', |
| 19 | +}; |
| 20 | + |
| 21 | +export default defineComponentFramework({ |
| 22 | + /** |
| 23 | + * This should match the `npm` package name. |
| 24 | + * The convention required to ensure your Definition is processed |
| 25 | + * by Cypress is `cypress-ct-*` for global packages, or |
| 26 | + * `@org/cypress-ct-*` for organization level packages. |
| 27 | + */ |
| 28 | + type: 'cypress-ct-qwik', |
| 29 | + |
| 30 | + /** |
| 31 | + * The label that shows up when configuring Component Testing |
| 32 | + * for the first time. |
| 33 | + */ |
| 34 | + name: 'Qwik', |
| 35 | + |
| 36 | + /** |
| 37 | + * Supported bundlers. Can be "webpack" and/or "vite". |
| 38 | + */ |
| 39 | + supportedBundlers: ['vite'], |
| 40 | + |
| 41 | + /** |
| 42 | + * Used by Cypress to automatically detect the correct Framework Definition |
| 43 | + * based on the user's project. |
| 44 | + * In this example, if a module matching `solidDep` |
| 45 | + * is found in the user's project, |
| 46 | + * Solid.js will automatically be selected when configuring Component Testing. |
| 47 | + */ |
| 48 | + detectors: [qwik], |
| 49 | + |
| 50 | + /** |
| 51 | + * Optionally, some conditional logic, based on whether |
| 52 | + * the user selected Vite or webpack. |
| 53 | + */ |
| 54 | + dependencies: (bundler) => { |
| 55 | + return [qwik, qwikCity]; |
| 56 | + }, |
| 57 | +}); |
0 commit comments