org.jbehave.web.selenium.SauceLabsContextView Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jbehave-web-selenium Show documentation
Show all versions of jbehave-web-selenium Show documentation
Selenium and WebDriver API bindings for JBehave
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() {
}
}