infosum / cypress-tags

Use custom tags to slice up Cypress test runs
83 stars 20 forks source link

When using enums to retrieve tags, the value of the enum is not used but instead, the enum constant name #255

Open jgonzalezalbisu opened 1 year ago

jgonzalezalbisu commented 1 year ago

Hi! I've come across some weird thing when using this plugin and I noticed it by mistake. Long story short, I've created an enum with some constants and string values to be used across the scripts. The code is as follows:

it([CustomTag.P0], "Test case title", () => {
 //Code here        
});

And my Enum for explaining this scenario is:

export enum CustomTag {
    P0 = "SOMETHING",
}

The following happens:

  1. If I run the following command CYPRESS_INCLUDE_TAGS=SOMETHING npx cypress run --spec 'path/to/the/specs' --browser chrome, the test will be skipped.
  2. When I run the command CYPRESS_INCLUDE_TAGS=P0 npx cypress run --spec 'path/to/the/specs' --browser chrome, the test will be executed.

Expected behavior

I would expect that the value of the constant is being taken (first command), and no the other way round (second command).