diff --git a/src/test/java/steps/Hooks.java b/src/test/java/steps/Hooks.java index 9b2a921..44ec824 100644 --- a/src/test/java/steps/Hooks.java +++ b/src/test/java/steps/Hooks.java @@ -11,15 +11,26 @@ import org.openqa.selenium.chrome.ChromeOptions; import java.util.concurrent.TimeUnit; +import static frameworkContext.ContextFactory.getContext; import static frameworkContext.ContextFactory.instantiateContextObject; @Slf4j public class Hooks { - @Before - public void setup(Scenario scenario) { + @Before(order = 1) + public void setupContext() { instantiateContextObject(); + } + @Before + public void setupFrameworkForAndroid(Scenario scenario) { + setup(); + getContext().setScenario(scenario); + + log.info("Start scenario: {}", scenario.getName()); + } + + public void setup() { ChromeOptions options = new ChromeOptions(); options.addArguments("--incognito"); options.addArguments("--lang=pl"); @@ -27,15 +38,13 @@ public class Hooks { Configuration.browser = "chrome"; Configuration.timeout = TimeUnit.SECONDS.toMillis(30); - ; + Configuration.pollingInterval = 500; Configuration.browserSize = "1920x1200"; Configuration.headless = false; Configuration.screenshots = true; Configuration.reportsFolder = "target/screenshots/"; - - log.info("Start scenario: {}", scenario.getName()); } @After