IntelliJ Idea + cucumber run configuration: how to exclude @tags
Asked Answered
C

6

5

Good news everyone.

I don't know how to exclude several tags within my run configuration for Cucumber project.

For instance, i have three tests.

@debug
Scenario outline: foo 1
When step
Then step

@obsolete
Scenario outline: foo 2
When step
Then step

@stable
Scenario outline: foo 3
When step
Then step

I put ~@debug,~@obsolete to the textbox called «Tags Filter» of the «Run configuration» dialog window.

But there's something wrong because when I start my tests — foo 1, foo 2 and foo 3 are starting anyways.

Cooperate answered 18/11, 2011 at 7:8 Comment(0)
M
1

I don't know about IntelliJ, but on a terminal you would run:

cucumber --tags ~@debug --tags ~@obsolete
Mazzola answered 16/7, 2012 at 13:17 Comment(1)
Well, that's known practice. But you can't pass --parameters in config dialog of IntelliJ Idea, only tag names. Tank you for your interest :)Cooperate
T
9

I have found the answer to this question within a comment to another stackoverflow question: https://stackoverflow.com/a/23743258.

Basically to add several tags to IntelliJ you need to add -Dcucumber.options="--tags ~@debug --tags ~@obsolete" to the VM options in the default cucumber settings.

Truax answered 28/4, 2015 at 16:11 Comment(0)
E
6

For IntelliJ: Add below to the VM options by editing configuration

-Dcucumber.options="--tags @debug"
Emileemilee answered 10/11, 2015 at 15:24 Comment(1)
Unfortunately, it didn't work with IDEA for with complex tag like "not @ignore". The idea just ignored it.Jochbed
A
4

Specyfing --tags <your_tag_name> as Program arguments in the Cucumber run cofiguration resolved the issue in my case.

Anthracosis answered 4/2, 2019 at 10:11 Comment(1)
That is exact answer to IDEA usage. I have indicated --tags "not @ignore" as "Program arguments" and it run. Thank you.Jochbed
M
1

I don't know about IntelliJ, but on a terminal you would run:

cucumber --tags ~@debug --tags ~@obsolete
Mazzola answered 16/7, 2012 at 13:17 Comment(1)
Well, that's known practice. But you can't pass --parameters in config dialog of IntelliJ Idea, only tag names. Tank you for your interest :)Cooperate
C
1

Hence @CucumberOptions is obsolete with JUnit5 you have to use

@ExcludeTags({ "debug", "obsolete" })

instead.

Couscous answered 17/1, 2023 at 7:57 Comment(0)
T
0

Add tags in cucumber options

@CucumberOptions(plugin = {"pretty"}, tags = {"@Runme"}, features = "src/test/resources/urpath", glue = "your.path")
Typhoid answered 14/2, 2019 at 7:7 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.