All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.jbehave.web.selenium.SauceLabsContextView Maven / Gradle / Ivy

The newest version!
package org.jbehave.web.selenium;


import org.openqa.selenium.JavascriptExecutor;

public class SauceLabsContextView implements ContextView {

    private WebDriverProvider webDriverProvider;

    public SauceLabsContextView(WebDriverProvider webDriverProvider) {
        this.webDriverProvider = webDriverProvider;
    }

    public void show(String scenario, String step) {
        sendContextMessage(step);
    }

    private void sendContextMessage(String step) {
        try {
            JavascriptExecutor je = (JavascriptExecutor) webDriverProvider.get();
            je.executeScript("sauce:context=Step: " + step);
        } catch (Exception e) {
        }
    }

    public void close() {
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy