File tree 1 file changed +51
-0
lines changed
examples/javascript/test/browser
1 file changed +51
-0
lines changed Original file line number Diff line number Diff line change
1
+ const { Browser} = require ( 'selenium-webdriver' ) ;
2
+ const { suite} = require ( 'selenium-webdriver/testing' ) ;
3
+ const edge = require ( 'selenium-webdriver/edge' ) ;
4
+ const options = new edge . Options ( ) ;
5
+
6
+ suite ( function ( env ) {
7
+ describe ( 'Should be able to Test Command line arguments' , function ( ) {
8
+ it ( 'headless' , async function ( ) {
9
+ let driver = await env
10
+ . builder ( )
11
+ . setEdgeOptions ( options . addArguments ( '--headless=new' ) )
12
+ . build ( ) ;
13
+
14
+ await driver . get ( 'https://www.google.com' ) ;
15
+ await driver . quit ( ) ;
16
+ } ) ;
17
+
18
+ it ( 'exclude switches' , async function ( ) {
19
+ let driver = await env
20
+ . builder ( )
21
+ . setEdgeOptions ( options . excludeSwitches ( 'enable-automation' ) )
22
+ . build ( ) ;
23
+
24
+ await driver . get ( 'https://www.google.com' ) ;
25
+ await driver . quit ( ) ;
26
+ } ) ;
27
+
28
+ it ( 'Keep browser open - set detach to true ' , async function ( ) {
29
+ let driver = await env
30
+ . builder ( )
31
+ . setEdgeOptions ( options . detachDriver ( true ) )
32
+ . build ( ) ;
33
+
34
+ await driver . get ( 'https://www.google.com' ) ;
35
+
36
+ // As tests runs in ci, quitting the driver instance to avoid any failures
37
+ await driver . quit ( ) ;
38
+ } ) ;
39
+
40
+ it ( 'Basic edge test' , async function ( ) {
41
+ const Options = new edge . Options ( ) ;
42
+ let driver = await env
43
+ . builder ( )
44
+ . setEdgeOptions ( Options )
45
+ . build ( ) ;
46
+
47
+ await driver . get ( 'https://www.google.com' ) ;
48
+ await driver . quit ( ) ;
49
+ } ) ;
50
+ } ) ;
51
+ } , { browsers : [ Browser . EDGE ] } ) ;
You can’t perform that action at this time.
0 commit comments