cypress-tags icon indicating copy to clipboard operation
cypress-tags copied to clipboard

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

Open jgonzalezalbisu opened this issue 1 year ago • 0 comments

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).

jgonzalezalbisu avatar Mar 23 '23 12:03 jgonzalezalbisu