Skip to content

Commit 32b9ddb

Browse files
chore: Reenable web e2e tests
1 parent 1cb63dc commit 32b9ddb

3 files changed

Lines changed: 22 additions & 16 deletions

File tree

.github/workflows/functional-test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
# - device
3232
# In CI env driver tests are unstable, because it's expensive to start and stop simulators
3333
# - driver
34-
# - web
34+
- web
3535
- long
3636
xcodeVersion: ['26.4', '16.4']
3737
include:

test/functional/web/safari-alerts-e2e.spec.ts

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
import {describe, it, before, after} from 'node:test';
1+
import {describe, it, before, after, type TestContext} from 'node:test';
22

33
import {retryInterval} from 'asyncbox';
44
import {use, expect} from 'chai';
55
import chaiAsPromised from 'chai-as-promised';
66
import type {Browser} from 'webdriverio';
77

8-
import {SAFARI_CAPS, amendCapabilities, isIosVersionBelow} from '../desired.js';
8+
import {SAFARI_CAPS, amendCapabilities, isIosVersionAtLeast, isIosVersionBelow} from '../desired.js';
99
import {initSession, deleteSession} from '../helpers/session.js';
1010
import {createGuineaPigServerSession, guineaPigPage} from './helpers/index.js';
1111

@@ -74,7 +74,13 @@ describe('safari - alerts', {skip: Boolean(process.env.CI) && isIosVersionBelow(
7474
expect(await driver.getAlertText()).to.include('I am an alert');
7575
await dismissAlert(driver);
7676
});
77-
it('should not get text of alert that closed', async function () {
77+
it('should not get text of alert that closed', async function (ctx: TestContext) {
78+
if (isIosVersionAtLeast('27.0')) {
79+
// WDA's alert/text endpoint on iOS 27 unreliably falls back to the
80+
// underlying page's accessibility content instead of raising a
81+
// "no such alert" error once the alert has actually been dismissed.
82+
return ctx.skip();
83+
}
7884
const alert = await findWithRetry('#alert1');
7985
await alert.click();
8086
await acceptAlert(driver);

test/functional/web/safari-window-e2e.spec.ts

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -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(/window could not be found/);
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

Comments
 (0)