infosum / cypress-tags

Use custom tags to slice up Cypress test runs
84 stars 21 forks source link

How to run cypress-tags when already using another file:preprocessor #159

Closed zimmicz closed 2 years ago

zimmicz commented 2 years ago

I have a plugins/index.ts file that already uses webpackPreprocessor:

import webpackPreprocessor from '@cypress/webpack-preprocessor';
const tagify = require('cypress-tags');

module.exports = async (on, config) => {
  const { optimization, ...webpackOptions } = webpackConfig;

  on('file:preprocessor', webpackPreprocessor({ webpackOptions }));
};

How do I enable cypress-tags preprocessing as well? When I put it above the webpackPreprocessor line, it does not seem to do anything. When I put it on a line below, I get a bunch of errors like this one:

Error: Can't walk dependency graph: Cannot find module 'cypress/support/utils/getTranslation' from '/cypress/support/e2eSameRoot/signIn.ts'
    required by /home/zimmi/work/cypress/support/e2eSameRoot/signIn.ts
    at /home/zimmi/work/node_modules/resolve/lib/async.js:137:35                           
    at processDirs (/home/zimmi/work/node_modules/resolve/lib/async.js:290:39)             
    at isdir (/home/zimmi/work/node_modules/resolve/lib/async.js:297:32)                   
    at /home/zimmi/work/node_modules/resolve/lib/async.js:25:69                            
    at callback (/home/zimmi/.cache/Cypress/9.4.1/Cypress/resources/app/node_modules/graceful-fs/polyfills.js:299:20)
    at FSReqCallback.oncomplete (fs.js:192:21)  

Is it possible to use cypress-tags alongisde other preprocessors?

annaet commented 2 years ago

Unfortunately from the look of this issue it is not currently possible to use multiple file preprocessors.

I would recommend adding your use case to the thread there.

stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.