1 | "use strict";
|
2 | Object.defineProperty(exports, "__esModule", { value: true });
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 | const q = require("q");
|
9 | const selenium_webdriver_1 = require("selenium-webdriver");
|
10 | const logger_1 = require("../logger");
|
11 | const driverProvider_1 = require("./driverProvider");
|
12 | const http = require('selenium-webdriver/http');
|
13 | let logger = new logger_1.Logger('attachSession');
|
14 | class AttachSession extends driverProvider_1.DriverProvider {
|
15 | constructor(config) {
|
16 | super(config);
|
17 | }
|
18 | |
19 |
|
20 |
|
21 |
|
22 |
|
23 | setupDriverEnv() {
|
24 | logger.info('Using the selenium server at ' + this.config_.seleniumAddress);
|
25 | logger.info('Using session id - ' + this.config_.seleniumSessionId);
|
26 | return q(undefined);
|
27 | }
|
28 | |
29 |
|
30 |
|
31 |
|
32 |
|
33 |
|
34 | getNewDriver() {
|
35 | const httpClient = new http.HttpClient(this.config_.seleniumAddress);
|
36 | const executor = new http.Executor(httpClient);
|
37 | const newDriver = selenium_webdriver_1.WebDriver.attachToSession(executor, this.config_.seleniumSessionId);
|
38 | this.drivers_.push(newDriver);
|
39 | return newDriver;
|
40 | }
|
41 | |
42 |
|
43 |
|
44 |
|
45 |
|
46 | quitDriver() {
|
47 | return selenium_webdriver_1.promise.when(undefined);
|
48 | }
|
49 | }
|
50 | exports.AttachSession = AttachSession;
|
51 |
|
\ | No newline at end of file |