freeCodeCamp / publish

> Content backend platform for /news
https://publish.freecodecamp.org
BSD 3-Clause "New" or "Revised" License
10 stars 9 forks source link

fix(e2e, playwright): avoid strict mode violation error #363

Closed sidemt closed 10 months ago

sidemt commented 10 months ago

Checklist:

Closes #XXXXX

Tests for webkit was failing due to the following error:

  1) [webkit] › tag.spec.ts:14:5 › it should be possible to create and delete a new tag ────────────

    Error: locator.click: Error: strict mode violation: getByRole('button', { name: 'Delete' }) resolved to 2 elements:
        1) <button type="button" class="chakra-button css-41aesz">Delete tag</button> aka getByRole('button', { name: 'Delete tag' })
        2) <button type="button" class="chakra-button css-18zw69y">Delete</button> aka getByRole('button', { name: 'Delete', exact: true })
sidemt commented 10 months ago

This error isn't consistent, not sure why... But I saw it in the CI check of some PRs and also in my local, so I think it's worth adding it.

sidemt commented 10 months ago

Let me merge this for now as the checks for some of the open PRs are failing due to this error.