This repository was archived by the owner on Sep 20, 2019. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +10
-9
lines changed
Expand file tree Collapse file tree 1 file changed +10
-9
lines changed Original file line number Diff line number Diff line change @@ -11,22 +11,23 @@ describe('Loading googlemaps-example.html', function() {
1111
1212 it ( 'should change the Google Maps tiles if clicked on the leaflet control switch layer' , function ( ) {
1313 ptor . wait ( function ( ) {
14- return ptor . isElementPresent ( by . xpath ( '//img[contains(@draggable, "false")]' ) ) ;
14+ return ptor . isElementPresent ( by . xpath ( '//img[contains(@src, "http://mt1.googleapis.com")]' ) ) . then ( function ( elementLoaded ) {
15+ return elementLoaded ;
16+ } ) ;
1517 } ) ;
1618
17- ptor . sleep ( 300 ) ;
18- var img1 = element ( by . xpath ( '//img[contains(@draggable, "false")][1]' ) ) ;
19- expect ( img1 . getAttribute ( "src" ) ) . toMatch ( "mt.\\.googleapis\\.com" ) ;
20-
19+ expect ( ptor . isElementPresent ( by . xpath ( '//img[contains(@src, "http://mt1.googleapis.com")]' ) ) ) . toBe ( true ) ;
2120 ptor . actions ( ) . mouseMove ( element ( by . xpath ( '//a[contains(@class, "leaflet-control-layers-toggle")][1]' ) ) . find ( ) ) . perform ( ) ;
2221
23- ptor . sleep ( 100 ) ;
2422 ptor . findElements ( by . css ( "input.leaflet-control-layers-selector" ) ) . then ( function ( inputs ) {
2523 var input = inputs [ 1 ] ;
2624 input . click ( ) . then ( function ( ) {
27- ptor . sleep ( 300 ) ;
28- var img1 = element ( by . xpath ( '//img[contains(@draggable, "false")][1]' ) ) ;
29- expect ( img1 . getAttribute ( "src" ) ) . toMatch ( "khm.\\.googleapis\\.com" ) ;
25+ ptor . wait ( function ( ) {
26+ return ptor . isElementPresent ( by . xpath ( '//img[contains(@src, "http://khm1.googleapis.com")]' ) ) . then ( function ( elementLoaded ) {
27+ return elementLoaded ;
28+ } ) ;
29+ } ) ;
30+ expect ( ptor . isElementPresent ( by . xpath ( '//img[contains(@src, "http://khm1.googleapis.com")]' ) ) ) . toBe ( true ) ;
3031 } ) ;
3132 } ) ;
3233 } ) ;
You can’t perform that action at this time.
0 commit comments