@@ -90,18 +90,6 @@ describe('safari - windows and frames', function () {
9090 await openPage ( driver , guineaPigPage ( baseUrl ) ) ;
9191 } ) ;
9292
93- it ( 'should be able to open js popup windows' , async function ( ) {
94- await driver . updateSettings ( {
95- autoClickAlertSelector : '**/XCUIElementTypeStaticText[`label == "Allow"`]' ,
96- } ) ;
97-
98- await driver . executeScript ( `window.open('/test/guinea-pig2.html', '_blank');` , [ ] ) ;
99- await expect ( spinTitleEquals ( driver , 'I am another page title' , 5 ) ) . to . eventually . not . be . rejected ;
100- await driver . updateSettings ( { autoClickAlertSelector : '' } ) ;
101-
102- await driver . closeWindow ( ) ;
103- } ) ;
104-
10593 it ( 'should throw nosuchwindow if there is not one' , async function ( ) {
10694 await expect ( driver . switchToWindow ( 'noexistman' ) ) . to . be . rejectedWith ( / w i n d o w c o u l d n o t b e f o u n d / ) ;
10795 } ) ;
@@ -175,6 +163,18 @@ describe('safari - windows and frames', function () {
175163 await driver . back ( ) ;
176164 } ) ;
177165
166+ it ( 'should be able to open js popup windows' , async function ( ) {
167+ await driver . updateSettings ( {
168+ autoClickAlertSelector : '**/XCUIElementTypeStaticText[`label == "Allow"`]' ,
169+ } ) ;
170+
171+ await driver . executeScript ( `window.open('/test/guinea-pig2.html', '_blank');` , [ ] ) ;
172+ await expect ( spinTitleEquals ( driver , 'I am another page title' , 5 ) ) . to . eventually . not . be . rejected ;
173+ await driver . updateSettings ( { autoClickAlertSelector : '' } ) ;
174+
175+ await driver . closeWindow ( ) ;
176+ } ) ;
177+
178178 // broken on real devices, see https://github.com/appium/appium/issues/5167
179179 it ( 'should be able to open js popup windows with safariAllowPopups set to true @skip-real-device' , async function ( ctx : TestContext ) {
180180 if ( process . env . CI && isIosVersionBelow ( '18.0' ) ) {
0 commit comments