broad-ram-1055
03/02/2023, 8:07 AMdescribe() have tags
- I'm using cypress/grep plugin to enable to tagging mechanism
- Config is correct and can run cases linked with specific tags
Concern
- This plugin parses though all the spec files at runtime to find the tags and consumes execution time.
Solution
- This plugin has a filtering mechanism using grepFilterSpecs parameter so it'll only run those spec files where the tag will match and not all the spec files
Issue
- I have done all the config required for this and still it runs all the spec file instead of just couple of them where the tag exist.
- Can see message on console as Could not determine test names in file: ${filePath}
Versions
- "@cypress/grep": "^3.1.4",
- "cypress": "^10.11.0",
Adding Code reference in the threadbroad-ram-1055
03/02/2023, 8:07 AM@ui tag out of 50 files.
I'm running my scripts using command "test:ui": "npx cypress run --env grepTags=@ui"
Under cypress/support/e2e.js I have added
javascript
const registerCypressGrep = require('@cypress/grep');
registerCypressGrep();
my cypress.config.js looks like
javascript
/* eslint-disable @typescript-eslint/no-var-requires */
const { defineConfig } = require('cypress');
const allureWriter = require('@shelex/cypress-allure-plugin/writer');
module.exports = defineConfig({
e2e: {
//specPattern: 'cypress/e2e/**', added for experimentation based on similar issue, didn't help
watchForFileChanges: false,
viewportWidth: 1280,
viewportHeight: 960,
video: false,
env: {
grepFilterSpecs: true,
grepOmitFiltered: true
},
setupNodeEvents(on, config) {
require('@cypress/grep/src/plugin')(config);
allureWriter(on, config);
return config;
}
}
});
Not sure if anything is missing here.. Please let me know if you have encountered and fixed similar problembroad-ram-1055
03/02/2023, 8:07 AMjavascript
describe('Registering new user', { tags: [TestLayer.UI] }, () => {
it('SignUp with ABC account', { tags: ['@tmsID', TestSeverity.BLOCKER] }, () => {
// test steps
});
});