Skip to content

Commit cc3a38e

Browse files
committed
Fix cross-platform E2E spec behavior
1 parent a816d6c commit cc3a38e

6 files changed

Lines changed: 18 additions & 34 deletions

File tree

‎app/test/e2e/helpers/element-helpers.ts‎

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,11 @@ import { isTauriDriver } from './platform';
2626
// ---------------------------------------------------------------------------
2727

2828
function xpathStringLiteral(text: string): string {
29-
const escaped = text.replaceAll('&', '&amp;').replaceAll('<', '&lt;').replaceAll('>', '&gt;');
30-
31-
if (!escaped.includes('"')) return `"${escaped}"`;
32-
if (!escaped.includes("'")) return `'${escaped}'`;
29+
if (!text.includes('"')) return `"${text}"`;
30+
if (!text.includes("'")) return `'${text}'`;
3331
const parts: string[] = [];
3432
let current = '';
35-
for (const ch of escaped) {
33+
for (const ch of text) {
3634
if (ch === '"') {
3735
if (current) parts.push(`"${current}"`);
3836
parts.push("'\"'");

‎app/test/e2e/specs/auth-access-control.spec.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,7 @@ describe('Auth & Access Control', () => {
339339
// 5. Logout
340340
// -------------------------------------------------------------------------
341341

342-
it('user can log out via Settings and returns to Welcome', async () => {
342+
it('user can log out via Settings and returns to Welcome', async function () {
343343
if (isMac2()) {
344344
await navigateToSettings();
345345
const hasLogoutEntry =
@@ -350,7 +350,7 @@ describe('Auth & Access Control', () => {
350350
console.log(
351351
'[AuthAccess] Logout settings entry verified on Mac2; click-through logout remains unreliable via WKWebView accessibility'
352352
);
353-
return;
353+
this.skip();
354354
}
355355

356356
// Re-auth to get a clean session for logout

‎app/test/e2e/specs/card-payment-flow.spec.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -169,12 +169,12 @@ describe('Card Payment Flow', () => {
169169
await navigateToHome();
170170
});
171171

172-
it('5.3.2 — Manage Subscription opens Stripe portal', async () => {
172+
it('5.3.2 — Manage Subscription opens Stripe portal', async function () {
173173
if (isMac2()) {
174174
console.log(
175175
`${LOG_PREFIX} 5.3.2 — skipping portal action assertion on Mac2; billing header actions are not exposed reliably in WKWebView accessibility`
176176
);
177-
return;
177+
this.skip();
178178
}
179179

180180
// Seed mock with active subscription so "Manage" button appears

‎app/test/e2e/specs/conversations-web-channel-flow.spec.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,12 +56,12 @@ suiteRunner('Conversations web channel flow', () => {
5656
await stopMockServer();
5757
});
5858

59-
it('sends UI message through agent loop and renders response', async () => {
59+
it('sends UI message through agent loop and renders response', async function () {
6060
if (isMac2()) {
6161
console.log(
6262
'[ConversationsE2E] Skipping on Mac2: composing and submitting chat input requires WebView execute, which Appium WKWebView does not support'
6363
);
64-
return;
64+
this.skip();
6565
}
6666

6767
stepLog('trigger deep link');

‎app/test/e2e/specs/crypto-payment-flow.spec.ts‎

Lines changed: 3 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -64,29 +64,12 @@ describe('Crypto Payment Flow', () => {
6464
await performFullLogin('e2e-crypto-payment-token');
6565
});
6666

67-
it('6.1.1 — upgrade with crypto toggle triggers Coinbase charge', async () => {
67+
it('6.1.1 — upgrade with crypto toggle triggers Coinbase charge', async function () {
6868
if (isMac2()) {
69-
resetMockBehavior();
70-
await navigateToBilling();
71-
clearRequestLog();
72-
73-
const hasCryptoLabel = await textExists('Pay with Crypto');
74-
expect(hasCryptoLabel).toBe(true);
75-
76-
try {
77-
await clickToggle(10_000);
78-
} catch {
79-
await clickText('Pay with Crypto', 10_000);
80-
}
81-
await browser.pause(2_000);
82-
83-
const annualStillVisible = await textExists('Annual');
84-
expect(annualStillVisible).toBe(true);
8569
console.log(
86-
`${LOG_PREFIX} 6.1.1 — Mac2 verified crypto toggle interaction; request-level Coinbase assertion skipped due to unreliable WKWebView control clicks`
70+
`${LOG_PREFIX} 6.1.1 — skipping Coinbase charge assertion on Mac2; WKWebView control clicks are not reliable enough to validate this flow`
8771
);
88-
await navigateToHome();
89-
return;
72+
this.skip();
9073
}
9174

9275
resetMockBehavior();

‎app/test/e2e/specs/login-flow.spec.ts‎

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -437,12 +437,15 @@ describe('Login flow — complete with mock data (Linux)', () => {
437437
resetMockBehavior();
438438

439439
if (isTauriDriver()) {
440-
// tauri-driver (Linux/Windows): clear localStorage directly via JS
440+
// tauri-driver (Linux/Windows): clear persisted web storage and reload so
441+
// the in-memory auth state is rebuilt from an unauthenticated baseline.
441442
await browser.execute(() => {
442443
localStorage.removeItem('persist:auth');
443-
window.location.hash = '/';
444+
sessionStorage.clear();
445+
window.location.reload();
444446
});
445-
await browser.pause(2_000);
447+
await waitForAppReady(20_000);
448+
console.log('[LoginFlow] Bypass auth: cleared web storage and reloaded app (Linux/Windows)');
446449
} else {
447450
// Appium Mac2 (macOS): browser.execute() is not supported for DOM access.
448451
// Terminate the app, wipe WebKit storage, and relaunch for a clean slate.

0 commit comments

Comments
 (0)