Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions e2e/specs/review.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -525,8 +525,9 @@ describe("grr review window", () => {
await setInputValue("input[aria-label='Filter files']", "");
await pressShortcut("v");
await browser.waitUntil(async () => await browser.execute(() =>
Boolean(document.querySelector("[data-view='changes']")),
), { timeout: 5_000, interval: 50, timeoutMsg: "Changes did not reopen before choosing all commits" });
Boolean(document.querySelector("[data-view='changes']"))
&& !document.querySelector("main[aria-label='Commit diff'] [role='status']"),
), { timeout: 5_000, interval: 50, timeoutMsg: "Changes did not finish loading before choosing all commits" });
await pressShortcut("c");
await clickButton("Show all");
await browser.waitUntil(async () => await browser.execute(
Expand Down Expand Up @@ -605,12 +606,13 @@ async function clickElement(selector: string): Promise<void> {
}

async function clickButton(label: string): Promise<void> {
await browser.execute((targetLabel) => {
await browser.waitUntil(async () => await browser.execute((targetLabel) => {
const button = Array.from(document.querySelectorAll<HTMLButtonElement>("button"))
.find((candidate) => candidate.textContent === targetLabel);
if (!button) throw new Error(`No button matched ${targetLabel}`);
if (!button || button.disabled) return false;
button.click();
}, label);
return true;
}, label), { timeout: 5_000, interval: 50, timeoutMsg: `No enabled button matched ${label}` });
}

async function pressShortcut(key: string, modifiers: Pick<KeyboardEventInit, "ctrlKey" | "altKey" | "shiftKey" | "metaKey"> = {}): Promise<void> {
Expand Down
32 changes: 20 additions & 12 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@
"serialize-javascript": "7.1.4",
"cheerio": {
"undici": "7.30.1"
}
},
"glob": "14.0.2",
"minimatch": "11.0.1"
}
}
Loading