File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -3456,10 +3456,11 @@ public function closeTab()
3456
3456
{
3457
3457
$ currentTab = $ this ->webDriver ->getWindowHandle ();
3458
3458
$ prevTab = $ this ->getRelativeTabHandle (-1 );
3459
- $ this ->webDriver ->close ();
3460
- if ($ prevTab !== $ currentTab ) {
3461
- $ this ->webDriver ->switchTo ()->window ($ prevTab );
3459
+ if ($ prevTab === $ currentTab ) {
3460
+ throw new ModuleException ($ this , 'Will not close the last open tab ' );
3462
3461
}
3462
+ $ this ->webDriver ->close ();
3463
+ $ this ->webDriver ->switchTo ()->window ($ prevTab );
3463
3464
}
3464
3465
3465
3466
/**
Original file line number Diff line number Diff line change @@ -1039,7 +1039,6 @@ public function testBrowserTabs()
1039
1039
$ this ->module ->closeTab ();
1040
1040
$ this ->module ->seeNumberOfTabs (2 );
1041
1041
$ this ->module ->closeTab ();
1042
- $ this ->module ->closeTab ();
1043
1042
}
1044
1043
1045
1044
public function testPerformOnWithArray ()
You can’t perform that action at this time.
0 commit comments