Skip to content

Commit 61f2389

Browse files
committed
fix broken test locators
1 parent f539e03 commit 61f2389

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/spec/scenarios/copyValueToClipboard.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@ import { Page } from 'playwright'
22
import { clickOn } from '../util'
33

44
export async function copyValueToClipboard(browser: Page) {
5-
const copyButton = await browser.locator('//span[contains(text(), "Value")]//button')
5+
const copyButton = await browser.getByRole('button', { name: 'Value' }).getByRole('button').first()
66
await clickOn(copyButton, 1)
77
}

src/spec/scenarios/showNumericPlot.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,12 @@ export async function showNumericPlot(browser: Page) {
4545
async function valuePreviewGuttersShowChartIcon(name: string, browser: Page) {
4646
for (let retries = 0; retries < 2; retries += 1) {
4747
try {
48-
return await browser.locator(`//*[contains(@data-test-type, "ShowChart")][contains(@data-test, "${name}")]`)
48+
return await browser.locator(`//*[contains(@data-test-type, "ShowChart")][contains(@data-test, "${name}")]`).first()
4949
} catch {
5050
// ignore
5151
}
5252
}
53-
return browser.locator(`//*[contains(@data-test-type, "ShowChart")][contains(@data-test, "${name}")]`)
53+
return browser.locator(`//*[contains(@data-test-type, "ShowChart")][contains(@data-test, "${name}")]`).first()
5454
}
5555

5656
async function chartSettings(name: string, browser: Page) {

0 commit comments

Comments
 (0)