/* Copyright 2018 Telstra Open Source
 *
 *   Licensed under the Apache License, Version 2.0 (the "License");
 *   you may not use this file except in compliance with the License.
 *   You may obtain a copy of the License at
 *
 *       http://www.apache.org/licenses/LICENSE-2.0
 *
 *   Unless required by applicable law or agreed to in writing, software
 *   distributed under the License is distributed on an "AS IS" BASIS,
 *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *   See the License for the specific language governing permissions and
 *   limitations under the License.
 */

package org.openkilda.atdd.staging.steps;

import cucumber.api.java.en.And;

import java.util.concurrent.TimeUnit;

public class CommonSteps {

    @And("(?:remains? in this state|wait) for (\\d+) seconds")
    public void delay(int seconds) throws InterruptedException {
        TimeUnit.SECONDS.sleep(seconds);
    }
}

@@ -679,87 +679,906 @@
 api.
-java.en.And;%0A%0Aimport java.util.concurrent.TimeUnit;%0A%0Apublic class CommonSteps %7B
+Scenario;%0Aimport cucumber.api.java.After;%0Aimport cucumber.api.java.Before;%0Aimport cucumber.api.java.en.And;%0Aimport org.junit.Assume;%0A%0Aimport java.util.concurrent.TimeUnit;%0A%0Apublic class CommonSteps %7B%0A%0A    // If one of the scenarios fails, with a high probability something is wrong with the test environment and%0A    // there is no sense to run other scenarios because of a low percentage of their success. So this flag controls%0A    // other scenario executions after the first scenario failure.%0A    private static boolean skipScenario = false;%0A%0A    @Before%0A    public void beforeScenario() %7B%0A        if (skipScenario) %7B%0A            Assume.assumeTrue(%22The scenario is skipped due to a failure of one of the previous scenarios!%22, false);%0A        %7D%0A    %7D%0A%0A    @After%0A    public void afterScenario(Scenario scenario) %7B%0A        if (scenario.isFailed()) %7B%0A            skipScenario = true;%0A        %7D%0A    %7D
 %0A%0A  

Implement 'fail-fast' behavior for atdd-staging scenarios