- 
          
- 
                Notifications
    You must be signed in to change notification settings 
- Fork 1.4k
/
Copy pathedgeSpecificCaps.spec.js
51 lines (42 loc) · 1.45 KB
/
edgeSpecificCaps.spec.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
const {Browser} = require('selenium-webdriver');
const {suite} = require('selenium-webdriver/testing');
const edge = require('selenium-webdriver/edge');
const options = new edge.Options();
suite(function (env) {
  describe('Should be able to Test Command line arguments', function () {
    it('headless', async function () {
      let driver = await env
        .builder()
        .setEdgeOptions(options.addArguments('--headless=new'))
        .build();
      await driver.get('https://www.google.com');
      await driver.quit();
    });
    it('exclude switches', async function () {
      let driver = await env
        .builder()
        .setEdgeOptions(options.excludeSwitches('enable-automation'))
        .build();
      await driver.get('https://www.google.com');
      await driver.quit();
    });
    it('Keep browser open - set detach to true ', async function () {
      let driver = await env
        .builder()
        .setEdgeOptions(options.detachDriver(true))
        .build();
      await driver.get('https://www.google.com');
      // As tests runs in ci, quitting the driver instance to avoid any failures
      await driver.quit();
    });
    it('Basic edge test', async function () {
      const Options = new edge.Options();
      let driver = await env
        .builder()
        .setEdgeOptions(Options)
        .build();
      await driver.get('https://www.google.com');
      await driver.quit();
    });
  });
}, { browsers: [Browser.EDGE]});