Skip to content

Commit 01f7965

Browse files
committed
fix(e2e): wait for narration load before fill in edit test
Same race condition fix as test_save_narration — wait for the async GET /api/narration response to complete before filling the textarea, preventing the fetch result from overwriting the Playwright fill. Made-with: Cursor
1 parent 9585f64 commit 01f7965

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

tests/e2e/test_production_view.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,10 @@ def test_switch_to_video_tab(self, page: Page):
8383

8484
class TestNarrationEditing:
8585
def test_edit_narration_text(self, page: Page):
86-
page.locator("#segment-list li", has_text="01-intro").click()
86+
with page.expect_response("**/api/narration/01-intro"):
87+
page.locator("#segment-list li", has_text="01-intro").click()
8788
editor = page.locator("#narration-editor")
89+
expect(editor).to_have_value(re.compile(r"Welcome to the test project"))
8890
editor.fill("Updated narration content for testing.")
8991
expect(editor).to_have_value("Updated narration content for testing.")
9092

0 commit comments

Comments
 (0)