Automattic / wp-e2e-tests

Automated end-to-end tests for WordPress.com
https://github.com/Automattic/wp-calypso
GNU General Public License v2.0
110 stars 20 forks source link

Selecting wrong menu items #1530

Closed alisterscott closed 5 years ago

alisterscott commented 6 years ago

If you run the tests without retrying it's common to see the tests selecting the wrong item in the menu sidebar and then failing as the incorrect screen is shown

Something is funky with how we click these sidebar items - we should investigate why

To reproduce change "max_test_attempts": 3, to "max_test_attempts": 1, in magellan.json and commit the change to see the failures in CircleCI for a branch

Stojdza commented 6 years ago

This happened recently for 'People' page when I ran tests locally. It was failing randomly. @alisterscott What do you think to change the way how we are getting these elements? Instead of '.sites-navigation [data-tip-target="people"] a' to add data-e2e attribute to class menu-link-text for every item in sidebar?

screen shot 2018-10-18 at 14 39 02
alisterscott commented 5 years ago

We can pass .menu-link-text as a selector and item name from the sidebar to selectElementByText()

I think we should try to avoid selecting menu items by text since they're translated and won't work in other languages, eg for i18n tests, and also menu text is more likely to change than a specific attribute. Or do I misunderstand something?

alisterscott commented 5 years ago

We can pass .menu-link-text as a selector and item name from the sidebar to selectElementByText()

I think we should try to avoid selecting menu items by text since they're translated and won't work in other languages, eg for i18n tests, and also menu text is more likely to change than a specific attribute. Or do I misunderstand something?

Stojdza commented 5 years ago

@alisterscott I replied to this comment here. So yes, data e2e attribute would be more stable solution.