Skip to content

YC (S26) | Open Computer History | Continuously record your company computer work, map your workflows, help you find work worth automating, and power your agents' context

fix(e2e): match pipe name as <span> not <button> after #4278 (pipe-card rework)

Louis Beaumont7a6273fd4ade
diff --git a/apps/screenpipe-app-tauri/e2e/specs/pipes-mcp-connections.spec.ts b/apps/screenpipe-app-tauri/e2e/specs/pipes-mcp-connections.spec.ts
index b018b41f1..9af2f82ff 100644
--- a/apps/screenpipe-app-tauri/e2e/specs/pipes-mcp-connections.spec.ts
+++ b/apps/screenpipe-app-tauri/e2e/specs/pipes-mcp-connections.spec.ts
@@ -190,7 +190,9 @@ async function waitForPipeRow(): Promise<void> {
(await browser.execute((pipeName: string) => {
const root = document.querySelector('[data-testid="section-pipes"]');
if (!root) return false;
- return Array.from(root.querySelectorAll<HTMLButtonElement>('button')).some(
+ // #4278: the pipe name is now a <span> inside a div[role="button"] row,
+ // so match button OR span (never the row div, whose text is name+desc).
+ return Array.from(root.querySelectorAll<HTMLElement>('button, span')).some(
(button) => button.textContent?.trim() === pipeName
);
}, PIPE_NAME)) as boolean,
@@ -205,7 +207,7 @@ async function expandPipeConfig(): Promise<void> {
const clicked = (await browser.execute((pipeName: string) => {
const root = document.querySelector('[data-testid="section-pipes"]');
if (!root) return false;
- const nameButton = Array.from(root.querySelectorAll<HTMLButtonElement>('button')).find(
+ const nameButton = Array.from(root.querySelectorAll<HTMLElement>('button, span')).find(
(button) => button.textContent?.trim() === pipeName
);
const group = nameButton?.closest<HTMLElement>('div.group');
@@ -221,7 +223,7 @@ async function expandPipeConfig(): Promise<void> {
async () =>
(await browser.execute((pipeName: string) => {
const root = document.querySelector('[data-testid="section-pipes"]');
- const nameButton = Array.from(root?.querySelectorAll<HTMLButtonElement>('button') ?? []).find(
+ const nameButton = Array.from(root?.querySelectorAll<HTMLElement>('button, span') ?? []).find(
(button) => button.textContent?.trim() === pipeName
);
const group = nameButton?.closest<HTMLElement>('div.group');
@@ -237,7 +239,7 @@ async function expandPipeConfig(): Promise<void> {
async function clickConnectionsAdd(): Promise<void> {
const clicked = (await browser.execute((pipeName: string) => {
const root = document.querySelector('[data-testid="section-pipes"]');
- const nameButton = Array.from(root?.querySelectorAll<HTMLButtonElement>('button') ?? []).find(
+ const nameButton = Array.from(root?.querySelectorAll<HTMLElement>('button, span') ?? []).find(
(button) => button.textContent?.trim() === pipeName
);
const group = nameButton?.closest<HTMLElement>('div.group');
@@ -305,7 +307,7 @@ describe('Pipes: custom MCP connection picker', function () {
async () =>
(await browser.execute((pipeName: string, serverName: string) => {
const root = document.querySelector('[data-testid="section-pipes"]');
- const nameButton = Array.from(root?.querySelectorAll<HTMLButtonElement>('button') ?? []).find(
+ const nameButton = Array.from(root?.querySelectorAll<HTMLElement>('button, span') ?? []).find(
(button) => button.textContent?.trim() === pipeName
);
const group = nameButton?.closest<HTMLElement>('div.group');
@@ -343,7 +345,7 @@ describe('Pipes: custom MCP connection picker', function () {
async () =>
(await browser.execute((pipeName: string) => {
const root = document.querySelector('[data-testid="section-pipes"]');
- const nameButton = Array.from(root?.querySelectorAll<HTMLButtonElement>('button') ?? []).find(
+ const nameButton = Array.from(root?.querySelectorAll<HTMLElement>('button, span') ?? []).find(
(button) => button.textContent?.trim() === pipeName
);
const group = nameButton?.closest<HTMLElement>('div.group');
@@ -357,7 +359,7 @@ describe('Pipes: custom MCP connection picker', function () {
const openedSetup = (await browser.execute((pipeName: string) => {
const root = document.querySelector('[data-testid="section-pipes"]');
- const nameButton = Array.from(root?.querySelectorAll<HTMLButtonElement>('button') ?? []).find(
+ const nameButton = Array.from(root?.querySelectorAll<HTMLElement>('button, span') ?? []).find(
(button) => button.textContent?.trim() === pipeName
);
const group = nameButton?.closest<HTMLElement>('div.group');
diff --git a/apps/screenpipe-app-tauri/e2e/specs/pipes.spec.ts b/apps/screenpipe-app-tauri/e2e/specs/pipes.spec.ts
index 9288ea2b4..bb5146191 100644
--- a/apps/screenpipe-app-tauri/e2e/specs/pipes.spec.ts
+++ b/apps/screenpipe-app-tauri/e2e/specs/pipes.spec.ts
@@ -374,7 +374,9 @@ describe('Pipes: discover → install → play', function () {
it('shows the installed pipe in My Pipes list', async () => {
const isOnPage = async (): Promise<boolean> => {
return (await browser.execute((name: string) => {
- return Array.from(document.querySelectorAll<HTMLButtonElement>('button'))
+ // #4278: the pipe name is now a <span> inside a div[role="button"] row,
+ // not a <button>; match button OR span (never the row div itself).
+ return Array.from(document.querySelectorAll<HTMLElement>('button, span'))
.some((b) => b.textContent?.trim() === name);
}, installedPipeName)) as boolean;
};
@@ -433,7 +435,7 @@ describe('Pipes: discover → install → play', function () {
await browser.waitUntil(
async () =>
(await browser.execute((name: string) => {
- const btn = Array.from(document.querySelectorAll<HTMLButtonElement>('button')).find(
+ const btn = Array.from(document.querySelectorAll<HTMLElement>('button, span')).find(
(b) => b.textContent?.trim() === name
);
if (!btn) return false;
@@ -443,13 +445,15 @@ describe('Pipes: discover → install → play', function () {
{ timeout: 8_000, timeoutMsg: `Pipe name button "${installedPipeName}" not found` }
);
await browser.pause(400);
- const pipeNameBtn = await $(`button=${installedPipeName}`);
+ // #4278: name is a <span> now; `span=NAME` matches it. Hovering it still
+ // triggers the row's group-hover (the span lives inside div.group).
+ const pipeNameBtn = await $(`span=${installedPipeName}`);
// Hover to trigger group-hover CSS → opacity-0 → opacity-100 on play button
await pipeNameBtn.moveTo();
await browser.pause(400);
const played = await browser.execute((name: string) => {
- for (const nameBtn of Array.from(document.querySelectorAll<HTMLButtonElement>('button'))) {
+ for (const nameBtn of Array.from(document.querySelectorAll<HTMLElement>('button, span'))) {
if (nameBtn.textContent?.trim() !== name) continue;
const row = nameBtn.closest<HTMLElement>('div.group');
if (!row) continue;