diff --git a/src/spec/scenarios/copyTopicToClipboard.ts b/src/spec/scenarios/copyTopicToClipboard.ts index e7f6e43..29adb19 100644 --- a/src/spec/scenarios/copyTopicToClipboard.ts +++ b/src/spec/scenarios/copyTopicToClipboard.ts @@ -2,6 +2,7 @@ import { Page } from 'playwright' import { clickOn } from '../util' export async function copyTopicToClipboard(browser: Page) { - const copyButton = await browser.locator('[data-testid="copy-button"]') + // Select the copy button specifically in the Topic panel (not Value panel or MessageHistory) + const copyButton = browser.getByRole('button', { name: /Topic/i }).getByTestId('copy-button') await clickOn(copyButton, 1) } diff --git a/src/spec/scenarios/copyValueToClipboard.ts b/src/spec/scenarios/copyValueToClipboard.ts index 7b9bc67..afe9982 100644 --- a/src/spec/scenarios/copyValueToClipboard.ts +++ b/src/spec/scenarios/copyValueToClipboard.ts @@ -2,6 +2,7 @@ import { Page } from 'playwright' import { clickOn } from '../util' export async function copyValueToClipboard(browser: Page) { - const copyButton = await browser.getByRole('button', { name: 'Value' }).getByRole('button').first() + // Select the copy button specifically in the Value panel (not Topic panel or MessageHistory) + const copyButton = browser.getByRole('button', { name: /Value/i }).getByTestId('copy-button') await clickOn(copyButton, 1) }