UNPKG

1.97 kBTypeScriptView Raw
1import * as webdriver from "./index";
2import * as remote from "./remote";
3
4/**
5 * Creates {@link selenium-webdriver/remote.DriverService} instances that manage
6 * a [safaridriver] server in a child process.
7 *
8 * [safaridriver]: https://developer.apple.com/library/prerelease/content/releasenotes/General/WhatsNewInSafari/Articles/Safari_10_0.html#//apple_ref/doc/uid/TP40014305-CH11-DontLinkElementID_28
9 */
10export class ServiceBuilder extends remote.DriverService.Builder {
11 /**
12 * @param {string=} opt_exe Path to the server executable to use. If omitted,
13 * the builder will attempt to locate the safaridriver on the system PATH.
14 */
15 constructor(opt_exe: string);
16}
17
18/**
19 * Configuration options specific to the {@link Driver SafariDriver}.
20 */
21export class Options extends webdriver.Capabilities {
22 /**
23 * @param {(Capabilities|Map<string, ?>|Object)=} other Another set of
24 * capabilities to initialize this instance from.
25 */
26 constructor(other?: webdriver.Capabilities | Map<string, any> | object);
27
28 /**
29 * Instruct the SafariDriver to use the Safari Technology Preview if true.
30 * Otherwise, use the release version of Safari. Defaults to using the release version of Safari.
31 *
32 * @param {boolean} useTechnologyPreview
33 * @return {!Options} A self reference.
34 */
35 setTechnologyPreview(useTechnologyPreview: boolean): Options;
36}
37
38/**
39 * A WebDriver client for Safari. This class should never be instantiated
40 * directly; instead, use the {@linkplain ./builder.Builder Builder}:
41 *
42 * var driver = new Builder()
43 * .forBrowser('safari')
44 * .build();
45 */
46export class Driver extends webdriver.WebDriver {
47 /**
48 * Creates a new Safari session.
49 *
50 * @param {(Options|Capabilities)=} options The configuration options.
51 * @return {!Driver} A new driver instance.
52 */
53 static createSession(options?: Options | webdriver.Capabilities): Driver;
54}