Bug 19384 - [OMNIBUS] Add Selenium tests
Summary: [OMNIBUS] Add Selenium tests
Status: NEW
Alias: None
Product: Koha
Classification: Unclassified
Component: Test Suite (show other bugs)
Version: unspecified
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Chris Cormack
QA Contact: Testopia
Depends on: 18974 19182 19183 19184 19189 19883 25829 13691 19181 19185 19243 22898 27055
  Show dependency treegraph
Reported: 2017-09-28 15:47 UTC by Jonathan Druart
Modified: 2020-11-19 13:23 UTC (History)
2 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Text to go in the release notes:
Version(s) released in:


Note You need to log in before you can comment on or make changes to this bug.
Description Jonathan Druart 2017-09-28 15:47:06 UTC

Comment 1 Katrin Fischer 2017-10-07 14:24:42 UTC
Are there instructions somewhere on how to set up the Selenium environment necessary for testing the attached patches?
Comment 2 Jonathan Druart 2017-10-09 15:54:18 UTC
Alex wrote a complete test plan in all the commit messages.
Comment 3 Katrin Fischer 2017-10-09 15:57:12 UTC
I looked at them, but was not sure what to make of this:
4. Ensure you have your selenium service running
Comment 4 Katrin Fischer 2017-10-09 15:59:49 UTC
My fault, I should have read further, the first test plan I looked at didn't include it, but the last version of the commit message had full instructions:
Comment 5 Victor Grousset/tuxayo 2020-04-20 21:04:29 UTC
bug 18974
bug 19182
bug 19183
bug 19184 
bug 19189

> The tests need to be rewritten completely.

What would be needed to be rewritten? The test business logic or the usage of the test stack?

Is there an existing test that I could use as a model for the current good practices?
Then I'll try to implement one of the above tests.
Comment 6 Jonathan Druart 2020-04-21 09:25:53 UTC
Look at the patches on these bug reports, then compare with what we have in t/db_dependent/selenium.

Alex wrote the patches before the code has been moved to a t::lib::Selenium module (bug 19802 and bug 19243 were the start). The logic is correct, but the paths are too specific (maybe generated with a tool) which makes the maintainability very hard. The methods from the t::lib::Selenium should be used as much as possible (auth, click, fill_form, submit_form).

I think administration_tasks.t is a good example to follow.
Comment 7 Victor Grousset/tuxayo 2020-04-27 00:49:26 UTC
> but the paths are too specific (maybe generated with a tool)

Let me check.

> ($driver->find_element_by_xpath('/html/body/div/div[4]/div/div/div[2]/div/div[2]/div[2]/form[1]/div/table/tbody/tr/td[6]/span[1]')) {

Indeed, that's totally like a browser plugin recorded the action of the user.

These are valuables tools if a project has the processes and people to handle, check and fix the false positive breakages.

Thanks for the pointed, I'll take a look at these.
Comment 8 Victor Grousset/tuxayo 2020-04-27 02:13:45 UTC