Bug 18974 - Cataloging MARC21 record and adding item selenium test
Summary: Cataloging MARC21 record and adding item selenium test
Status: BLOCKED
Alias: None
Product: Koha
Classification: Unclassified
Component: Test Suite (show other bugs)
Version: master
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Alex Buckley
QA Contact: Testopia
URL:
Whiteboard:
Keywords:
Depends on: 19243
Blocks: 19384
  Show dependency treegraph
 
Reported: 2017-07-23 11:01 UTC by Alex Buckley
Modified: 2017-11-02 03:17 UTC (History)
3 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Bot Control: ---
When did the bot last check this:
Who signed the patch off:
Text to go in the release notes:


Attachments
Selenium test for logging into the Koha intranet and OPAC` (7.25 KB, patch)
2017-07-23 11:05 UTC, Alex Buckley
Details | Diff | Splinter Review
Bug 18974 - Selenium test for searching for an item in the intranet and opac (9.26 KB, patch)
2017-07-23 11:06 UTC, Alex Buckley
Details | Diff | Splinter Review
Bug 18974 - Selenium test for creating a currency, budget and fund (7.18 KB, patch)
2017-07-26 02:11 UTC, Alex Buckley
Details | Diff | Splinter Review
Bug 18974 - Selenium test for purchase workflow (12.04 KB, patch)
2017-08-06 06:20 UTC, Alex Buckley
Details | Diff | Splinter Review
Bug 18974 - Selenium test for purchase workflow (12.50 KB, patch)
2017-08-10 23:26 UTC, Alex Buckley
Details | Diff | Splinter Review
Bug 18974 - Added selenium test for the Koha web installer and onboarding tool (5.61 KB, patch)
2017-08-17 22:09 UTC, Alex Buckley
Details | Diff | Splinter Review
Bug 18974 - Selenium test for cataloguing MARC21 records and adding items (6.91 KB, patch)
2017-08-18 04:10 UTC, Alex Buckley
Details | Diff | Splinter Review
Bug 18974 - Selenium test for cataloguing MARC21 records and adding items (9.03 KB, patch)
2017-08-27 04:56 UTC, Alex Buckley
Details | Diff | Splinter Review
Bug 18974 - Selenium test for cataloguing MARC21 records and adding items (9.08 KB, patch)
2017-10-30 03:08 UTC, M. Tompsett
Details | Diff | Splinter Review
Bug 18974: Change to use ENV variables and fix login bug (1.90 KB, patch)
2017-10-30 03:08 UTC, M. 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-07-23 11:01:24 UTC
The patches attached to this bug report will be building on the work completed in bug 13691, and 18804 by adding more selenium tests to the t/db_dependent/selenium directory.

These selenium tests will test the following:
* Authenticating a patron (not default user) into both OPAC and intranet
* Searching for item in OPAC and intranet 
* Go through web installer and onboarding tool
* Submitting a purchase suggestion in OPAC 
* Creating a currency, budget and fund
Comment 1 Alex Buckley 2017-07-23 11:05:39 UTC
Created attachment 65193 [details] [review]
Selenium test for logging into the Koha intranet and OPAC`
Comment 2 Alex Buckley 2017-07-23 11:06:07 UTC
Created attachment 65194 [details] [review]
Bug 18974 - Selenium test for searching for an item in the intranet and opac
Comment 3 Alex Buckley 2017-07-26 02:11:23 UTC
Created attachment 65265 [details] [review]
Bug 18974 - Selenium test for creating a currency, budget and fund
Comment 4 Alex Buckley 2017-08-06 06:20:53 UTC
Created attachment 65522 [details] [review]
Bug 18974 - Selenium test for purchase workflow

This test covers the creation of purchase suggestion in the OPAC,
creation of vendor, basket and the creation of the order from the
suggested item
Comment 5 Alex Buckley 2017-08-10 23:26:21 UTC
Created attachment 65867 [details] [review]
Bug 18974 - Selenium test for purchase workflow

This test covers the creation of purchase suggestion in the OPAC.
The approval of that purchase suggestion in the intranet and then the
creation of vendor, basket and the creation of the order from the
suggested item

Test plan:
1. Make sure you have a superlibrarian patron with the name koha and
password koha

2. Make sure you have an active budget and fund both with a value of
greater than 0

3. Make sure you set the staffClientBaseURL and OPACBaseURL to their
appropriate values for your environment. If you are testing using
Kohadevbox then the corrext values for these sysprefs is localhost:8080
and http://localhost:80 respectively

4. Ensure you have your selenium service running

5. Navigate to t/db_dependent/selenium

6. Enter Koha shell: sudo koha-shell <instancename>

7. perl purachse_workflow.t

8. The test takes a while to excute but notice that all tests pass
Comment 6 Alex Buckley 2017-08-17 22:09:20 UTC
Created attachment 66154 [details] [review]
Bug 18974 - Added selenium test for the Koha web installer and onboarding tool

Test plan:
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 in: deb http://packages.linuxmint.com debian import

4. suod apt-get update

5. sudo apt-get install firefox

6. sudo apt-get install xvfb

7. 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

10. In a new terminal restart memcached and drop and recreate the Koha
database

11. sudo koha-shell kohadev

12. perl t/db_dependent/selenium/installkoha.t

13. Notice the db errors saying that database tables do not exist

14. Notice the CP test output messages stating what the test is doing
Comment 7 Alex Buckley 2017-08-18 04:10:50 UTC
Created attachment 66163 [details] [review]
Bug 18974 - Selenium test for cataloguing MARC21 records and adding items
Comment 8 Alex Buckley 2017-08-27 04:56:32 UTC
Created attachment 66509 [details] [review]
Bug 18974 - Selenium test for cataloguing MARC21 records and adding items

This Selenium test performs the cataloging workflow starting on the
intranets home page and then using z39.50 targets to add a MARC record.
After that items are added to the MARC record

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 vartiable:
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
shutdown 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 et up for running the
selenium tests

17. Drop and recreate you Koha database and restart memcached

18. Go through the web installer (installing sample z39.50 targets) and
the onboarding tool

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

20. 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

21. sudo koha-shell <instancename>

22. perl t/db_dependent/selenium/cataloging_workflow.t

23. 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 9 M. Tompsett 2017-10-30 03:08:26 UTC
Created attachment 68816 [details] [review]
Bug 18974 - Selenium test for cataloguing MARC21 records and adding items

This Selenium test performs the cataloging workflow starting on the
intranets home page and then using z39.50 targets to add a MARC record.
After that items are added to the MARC record

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 vartiable:
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
shutdown 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 et up for running the
selenium tests

17. Drop and recreate you Koha database and restart memcached

18. Go through the web installer (installing sample z39.50 targets) and
the onboarding tool

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

20. 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

21. sudo koha-shell <instancename>

22. perl t/db_dependent/selenium/cataloging_workflow.t

23. 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

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Comment 10 M. Tompsett 2017-10-30 03:08:29 UTC
Created attachment 68817 [details] [review]
Bug 18974: Change to use ENV variables and fix login bug

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.

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Comment 11 M. Tompsett 2017-10-30 03:12:01 UTC
The maintainability of this code is really difficult, because the xpath's used are cryptic. I would recommend adding less cryptic xpath's (id based) and/or comments describing what is being clicked or filled in. I'll let QA'rs decide if it is Failed QA for this.
Comment 12 Jonathan Druart 2017-10-30 13:35:52 UTC
Blocked by bug 19243. We need to find a clean way to continue.