* Creates a new Safari session. * * @param {(Options|Capabilities)=} options The configuration options. * @return {!Driver} A new driver instance.
(options)
| 129 | * @return {!Driver} A new driver instance. |
| 130 | */ |
| 131 | static createSession(options) { |
| 132 | let caps = options || new Options() |
| 133 | |
| 134 | let exe |
| 135 | if (useTechnologyPreview(caps.get(OPTIONS_CAPABILITY_KEY))) { |
| 136 | exe = SAFARIDRIVER_TECHNOLOGY_PREVIEW_EXE |
| 137 | } |
| 138 | |
| 139 | let service = new ServiceBuilder(exe).build() |
| 140 | if (!service.getExecutable()) { |
| 141 | service.setExecutable(getBinaryPaths(caps).driverPath) |
| 142 | } |
| 143 | let executor = new http.Executor(service.start().then((url) => new http.HttpClient(url))) |
| 144 | |
| 145 | return /** @type {!Driver} */ (super.createSession(executor, caps, () => service.kill())) |
| 146 | } |
| 147 | } |
| 148 | |
| 149 | // Public API |
nothing calls this directly
no test coverage detected