Merge pull request #812 from thomasnordquist/chore/fix-broken-test-locators
fix broken test locators
This commit is contained in:
@@ -2,6 +2,6 @@ import { Page } from 'playwright'
|
|||||||
import { clickOn } from '../util'
|
import { clickOn } from '../util'
|
||||||
|
|
||||||
export async function copyValueToClipboard(browser: Page) {
|
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)
|
await clickOn(copyButton, 1)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -45,12 +45,12 @@ export async function showNumericPlot(browser: Page) {
|
|||||||
async function valuePreviewGuttersShowChartIcon(name: string, browser: Page) {
|
async function valuePreviewGuttersShowChartIcon(name: string, browser: Page) {
|
||||||
for (let retries = 0; retries < 2; retries += 1) {
|
for (let retries = 0; retries < 2; retries += 1) {
|
||||||
try {
|
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 {
|
} catch {
|
||||||
// ignore
|
// 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) {
|
async function chartSettings(name: string, browser: Page) {
|
||||||
|
|||||||
Reference in New Issue
Block a user