File tree 3 files changed +63
-0
lines changed
3 files changed +63
-0
lines changed Original file line number Diff line number Diff line change
1
+ BrowserStack-nightwatch
2
+ =========
3
+
4
+ Sample for using nightwatch with BrowserStack Automate.
5
+
6
+ ###Install nightwatch.js
7
+ * Starting and pre-requite: [ nightwatch] *
8
+ - ` npm install -g nightwatch `
9
+
10
+ ###Configuring the json
11
+ - Open ` settings.json `
12
+ - Add ` browserstack.user ` and ` browserstack.key ` with your BrowserStack credentials. Don't have one? Get one on BrowserStack [ dashboard]
13
+ - Add / customise more [ capabilities] to ` desiredCapabilities ` in ` settings.json `
14
+
15
+ ###Sample test
16
+ - Path: ` tests/google/googleTest.js `
17
+ - To run: ` nightwatch -t ./tests/google/googleTest.js -c ./settings.json `
18
+
19
+ [ nightwatch ] :http://nightwatchjs.org/guide
20
+ [ capabilities ] :http://www.browserstack.com/automate/capabilities
21
+ [ dashboard ] :https://www.browserstack.com/automate
Original file line number Diff line number Diff line change
1
+ {
2
+ "src_folders" : [" tests/" ],
3
+
4
+ "selenium" : {
5
+ "start_process" : false ,
6
+ "host" : " hub.browserstack.com" ,
7
+ "port" : 80
8
+ },
9
+
10
+ "test_settings" : {
11
+ "default" : {
12
+ "launch_url" : " http://hub.browserstack.com" ,
13
+ "selenium_port" : 80 ,
14
+ "selenium_host" : " hub.browserstack.com" ,
15
+ "silent" : true ,
16
+ "screenshots" : {
17
+ "enabled" : false ,
18
+ "path" : " "
19
+ },
20
+ "desiredCapabilities" : {
21
+ "browserName" : " firefox" ,
22
+ "javascriptEnabled" : true ,
23
+ "acceptSslCerts" : true ,
24
+ "browserstack.user" : " USERNAME" ,
25
+ "browserstack.key" : " KEY"
26
+ }
27
+ }
28
+ }
29
+ }
Original file line number Diff line number Diff line change
1
+ module . exports = {
2
+ "Demo test Google" : function ( browser ) {
3
+ browser
4
+ . url ( "http://www.google.com" )
5
+ . waitForElementVisible ( 'body' , 1000 )
6
+ . setValue ( 'input[type=text]' , 'nightwatch' )
7
+ . waitForElementVisible ( 'button[name=btnG]' , 1000 )
8
+ . click ( 'button[name=btnG]' )
9
+ . pause ( 1000 )
10
+ . assert . containsText ( '#main' , 'The Night Watch' )
11
+ . end ( ) ;
12
+ }
13
+ } ;
You can’t perform that action at this time.
0 commit comments