File tree Expand file tree Collapse file tree 2 files changed +12
-1
lines changed
Expand file tree Collapse file tree 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}) => {
1212 }
1313
1414 // 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 ( ) ) ;
1616 await baseUrlFn . call ( browser , uri ) ;
1717
1818 await browser . waitUntil (
Original file line number Diff line number Diff line change @@ -58,6 +58,17 @@ describe('"url" command', () => {
5858 assert . callOrder ( browser . execute , baseUrlFn ) ;
5959 } ) ;
6060
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+
6172 it ( 'should wait until request will be completed' , async ( ) => {
6273 wrapUrlCommand_ ( browser , { pageLoadTimeout : 100500 } ) ;
6374
You can’t perform that action at this time.
0 commit comments