Skip to content

Commit

Permalink
fix broken test locators
Browse files Browse the repository at this point in the history
  • Loading branch information
bj00rn committed Jun 17, 2024
1 parent f539e03 commit 61f2389
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/spec/scenarios/copyValueToClipboard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ import { Page } from 'playwright'
import { clickOn } from '../util'

export async function copyValueToClipboard(browser: Page) {
const copyButton = await browser.locator('//span[contains(text(), "Value")]//button')
const copyButton = await browser.getByRole('button', { name: 'Value' }).getByRole('button').first()
await clickOn(copyButton, 1)
}
4 changes: 2 additions & 2 deletions src/spec/scenarios/showNumericPlot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,12 @@ export async function showNumericPlot(browser: Page) {
async function valuePreviewGuttersShowChartIcon(name: string, browser: Page) {
for (let retries = 0; retries < 2; retries += 1) {
try {
return await browser.locator(`//*[contains(@data-test-type, "ShowChart")][contains(@data-test, "${name}")]`)
return await browser.locator(`//*[contains(@data-test-type, "ShowChart")][contains(@data-test, "${name}")]`).first()
} catch {
// ignore
}
}
return browser.locator(`//*[contains(@data-test-type, "ShowChart")][contains(@data-test, "${name}")]`)
return browser.locator(`//*[contains(@data-test-type, "ShowChart")][contains(@data-test, "${name}")]`).first()
}

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

0 comments on commit 61f2389

Please sign in to comment.