Tell me how I can pass the SafariOptions
in Gauge.
Hello Dipen,
You can pass the SafariOptions
in Gauge. Here is the sample code:
import org.openqa.selenium.safari.SafariOptions;
public class SafariSetupLibrary
extends AbstractMutableCapabilitiesLibrary<SafariOptions> {
public SafariSetupLibrary(BrowserRegistry manager) {
super(manager, new SafariOptions());
}
@Keyword("Set automatic inspection")
public SafariSetupLibrary setAutomaticInspection(boolean flag) {
getOptions().setAutomaticInspection(flag);
return this;
}
@Keyword("Set automatic profiling")
public SafariSetupLibrary setAutomaticProfiling(boolean flag) {
getOptions().setAutomaticProfiling(flag);
return this;
}
@Keyword("Set use technology preview")
public SafariSetupLibrary setUseTechnologyPreview(boolean flag) {
getOptions().setUseTechnologyPreview(flag);
return this;
}
@Keyword("Start safari")
@PassInvoker
@Parameters(min = 1)
public void start(Invoker invoker, String browserName, String initialTabName) {
getManager().setupChecker().edgeDriverSetup();
startBrowser(invoker, createBrowser(new SafariDriver(getOptions()), browserName, initialTabName));
}
}