Only run css selector identifier tests to run on desktop

This commit is contained in:
Gabe Kangas
2022-12-12 00:22:31 -08:00
parent 14e4ca9c28
commit 014cc756bc
4 changed files with 64 additions and 32 deletions

View File

@@ -0,0 +1,24 @@
/// <reference types="Cypress" />
/**
* Filter Cypress tests based on a given tag or tags. If no tags are present, run tests.
*
* @param {[string]} definedTags An array of tags
* @param {Function} runTest All tests captured within a Cypress run
* @example npm run open --env tags=api
* @example npm run open --env tags=api/ui
*/
const filterTests = (definedTags, runTest) => {
if (Cypress.env('tags')) {
const tags = Cypress.env('tags').split('/');
const found = definedTags.some(($definedTag) => tags.includes($definedTag));
if (found) {
runTest();
}
} else {
// runTest();
}
};
export default filterTests;