quipucords / camayoc

Test automation framework that facilitates functional testing of quipucords.
https://camayoc.readthedocs.io/
GNU General Public License v3.0
5 stars 4 forks source link

New UI: Ensure there's single element to click #545

Closed mirekdlugosz closed 1 month ago

mirekdlugosz commented 1 month ago

.locator() can match multiple elements on the page. .locator().click() works in strict mode, i.e. Playwright will refuse the operation if .locator() matches multiple elements. This is a change compared to .click(locator_string), which would happily operate on first element matching the locator_string.

Using .first between .locator() and .click() ensures there's single element to operate on.

This fixes a bug that is only present when running some tests on empty database. Which happens to be a case in pipeline.

codecov[bot] commented 1 month ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 76.85%. Comparing base (ac9ff64) to head (b508263). Report is 1 commits behind head on main.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #545 +/- ## ======================================= Coverage 76.85% 76.85% ======================================= Files 7 7 Lines 700 700 ======================================= Hits 538 538 Misses 162 162 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.