Skip to content

Commit

Permalink
Fix flaky mobile test
Browse files Browse the repository at this point in the history
  • Loading branch information
joel-jeremy committed Oct 14, 2024
1 parent a2c7273 commit 557a4f4
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
4 changes: 1 addition & 3 deletions packages/desktop-client/e2e/budget.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,7 @@ test.describe('Budget', () => {
test('renders the summary information: available funds, overspent, budgeted and for next month', async () => {
const summary = budgetPage.budgetSummary.first();

await expect(summary.getByText('Available Funds')).toBeVisible({
timeout: 10000,
});
await expect(summary.getByText('Available Funds')).toBeVisible();
await expect(summary.getByText(/^Overspent in /)).toBeVisible();
await expect(summary.getByText('Budgeted')).toBeVisible();
await expect(summary.getByText('For Next Month')).toBeVisible();
Expand Down
16 changes: 11 additions & 5 deletions packages/desktop-client/e2e/page-models/mobile-navigation.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,31 +105,37 @@ export class MobileNavigation {
}

async goToBudgetPage() {
return this.navigateToPage('Budget', () => new MobileBudgetPage(this.page));
return await this.navigateToPage(
'Budget',
() => new MobileBudgetPage(this.page),
);
}

async goToAccountsPage() {
return this.navigateToPage(
return await this.navigateToPage(
'Accounts',
() => new MobileAccountsPage(this.page),
);
}

async goToTransactionEntryPage() {
return this.navigateToPage(
return await this.navigateToPage(
'Transaction',
() => new MobileTransactionEntryPage(this.page),
);
}

async goToReportsPage() {
return this.navigateToPage(
return await this.navigateToPage(
'Reports',
() => new MobileReportsPage(this.page),
);
}

async goToSettingsPage() {
return this.navigateToPage('Settings', () => new SettingsPage(this.page));
return await this.navigateToPage(
'Settings',
() => new SettingsPage(this.page),
);
}
}

0 comments on commit 557a4f4

Please sign in to comment.