Skip to content

Commit 60102e3

Browse files
authored
Merge pull request #13711 from gitbutlerapp/fix-flaky-test
Fix flaky unified diff e2e test (81% reliability)
2 parents c0d9fb7 + fc1f973 commit 60102e3

1 file changed

Lines changed: 13 additions & 1 deletion

File tree

e2e/playwright/tests/unifiedDiffView.spec.ts

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,13 @@ import { discardFile } from "../src/file.ts";
22
import { getHunkHeaderSelector, getHunkLineSelector } from "../src/hunk.ts";
33
import { getBaseURL, startGitButler, type GitButler } from "../src/setup.ts";
44
import { test } from "../src/test.ts";
5-
import { clickByTestId, fillByTestId, getByTestId, waitForTestId } from "../src/util.ts";
5+
import {
6+
clickByTestId,
7+
fillByTestId,
8+
getByTestId,
9+
waitForTestId,
10+
waitForTestIdToNotExist,
11+
} from "../src/util.ts";
612
import { expect, type Locator } from "@playwright/test";
713
import { existsSync, readFileSync, writeFileSync } from "fs";
814
import { join, resolve } from "path";
@@ -85,6 +91,9 @@ test("should be able to select the hunks correctly in a complex file", async ({
8591
await fillByTestId(page, "commit-drawer-title-input", "Partial commit: Part 1");
8692
await clickByTestId(page, "commit-drawer-action-button");
8793

94+
// Wait for the commit view to close before proceeding
95+
await waitForTestIdToNotExist(page, "new-commit-view");
96+
8897
// Start the commit process
8998
await clickByTestId(page, "start-commit-button");
9099

@@ -102,6 +111,9 @@ test("should be able to select the hunks correctly in a complex file", async ({
102111
await fillByTestId(page, "commit-drawer-title-input", "Partial commit: Part 2");
103112
await clickByTestId(page, "commit-drawer-action-button");
104113

114+
// Wait for the commit view to close before proceeding
115+
await waitForTestIdToNotExist(page, "new-commit-view");
116+
105117
// Start the commit process
106118
await clickByTestId(page, "start-commit-button");
107119

0 commit comments

Comments
 (0)