Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to extract case id when tags as defined as an enum and passed as an array inside it() #92

Open
parul1220 opened this issue May 10, 2023 · 0 comments

Comments

@parul1220
Copy link

In our project we define tags as enum to avoid duplicity
e.g.
export enum Feature { sanity = 'sanity', homePage='homePage' }

Way defining tags inside it():

it(
     'C506 Sanity check for last seen lane',

     {tags: [Feature.sanity, Feature.homePage]},
     () => {
              // your test
    });

When running below command to extract case id and create testrun with those case id , getting following error

command
npx testrail-start-run \ --spec "path to spec file" \ "Automation run" \ "Running priority test"

Error :
ReferenceError: Feature is not defined
at eval (eval at getTags (/node_modules/find-test-names/src/index.js:55:16), :1:8)
at getTags (/node_modules/find-test-names/src/index.js:55:16)

On investigating observe that eval function at line 55 fails to extract tags in method getTags()
Changing the eval function with square bracket fixes the issues.
return eval[tagsText]

This is blocking us from creating test run which only includes test which are automated. would be great if we can add support for such cases.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant