File tree Expand file tree Collapse file tree 4 files changed +41
-2
lines changed Expand file tree Collapse file tree 4 files changed +41
-2
lines changed Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ install:
1111script :
1212# - npm run test
1313 - if [ $TO_TEST == 'ALL' ];
14- then npm run saucelabs-test-standalone ;
14+ then npm run saucelabs-test-mocha ;
1515 fi
1616after_success :
1717 - npm run codecov
Original file line number Diff line number Diff line change 2222 "saucelabs-test-local" : " ./node_modules/.bin/wdio wdio.conf.local.js" ,
2323 "presaucelabs-test-standalone" : " npm run test:simple-doc" ,
2424 "saucelabs-test-standalone" : " node ./test/saucelabs/teststandalone.js" ,
25- "saucelabs-test-webdriver" : " node ./test/saucelabs/test-webdriver.js"
25+ "saucelabs-test-webdriver" : " node ./test/saucelabs/test-webdriver.js" ,
26+ "saucelabs-test-mocha" : " cross-env TS_NODE_PROJECT=test/tsconfig.json TS_NODE_DISABLE_WARNINGS=1 nyc mocha --opts test/mocha.opts"
2627 },
2728 "watch" : {
2829 "build" : {
Original file line number Diff line number Diff line change 1+ --reporter spec
2+ --ui bdd
3+ --colors
4+ --harmony
5+ --timeout 120000
6+ --compilers ts:ts-node/register
7+ test/saucelabs/mocha.spec.ts
Original file line number Diff line number Diff line change 1+ var expect = require ( 'chai' ) . expect ,
2+ test = require ( 'selenium-webdriver/testing' ) ,
3+ webdriver = require ( 'selenium-webdriver' ) ,
4+ username = process . env . SAUCE_USERNAME ,
5+ accessKey = process . env . SAUCE_ACCESS_KEY ;
6+
7+ test . describe ( 'Google Search' , function ( ) {
8+ test . it ( 'should work' , function ( ) {
9+ var driver = new webdriver . Builder ( )
10+ . withCapabilities ( {
11+ 'browserName' : 'chrome' ,
12+ 'platform' : 'Windows XP' ,
13+ 'version' : '43.0' ,
14+ 'username' : username ,
15+ 'accessKey' : accessKey
16+ } )
17+ . usingServer ( "http://" + username + ":" + accessKey + "@ondemand.saucelabs.com:80/wd/hub" )
18+ . build ( ) ;
19+ driver . get ( 'http://www.google.com' ) ;
20+
21+ var searchBox = driver . findElement ( webdriver . By . name ( 'q' ) ) ;
22+
23+ searchBox . sendKeys ( 'simple programmer' ) ;
24+
25+ searchBox . getAttribute ( 'value' ) . then ( function ( value ) {
26+ expect ( value ) . to . equal ( 'simple programmer' ) ;
27+ } ) ;
28+
29+ driver . quit ( ) ;
30+ } ) ;
31+ } ) ;
You can’t perform that action at this time.
0 commit comments