Search in sources :

Example 1 with Before

use of io.cucumber.java.Before in project syndesis-qe by syndesisio.

the class IssueHooks method skipTestsWithOpenIssues.

/**
 * This hook skips tests that have open github and ENTESB jira issues
 * <p>
 * Only runs when {@link TestConfiguration#SKIP_TESTS_WITH_OPEN_ISSUES} property is set to true
 *
 * @param scenario scenario
 */
@Before
public void skipTestsWithOpenIssues(Scenario scenario) {
    if (TestConfiguration.skipTestsWithOpenIssues()) {
        log.info(scenario.getName());
        if (scenario.getSourceTagNames().contains("@notIgnoreOpenIssue")) {
            return;
        }
        List<SimpleIssue> issues = getAllIssues(scenario);
        for (SimpleIssue issue : issues) {
            // assumeFalse will skip the test if the argument evaluates to true, i.e. when the issue is open
            Assumptions.assumeThat(issue.getState()).isNotEqualTo(IssueState.OPEN);
        }
    }
}
Also used : SimpleIssue(io.syndesis.qe.issue.SimpleIssue) Before(io.cucumber.java.Before)

Aggregations

Before (io.cucumber.java.Before)1 SimpleIssue (io.syndesis.qe.issue.SimpleIssue)1