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 driverProvider_1 = require("./driverProvider");
|
11 | class MockExecutor {
|
12 | execute(command) { }
|
13 | }
|
14 | exports.MockExecutor = MockExecutor;
|
15 | class Mock extends driverProvider_1.DriverProvider {
|
16 | constructor(config) {
|
17 | super(config);
|
18 | }
|
19 | |
20 |
|
21 |
|
22 | execute() {
|
23 | let deferred = q.defer();
|
24 | deferred.resolve({ value: 'test_response' });
|
25 | return deferred.promise;
|
26 | }
|
27 | |
28 |
|
29 |
|
30 |
|
31 |
|
32 | setupDriverEnv() {
|
33 | return q.fcall(function () { });
|
34 | }
|
35 | |
36 |
|
37 |
|
38 |
|
39 |
|
40 |
|
41 |
|
42 | getNewDriver() {
|
43 | let mockSession = new selenium_webdriver_1.Session('test_session_id', {});
|
44 | let newDriver = new selenium_webdriver_1.WebDriver(mockSession, new MockExecutor());
|
45 | this.drivers_.push(newDriver);
|
46 | return newDriver;
|
47 | }
|
48 | }
|
49 | exports.Mock = Mock;
|
50 |
|
\ | No newline at end of file |