Просмотр исходного кода

fix(playwright): focus editor and normalize mode before :w in vim test

The `Write command (:w)` test started typing `:` immediately after
`beforeEach` re-navigated and opened the editor — but `.cm-content`
may not hold focus yet, and CodeMirror's Vim extension occasionally
hasn't settled into Normal mode on webkit. Click `.cm-content` to
focus and press `Escape` to guarantee Normal mode before issuing the
`:` command; this eliminates the flakiness that was surfacing as a
retry-passed annotation rather than a hard failure.
Yuki Takei 4 дней назад
Родитель
Сommit
b36a517fbc
1 измененных файлов с 6 добавлено и 0 удалено
  1. 6 0
      apps/app/playwright/23-editor/vim-keymap.spec.ts

+ 6 - 0
apps/app/playwright/23-editor/vim-keymap.spec.ts

@@ -60,6 +60,12 @@ test.describe
     test('Write command (:w) should save the page successfully', async ({
       page,
     }) => {
+      // Focus the editor and ensure Normal mode — beforeEach re-navigates, so
+      // the editor may not have focus yet and CodeMirror's Vim extension may
+      // need a keystroke to settle into Normal mode on webkit.
+      await page.locator('.cm-content').click();
+      await page.keyboard.press('Escape');
+
       // Enter command mode
       await page.keyboard.type(':');
       await expect(page.locator('.cm-vim-panel')).toBeVisible();