@@ -2,7 +2,13 @@ import { discardFile } from "../src/file.ts";
22import { getHunkHeaderSelector , getHunkLineSelector } from "../src/hunk.ts" ;
33import { getBaseURL , startGitButler , type GitButler } from "../src/setup.ts" ;
44import { 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" ;
612import { expect , type Locator } from "@playwright/test" ;
713import { existsSync , readFileSync , writeFileSync } from "fs" ;
814import { 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