This repository was archived by the owner on Feb 12, 2019. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11'use strict' ;
22
33( function ( ) {
4+ function getDriver ( callback ) {
5+ var interval = window . setInterval ( function ( ) {
6+ var testCafeDriver = window [ '%testCafeDriverInstance%' ] ;
7+
8+ if ( testCafeDriver ) {
9+ window . clearInterval ( interval ) ;
10+ callback ( testCafeDriver ) ;
11+ }
12+ } , 50 ) ;
13+ }
14+
415 // NOTE: enable interaction with a page when the last test is completed
5- window . setTimeout ( function ( ) {
6- const UNLOCK_PAGE_FLAG = 'testcafe-live|driver|unlock-page-flag' ;
16+ var UNLOCK_PAGE_FLAG = 'testcafe-live|driver|unlock-page-flag' ;
717
8- // TestCafe > 0.18.5 required
9- const testCafeDriver = window [ '%testCafeDriverInstance%' ] ;
10- const testCafeCore = window [ '%testCafeCore%' ] ;
11- const hammerhead = window [ '%hammerhead%' ] ;
18+ // TestCafe > 0.18.5 required
19+ getDriver ( function ( testCafeDriver ) {
20+ var testCafeCore = window [ '%testCafeCore%' ] ;
21+ var hammerhead = window [ '%hammerhead%' ] ;
1222
1323 testCafeDriver . setCustomCommandHandlers ( 'unlock-page' , function ( ) {
1424 testCafeCore . disableRealEventsPreventing ( ) ;
1828 return hammerhead . Promise . resolve ( ) ;
1929 } ) ;
2030
21- const chain = testCafeDriver . contextStorage ? hammerhead . Promise . resolve ( ) : testCafeDriver . readyPromise ;
31+ var chain = testCafeDriver . contextStorage ? hammerhead . Promise . resolve ( ) : testCafeDriver . readyPromise ;
2232
2333 chain . then ( function ( ) {
2434 if ( testCafeDriver . contextStorage . getItem ( UNLOCK_PAGE_FLAG ) )
Original file line number Diff line number Diff line change 11{
22 "name" : " testcafe-live" ,
3- "version" : " 0.1.0 " ,
3+ "version" : " 0.1.1 " ,
44 "description" : " A watcher utility for TestCafe. Watches for changes in test files and automatically runs tests when these changes occur." ,
55 "main" : " lib/index.js" ,
66 "bin" : {
You can’t perform that action at this time.
0 commit comments