@@ -3,21 +3,20 @@ var assert = require('assert');
33
44describe ( 'BrowserStack Local Testing' , function ( ) {
55 it ( 'can check tunnel working' , function ( ) {
6- var searchSelector = 'android=new UiSelector().resourceId("com.example.android.basicnetworking:id/test_action")' ;
7- browser . waitForVisible ( searchSelector , 30000 ) ;
8- browser
9- . element ( searchSelector )
10- . click ( ) ;
6+ var searchSelector = $ ( 'android=new UiSelector().resourceId("com.example.android.basicnetworking:id/test_action")' ) ;
7+ searchSelector . waitForDisplayed ( { timeout : 30000 } ) ;
8+ searchSelector . click ( ) ;
119
12- var insertTextSelector = `android.widget.TextView` ;
13- browser . waitForVisible ( insertTextSelector , 30000 ) ;
10+ var insertTextSelector = $ ( `android.widget.TextView` ) ;
11+ insertTextSelector . waitForDisplayed ( { timeout : 30000 } ) ;
1412
15- var allTextElements = browser . elements ( `android.widget.TextView` ) . value ;
13+ var allTextElements = $$ ( `android.widget.TextView` ) ;
1614 browser . pause ( 10000 ) ;
1715
1816 var testElement = null ;
17+
1918 allTextElements . forEach ( function ( textElement ) {
20- var textContent = browser . elementIdText ( textElement [ 'ELEMENT' ] ) . value ;
19+ var textContent = textElement . getText ( ) ;
2120 if ( textContent . indexOf ( 'The active connection is' ) !== - 1 ) {
2221 testElement = textElement ;
2322 }
@@ -30,7 +29,7 @@ describe('BrowserStack Local Testing', function () {
3029 throw new Error ( 'Cannot find the needed TextView element from app' ) ;
3130 }
3231
33- var matchedString = browser . elementIdText ( testElement [ 'ELEMENT' ] ) . value ;
32+ var matchedString = testElement . getText ( ) ;
3433 console . log ( matchedString ) ;
3534 assert ( matchedString . indexOf ( 'The active connection is wifi' ) !== - 1 ) ;
3635 assert ( matchedString . indexOf ( 'Up and running' ) !== - 1 ) ;
0 commit comments