Unverified 提交 86e40057 authored 作者: Will Chen's avatar Will Chen 提交者: GitHub

Parameterize undo e2e test (#1943)

<!-- CURSOR_SUMMARY --> --- > [!NOTE] > Parameterizes the undo e2e test and adds a second run using native Git via a shared helper. > > - **Tests (e2e)**: > - Refactor `e2e-tests/undo.spec.ts` to use `runUndoTest(po, nativeGit)` helper. > - Pass `nativeGit` through `po.setUp({ autoApprove: true, nativeGit })`. > - Import `PageObject` from `helpers/test_helper`. > - Add second test "undo with native git" alongside existing "undo" test. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 2108a7d73669794f0052192e8b5a1ffac3d54ec1. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY --> <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Parameterized the undo e2e test to run with and without native Git, improving coverage without duplicating code. - **Refactors** - Added runUndoTest(po, nativeGit) helper and passed nativeGit to setUp. - Split into two test cases: “undo” and “undo with native git”. - Minor whitespace-only formatting updates in snapshot and fixture files. <sup>Written for commit 2108a7d73669794f0052192e8b5a1ffac3d54ec1. Summary will update automatically on new commits.</sup> <!-- End of auto-generated description by cubic. -->
上级 70d4f598
import { testSkipIfWindows, Timeout } from "./helpers/test_helper"; import { PageObject, testSkipIfWindows, Timeout } from "./helpers/test_helper";
import { expect } from "@playwright/test"; import { expect } from "@playwright/test";
testSkipIfWindows("undo", async ({ po }) => { const runUndoTest = async (po: PageObject, nativeGit: boolean) => {
await po.setUp({ autoApprove: true }); await po.setUp({ autoApprove: true, nativeGit });
await po.sendPrompt("tc=write-index"); await po.sendPrompt("tc=write-index");
await po.sendPrompt("tc=write-index-2"); await po.sendPrompt("tc=write-index-2");
...@@ -31,4 +31,12 @@ testSkipIfWindows("undo", async ({ po }) => { ...@@ -31,4 +31,12 @@ testSkipIfWindows("undo", async ({ po }) => {
// Also, could be slow. // Also, could be slow.
timeout: Timeout.LONG, timeout: Timeout.LONG,
}); });
};
testSkipIfWindows("undo", async ({ po }) => {
await runUndoTest(po, false);
});
testSkipIfWindows("undo with native git", async ({ po }) => {
await runUndoTest(po, true);
}); });
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论