[Koha-devel] Can we add HTML classes to add semantic to elements when writing automated UI tests?

Victor Grousset/tuxayo victor at tuxayo.net
Thu Sep 30 00:25:01 CEST 2021


Hi :)

I'm writing an UI test for creating a club to later use it for holds.
In the page /cgi-bin/koha/clubs/clubs.pl
There is the button "New club" , I would like to click on it but it has 
nothing in the classes or id that tells it's this button.

I could use a vague and fragile in the long run selector like ".main 
.dropdown-toggle" and comment explaining what it is.

Or I could add a class like "new-club" to the <button>

Maybe there is a way I missed to have a readable, concise and durable 
way to click on the dropdown button but the question will still stand 
for a future case way there won't be such a way.

Also maybe there is better class name than "new-club".
The naming practice is also an important question.

Cheers,

-- 
Victor Grousset/tuxayo


More information about the Koha-devel mailing list