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
13 changes: 10 additions & 3 deletions app/tests/artifacts-screens.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -497,10 +497,17 @@ describe.skipIf(!asked)("artifacts in a conversation", () => {
.getByRole("combobox", { name: "Role for Priya Nair" })
.waitFor();

await dialog
.getByRole("combobox", { name: "Role for Sam Ortiz" })
.click();
const samsRole = dialog.getByRole("combobox", {
name: "Role for Sam Ortiz",
});
await samsRole.click();
await page.getByRole("option", { name: "Viewer" }).click();
// The dialog greys out its controls while a change saves. Sam's role reads Viewer only once
// the server's answer is drawn, so from here they only turn back on, which a press waits for.
// Pressed straight after the choice, "Add a team" raced the save on a loaded runner:
// Playwright found it enabled, the save then greyed it out, and the press landed on a disabled
// button, which takes no mouse events. The list never opened, and "Finance" never came.
await samsRole.filter({ hasText: "Viewer" }).waitFor();

await dialog.getByRole("combobox", { name: "Add a team" }).click();
await page.getByRole("option", { name: "Finance" }).click();
Expand Down
11 changes: 11 additions & 0 deletions app/tests/team-connections-directory-layout.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -219,10 +219,21 @@ function fits(page: Page) {
const events = (page: Page) =>
page.evaluate(() => (window as unknown as { __events: string[] }).__events);

/**
* Searches Browse apps for `term`, and waits for the search to land. The directory reads the box
* 250ms after the last key, and lists the popular apps until then: Slack and Linear among them, so
* their tiles were on the page before the search was. A test that found one and pressed it raced
* the swap: on a loaded runner the results replaced the list after the press, and the tile pressed
* was off the page by the time its opacity was read. A detached element's opacity reads "", and
* Number("") is 0.
*/
async function search(page: Page, term: string) {
if (new URL(page.url()).pathname === "/connections")
await page.getByTestId("account-browse").click();
await page.getByRole("textbox", { name: "Search apps" }).fill(term);
await page
.getByRole("heading", { name: "Search results" })
.waitFor({ timeout: 15_000 });
}

describe.skipIf(!asked)("Connections on OpenBot Cloud", () => {
Expand Down