This patch reuses the method newly added to Selenium.pm and improve
existing tests.
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
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.
Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
This selenium test goes through the process of creating a category and
patron user (as is completed in the basic_workflow.t test) then the
superlibrarian used to create them is logged out and the newly created
patron user authenticates into the OPAC and staff intranet therefore testing the
authenitcation of both.
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 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 et 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. sudo koha-shell <instancename>
20. perl t/db_dependent/selenium/authenticate.t
21. 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
https://bugs.koha-community.org/show_bug.cgi?id=19181
Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Element id=doc does not longer exist on the admin home page
The "main block" need to be localized using the new class 'main
container-fluid'
We will certainly need to improve this later.
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
The tricky part here was to find an alternative for ends-with in Xpath
version 1
Indeed there are 2 button with
"/admin/authorised_values.pl?op=add_form", and the first one was picked
(/admin/authorised_values.pl?op=add_form&category=Asort1)
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
To make it reusable easily.
Test plan:
The basic_workflow.t tests should still pass after this change.
Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Test plan:
1) Insert some value to staffBaseURL preference, without starting http://
2) Apply the patch
3) Update database
4) Go to system preferences adminsitration, find the staffBaseURL
preference, the inserted value should be prepended with 'http://' and
the comment should be "This should be a complete URL, starting with
http:// or https://. Do not include a trailing slash in the URL. (This
must be filled in correctly for CAS, svc, and load_testing to work.)"
5) prove t/db_dependent/Auth_with_cas.t
6) prove t/db_dependent/selenium/basic_workflow.t
7) prove t/db_dependent/check_sysprefs.t
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
This patch makes the basic_workflow.t selenium tests read ENV for the
following vars:
KOHA_USER
KOHA_PASS
KOHA_INTRANET_URL
SELENIUM_ADDR
SELENIUM_PORT
to properly configure the running environment. If absent, all variables
fallback to current behaviour:
KOHA_USER // 'koha'
KOHA_PASS // 'koha'
KOHA_INTRANET_URL (unchanged)
SELENIUM_ADDR // 'localhost'
SELENIUM_PORT // 4444
[*] Selenium defaults are documented on the Selenium::Remote::Driver docs.
Prerequisites:
Make sure you have a working environment for the Selenium tests:
- Run:
$ sudo apt update
$ sudo apt install xvfb firefox-esr
To test:
- Run:
$ sudo koha-shell kohadev
k$ cd kohaclone
k$ wget https://selenium-release.storage.googleapis.com/2.53/selenium-server-standalone-2.53.1.jar \
-O /tmp/selenium.jar
k$ SELENIUM_PATH=/tmp/selenium.jar
k$ Xvfb :1 -screen 0 1024x768x24 2>&1 >/dev/null &
k$ DISPLAY=:1 java -jar $SELENIUM_PATH &
k$ prove t/db_dependent/selenium/basic_workflow.t
=> SUCCESS: Tests pass
- Apply this patch
- Run:
k$ prove t/db_dependent/selenium/basic_workflow.t
=> SUCCESS: Tests pass!
- Sign off :-D
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
No need to have a default circ cule, we create one for the categorycode
and itemtype we are going to use.
The 3 checkouts will not be rejected (5 are allowed)
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Otherwise it is not selected in the dropdown list and the patron created
does not belong to this category
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
That way we do not need to set the syspref, we can define it setting an
env var, like other tests.
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Hard to say here, select2 adds so many elements that we need to ignore.
Here we just assume that input text with an id starting with
tag_952_subfield must be filled
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Lee Jamison <ldjamison@marywood.edu>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
We do not want these tests to fail if the module is not installed.
This module is not in the dependencies of Koha and it is good as it.
A developper who wants to use it will know what to do.
It is part of RM duties to make sure these tests pass
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Lee Jamison <ldjamison@marywood.edu>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
To test:
Run the tests
t/db_dependent/selenium/basic_workflow.t
After you have set up selenium following the tests in the previous patch
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
This script has been used to compare 3.16.x and 3.18.x performances on
bug 13690.
What it does:
- Go on the mainpage and process a log in
- Create a patron category
- Create a patron
- Add 3 items
- check the 3 items out to the patron
- check the 3 items in
How to use it?
$ wget https://selenium-release.storage.googleapis.com/2.53/selenium-server-standalone-2.53.0.jar
$ vim /etc/apt/sources.list.d/firefox.list
deb http://packages.linuxmint.com debian import
$ apt-get update
$ apt-get install firefox
$ sudo apt-get install xvfb
$ SELENIUM_PATH=/home/koha/tools/selenium-server-standalone-2.53.0.jar
$ Xvfb :1 -screen 0 1024x768x24 2>&1 >/dev/null &
$ DISPLAY=:1 java -jar $SELENIUM_PATH
perl t/db_dependent/selenium/basic_workflow.t
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Note the pages have changed so the tests will not all pass.
Also you need Selenium::Remote::Driver installed and staffClientBaseURL
must be set
I will change the tests in a follow up patch.
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>