Skip to content

Commit c65a539

Browse files
authored
fix: events index & flaky page locator test (#2279)
* fix(playwright): update main content visibility check to use first match * test: remove query parameter from test request context
1 parent 48091b6 commit c65a539

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

tests/playwright/helpers/navigation-helpers.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,5 +192,6 @@ export const verifyPageLoad = async (page: Page, expectedUrl?: string): Promise<
192192
}
193193

194194
// Check that main content is visible
195-
await expect(page.locator('main, .main-content, body')).toBeVisible();
195+
// Grabs the highest match and checks if it's visible
196+
await expect(page.locator('#main-content, body').first()).toBeVisible();
196197
};

tests/test_views.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ def test_events_index_filters_past_events(self, mock_render_template):
218218

219219
events_index = build_events_index(mock_engage_docs)
220220

221-
with self.app.test_request_context("/?q=test"):
221+
with self.app.test_request_context():
222222
events_index()
223223
call_kwargs = mock_render_template.call_args[1]
224224
metadata = call_kwargs["metadata"]

0 commit comments

Comments
 (0)