-
Enhancement
-
Resolution: Done
-
Major
-
None
-
None
Since we're planning to test ISPN management console using Selenium (Selenide more specifically), we would appreciate taking more attention to giving ID's to page elements that would be helpful for testing.
Just an example, how it could simplify our test development as a motivation. Currently (ISPN 8.1.0.Alpha2), in the detail of cache container page with list of caches, the shortest way (even with Java 8) how to get (for testing purposes) names of caches, is:
List<String> caches = $$("#cache-cards > div").filterBy(attribute("ng-show", "cache.show")) .stream().map(element -> element.find("a").text()).collect(Collectors.toList());
The time to figure out this "query" was about 2 minutes (For the first time. I know, very subjective, but as an example)
Now suppose we would add class="cacheName" to <a> element of the corresponding cache card:
List<String> caches = $$("#cache-cards a.cacheName").stream().map(element -> element.text()).collect(Collectors.toList());
Time to come up with such an "query" would be around 5 seconds
I tried to come up with some generic guidelines about where to put some id/class, feel free to add some:
- to every input/select field
- especially with checkboxes which are differentiated with <label>
- generally to <span> or any (text?) element which can change it's value, which is dependent on some state of the cache/server/...
Of course, you cannot be 100% successful with giving the id/class to every useful place, but every single place, which you select correctly, simplifies and speeds up the test development. Probably also a good idea to come up with some naming convention.
- clones
-
ISPN-5941 Ensure testability of management console
- Closed