File tree 2 files changed +12
-1
lines changed
2 files changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ module.exports = (browser, {config}) => {
12
12
}
13
13
14
14
// in order to clear the page from previous search result
15
- await browser . execute ( ( ) => document . body . remove ( ) ) ;
15
+ await browser . execute ( ( ) => document . body && document . body . remove ( ) ) ;
16
16
await baseUrlFn . call ( browser , uri ) ;
17
17
18
18
await browser . waitUntil (
Original file line number Diff line number Diff line change @@ -58,6 +58,17 @@ describe('"url" command', () => {
58
58
assert . callOrder ( browser . execute , baseUrlFn ) ;
59
59
} ) ;
60
60
61
+ it ( 'should not reject if body element does not exist on the page' , async ( ) => {
62
+ wrapUrlCommand_ ( browser ) ;
63
+
64
+ global . document . body = null ;
65
+ browser . execute . callsFake ( ( ) => {
66
+ browser . execute . firstCall . args [ 0 ] ( ) ;
67
+ } ) ;
68
+
69
+ await assert . isFulfilled ( browser . url ( '/?text=test' ) ) ;
70
+ } ) ;
71
+
61
72
it ( 'should wait until request will be completed' , async ( ) => {
62
73
wrapUrlCommand_ ( browser , { pageLoadTimeout : 100500 } ) ;
63
74
You can’t perform that action at this time.
0 commit comments