raidenberus
raidenberus

Reputation: 13

Why error here with cucumber runner mutiple tags

enter image description here

Error is "Type mismatch: cannot convert from String[] to String".

But this is the guide in cucumber webpage:

package com.example;

import io.cucumber.junit.Cucumber;
import io.cucumber.junit.CucumberOptions;
import org.junit.runner.RunWith;

@RunWith(Cucumber.class)
@CucumberOptions(tags = {"@foo", "not @bar"})
public class RunCucumberTest {
}

Upvotes: 1

Views: 1044

Answers (1)

M.P. Korstanje
M.P. Korstanje

Reputation: 12029

Cucumber used to have some really complex semantics for combining tags. You could either write:

tags = { "@gherkin", "@pickle", "@zuchini" }

Or:

tags = { "@gherkin, @pickle, @zuchini" }

And even:

tags = { "@gherkin", "@pickle, @zuchini" }

And they'd all mean different things. This made it quite difficult to explain and understand what scenarios would be selected.

By using a single tag expression string that can be done more clearly. So you drop the curly braces and write:

tags = "(@gherkin or @pickle) and not @zuchini"

Upvotes: 1

Related Questions