Skip to content

Commit

Permalink
Merge pull request #812 from thomasnordquist/chore/fix-broken-test-lo…
Browse files Browse the repository at this point in the history
…cators

fix broken test locators
  • Loading branch information
bj00rn authored Jun 17, 2024
2 parents 8975e7b + 61f2389 commit 03ba430
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 03ba430

Please sign in to comment.