Add a non-functional selectors to avoid breaking tests

VERIFIED FIXED

Status

Mozilla Reps
reps.mozilla.org
VERIFIED FIXED
4 years ago
4 years ago

People

(Reporter: hoosteeno, Assigned: agibson)

Tracking

Details

Earlier this week some QA automation broke because the Foundation 4 upgrade included some different class names. The automation broke here:

https://github.com/mozilla/remo-tests/blob/master/pages/base.py#L48

We should find each of the elements described by a complex selector and give it an additional class name that isn't tied to functionality. Here's the pattern I suggest:

        _events_menu_locator = (By.CSS_SELECTOR, '.events_menu_locator')
        _faq_menu_locator = (By.CSS_SELECTOR, '.faq_menu_locator')

etc.

This bug is similar to bug 875075 but addresses a different section of code.
(Assignee)

Comment 1

4 years ago
I think it would be better here to go for using ID's instead of CSS class names, as they are a bit more specific and selectors like this only really want to pick out a single occurance. I also suggest using hyphen's instead of underscores, just for consistency in the markup.

For the main #navigation-box menu I'll add the following ID's directly to the links:

  #dashboard-menu-locator
  #main-menu-locator
  #people-menu-locator
  #events-menu-locator
  #planet-menu-locator
  #wiki-menu-locator
  #labs-menu-locator
  #faq-menu-locator

For the user menu I'll add:

  #settings-menu-locator

Because the login / logout links are generated by browserid, the most practical solution is probably to add a non-functional ID to the parent element, so the selector can be something like

  _browserid_login_locator = (By.CSS_SELECTOR, '#login-menu-locator .browserid-login > span')
  _logout_menu_item_locator = (By.CSS_SELECTOR, '#logout-menu-locator .browserid-logout')
(Assignee)

Comment 2

4 years ago
PR opened here:

https://github.com/mozilla/remo/pull/551
(Assignee)

Updated

4 years ago
Assignee: nobody → agibson
Status: NEW → ASSIGNED
Added an issue to the QA repo here: https://github.com/mozilla/remo-tests/issues/109

Comment 4

4 years ago
Commits pushed to master at https://github.com/mozilla/remo

https://github.com/mozilla/remo/commit/a8cfd10c312998b0df6e83db78d3424233c3db6f
[fix bug 941029] Add a non-functional selectors to avoid breaking tests

https://github.com/mozilla/remo/commit/db3935602fda1dd1a3a53d15a292d6a7c763b50a
Merge pull request #551 from alexgibson/bug-941029-add-a-non-functional-selectors-to-avoid-breaking-tests

[fix bug 941029] Add non-functional selectors to avoid breaking tests

Updated

4 years ago
Status: ASSIGNED → RESOLVED
Last Resolved: 4 years ago
Resolution: --- → FIXED
Verified on stage that all the new ID locators are in place.
Status: RESOLVED → VERIFIED
Version: unspecified → 417
You need to log in before you can comment on or make changes to this bug.