Bug 19183 - Acquisition module setup selenium test
Summary: Acquisition module setup selenium test
Status: NEW
Alias: None
Product: Koha
Classification: Unclassified
Component: Test Suite (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Chris Cormack
QA Contact: Testopia
URL:
Keywords:
Depends on: 19243
Blocks: 19384
  Show dependency treegraph
 
Reported: 2017-08-27 02:22 UTC by Alex Buckley
Modified: 2020-04-20 07:36 UTC (History)
2 users (show)

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


Attachments
Bug 19183 - Selenium test for creating a currency, budget and fund (9.93 KB, patch)
2017-08-27 02:39 UTC, Alex Buckley
Details | Diff | Splinter Review
Bug 19183: Change to use ENV, fix login and passwords (2.32 KB, patch)
2017-10-30 04:02 UTC, Mark Tompsett
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Alex Buckley 2017-08-27 02:22:54 UTC
This selenium test will go through the initial process of setting up the Acquisition module including creating a currency, budget and fund
Comment 1 Alex Buckley 2017-08-27 02:39:49 UTC
Created attachment 66506 [details] [review]
Bug 19183 - Selenium test for creating a currency, budget and fund

This Selenium test goes through the process of creating a currency,
budget and fund which all libraries perform when setting up ththe
Koha Acqusition module for the first tiem (Note: The library does
not have to create a currency if they installed sample
currencies in the web installer).

Test plan (this test plan includes how to install Selenium as well as how to run this test, for the benefit of people who have not got
Selenium installed on their machines):

1. wget
https://selenium-release.storage.googleapis.com/2.53/selenium-server-standalone-2.53.0.jar

2. vim /etc/apt/sources.list.d/firefox.list

3. Paste into the file:
deb http://packages.linuxmint.com debian import

4. sudo apt-get update

5. sudo apt-get install firefox

6. sudo apt-get install xvfb

7. Set the SELENIUM_PATH variable:
SELENIUM_PATH=/home/vagrant/kohaclone/selenium-server-standalone-2.53.0.jar

8. Xvfb :1 -screen 0 1024x768x24 2>&1 >/dev/null &

9. DISPLAY=:1 java -jar $SELENIUM_PATH

Note: This will start up the selenium server. Everytime you want to shut
down this terminal window and want to restart Selenium just run the step
9 command to restart the Selenium server

10. Open a new terminal window and write in:
git clone https://github.com/gempesaw/Selenium-Remote-Driver --branch
build/master --single-branch --depth 1

11. cd Selenium-Remote-Driver

12. perl Makefile.PL

13. make

14. make test

15. sudo make install

16. Now everything is installed and you can set up for running the
selenium tests

17. Create a superlibrarian user with the username koha and password
koha

18. If your usual port configuration for the intranet and OPAC is 8081
and 8080 respectively then set the staffClientBaseURL and OPACBaseURL
system preferences to localhost:8080 and localhost:80 respectively

19. For the best test performance remove any existing currencies,
budgets, and funds

20. sudo koha-shell <instancename>

21. perl t/db_dependent/selenium/acquisitionsetup.t

22. The test should pass.
Note: The time_diff comments in the test output showing what the test is
doing

Note: If you have issues with installing Selenium and
Selenium::Remote::Driver please write a comment on the bug report and I will be more than happy to create a screencapture video showing all the steps

Sponsored-By: Catalyst IT
Comment 2 Alex Buckley 2017-08-27 02:40:26 UTC
This patch was originally attached to 18974 however I have placed it in its own bug report to make testing more straightforward
Comment 3 Mark Tompsett 2017-10-30 04:00:38 UTC
Shucks! The code was going well enough with my minor tweaks. Then we had to fail.

03:49:22.872 INFO - Done: [send keys: 16 [[FirefoxDriver: firefox on LINUX (cf0c8120-4c1d-4466-bd
5f-c7cb104dcccb)] -> xpath: //input[@id="budget_period_description"]], [T, e, s, t,  , b, u, d, g
, e, t, 2]]
03:49:22.875 INFO - Executing: [find element: By.xpath: /html/body/div[4]/div/div[1]/div/form/fie
ldset[1]/ol/li[5]/input])
03:49:22.914 INFO - Done: [find element: By.xpath: /html/body/div[4]/div/div[1]/div/form/fieldset
[1]/ol/li[5]/input]
03:49:22.917 INFO - Executing: [click: 17 [[FirefoxDriver: firefox on LINUX (cf0c8120-4c1d-4466-b
d5f-c7cb104dcccb)] -> xpath: /html/body/div[4]/div/div[1]/div/form/fieldset[1]/ol/li[5]/input]])
03:49:23.148 WARN - Exception thrown
org.openqa.selenium.WebDriverException: Element is not clickable at point (341.70001220703125, 47
6.8999938964844). Other element would receive the click: <td class=" ui-datepicker-week-end " dat
a-handler="selectDay" data-event="click" data-month="6" data-year="2017"></td>
Command duration or timeout: 81 milliseconds

I'll attach my patch, but this is Failed QA. :(
Comment 4 Mark Tompsett 2017-10-30 04:02:32 UTC
Created attachment 68828 [details] [review]
Bug 19183: Change to use ENV, fix login and passwords

The kohadevbox has admin/admin set, so for testing when
creating the initial superuser, if you wish to minimize
effort, use admin/admin. Otherwise, make sure to:
export KOHA_USER={whatever your user is}
export KOHA_PASS={whatever your password is}
before attempting to run the test.

Also, this test was failing because of a validation check on
the passwords requiring uppercase letters, lowercase letters,
and numbers. Changed the sample data passwords to fix.
Comment 5 Jonathan Druart 2017-10-30 13:36:12 UTC
Blocked by bug 19243. We need to find a clean way to continue.
Comment 6 Jonathan Druart 2020-04-20 07:36:08 UTC
The tests need to be rewritten completely.