Use getByLabel rather than getByText

This commit is contained in:
Gert Hengeveld 2024-04-18 11:34:58 +02:00
parent 9077a3f07a
commit b997f1eb03

View File

@ -50,7 +50,11 @@ test.describe('save-from-controls', () => {
await sbPage.panelContent().locator('[data-short-label="Unsaved changes"]').isVisible();
// clone the story
await sbPage.panelContent().locator('button').getByText('Create new story').click();
await sbPage
.panelContent()
.locator('button')
.getByLabel(/Create new story/)
.click();
const input = await sbPage.page.waitForSelector('[placeholder="Story export name"]');
await input.fill('ClonedStory' + id);