1 |
|
2 | import { expectType, expectError, expectAssignable } from 'tsd';
|
3 | import Nightwatch, { NightwatchAPI, NightwatchClient, NightwatchProgrammaticAPIClient } from '..';
|
4 |
|
5 | const client = Nightwatch.createClient({
|
6 | browserName: 'firefox',
|
7 | headless: true,
|
8 | });
|
9 | Nightwatch.createClient();
|
10 | Nightwatch.createClient({});
|
11 |
|
12 | expectType<NightwatchProgrammaticAPIClient>(client);
|
13 |
|
14 |
|
15 | new Nightwatch.by('css selector', 'hello');
|
16 | new Nightwatch.Capabilities();
|
17 | expectType<NightwatchAPI>(Nightwatch.browser);
|
18 | expectType<NightwatchAPI>(Nightwatch.app);
|
19 | expectAssignable<string>(Nightwatch.Key.NULL);
|
20 | expectError(Nightwatch.launchBrowser());
|
21 |
|
22 | Nightwatch.updateCapabilities({});
|
23 |
|
24 |
|
25 | const initClient = Nightwatch.initClient();
|
26 | expectType<typeof Nightwatch>(initClient);
|
27 |
|
28 |
|
29 | client.updateCapabilities({
|
30 | testCapability: 'one, two, three',
|
31 | });
|
32 | client.updateCapabilities(function() { return {}; });
|
33 |
|
34 | async () => {
|
35 | const browser = await client.launchBrowser();
|
36 | expectType<NightwatchAPI>(browser);
|
37 |
|
38 | expectType<NightwatchClient>(client.nightwatch_client);
|
39 | };
|