[% END %]
[% IF ( attribute_type_form ) %]
[% IF ( edit_attribute_type ) %]
› Modify patron attribute type
@@ -210,7 +210,7 @@ $(document).ready(function() {
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/smart-rules.tt
+++ a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/smart-rules.tt
@@ -113,7 +113,7 @@ $(document).ready(function() {
[% INCLUDE 'header.inc' %]
[% INCLUDE 'prefs-admin-search.inc' %]
-
@@ -399,7 +399,7 @@ $(document).ready(function() {
- Save
+ Save
Clear
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/z3950servers.tt
+++ a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/z3950servers.tt
@@ -93,7 +93,7 @@
[% INCLUDE 'header.inc' %]
[% INCLUDE 'z3950-admin-search.inc' %]
-
--- a/t/db_dependent/selenium/administration_tasks.t
+++ a/t/db_dependent/selenium/administration_tasks.t
@@ -38,6 +38,10 @@ my $password = 'koha';
my $base_url= 'http://'.C4::Context->preference("staffClientBaseURL")."/cgi-bin/koha/";
my $opac_url= C4::Context->preference("OPACBaseURL");
+BEGIN {
+ my $debug = $ENV{DEBUG};
+}
+
my $number_of_biblios_to_insert = 0;
our $sample_data = {
category => {
@@ -77,18 +81,16 @@ SKIP: {
t::lib::Selenium::time_diff($prev_time, "main");
# Navigate to the Administration area and create an item type
- $driver->find_element('//a[@href="/cgi-bin/koha/admin/admin-home.pl"]')->click;
+ $driver->find_element('//a[@id="administration"]')->click;
# t::lib::Selenium::pause_driver($driver, '/html/body/div[4]/div/div/div[2]/div[1]/dl[1]/dt[2]/a');
-# $driver->pause(20000);
$driver->pause(20000);
-# $driver->find_element_by_xpath('/html/body/div[4]/div/div/div[2]/div[1]/dl[1]/dt[2]/a')->click;
-# $$driver->find_element_by_xpath('/html/body/div[4]/div/div/div[2]/div[1]/dl[1]/dt[2]/a')->click;
+ $driver->find_element('//a[@id="itemtypes"]')->click;
$driver->pause(20000);
$driver->find_element('//a[@id="newitemtype"]')->click;
$driver->pause(20000);
$driver->find_element('//input[@id="itemtype"]')->send_keys("DVD");
$driver->find_element('//input[@id="description"]')->send_keys("Digital Optical Disc");
- $driver->find_element_by_xpath('/html/body/div[4]/div/div[1]/div/form/fieldset[2]/input')->click;
+ $driver->find_element('//input[@id="save"]')->click;
if ( $driver->find_element('//a[@href="/cgi-bin/koha/admin/itemtypes.pl?op=add_form&itemtype=DVD"]')) {
t::lib::Selenium::time_diff($prev_time, "Item type successfully added");
} else {
@@ -96,60 +98,55 @@ SKIP: {
}
# Add circulation/fine rules
- $driver->pause(20000);
- $driver->find_element('//input[@href="/cgi-bin/koha/admin/admin-home.pl"]')->click;
- $driver->pause(20000);
- $driver->find_element_by_xpath('/html/body/div[4]/div/div/div[2]/div[1]/dl[2]/dt[2]/a')->click;
- $driver->pause(20000);
- $driver->find_element_by_xpath('/html/body/div[4]/div/div[1]/div/div[2]/form[3]/table/tbody/tr[2]/td[3]/input')->send_keys("5");
- $driver->find_element_by_xpath('/html/body/div[4]/div/div[1]/div/div[2]/form[3]/table/tbody/tr[2]/td[4]/input')->send_keys("4");
- $driver->find_element_by_xpath('/html/body/div[4]/div/div[1]/div/div[2]/form[3]/table/tbody/tr[2]/td[16]/input')->send_keys("4");
- $driver->find_element_by_xpath('/html/body/div[4]/div/div[1]/div/div[2]/form[3]/table/tbody/tr[2]/td[17]/input')->send_keys("10");
- $driver->find_element_by_xpath('/html/body/div[4]/div/div[1]/div/div[2]/form[3]/table/tbody/tr[2]/td[22]/input')->send_keys("4");
- $driver->find_element_by_xpath('/html/body/div[4]/div/div[1]/div/div[2]/form[3]/table/tbody/tr[2]/td[23]/input')->send_keys("4");
- $driver->find_element_by_xpath('/html/body/div[4]/div/div[1]/div/div[2]/form[3]/table/tbody/tr[2]/td[28]/button[1]')->click;
+ $driver->find_element('//a[@id="administration"]')->click;
+ $driver->find_element('//a[@id="circulationrules"]')->click;
+ $driver->pause(20000);
+ $driver->find_element('//input[@id="maxissueqty"]')->send_keys("5");
+ $driver->find_element('//input[@id="maxonsiteissueqty"]')->send_keys("4");
+ $driver->find_element('//input[@id="renewalsallowed"]')->send_keys("4");
+ $driver->find_element('//input[@id="renewalperiod"]')->send_keys("10");
+ $driver->find_element('//input[@id="reservesallowed"]')->send_keys("4");
+ $driver->find_element('//input[@id="holds_per_record"]')->send_keys("4");
+ $driver->find_element('//button[@id="save"]')->click;
t::lib::Selenium::time_diff($prev_time, "Circulation rule added");
# Modify frameworks
$driver->pause(20000);
- $driver->find_element_by_xpath('/html/body/div[3]/a[2]')->click;
+ $driver->find_element('//a[@id="administration"]')->click;
$driver->pause(20000);
- $driver->find_element_by_xpath('/html/body/div[4]/div/div/div[2]/div[2]/dl[1]/dt[1]/a')->click;
+ $driver->find_element('//a[@id="marcframework"]')->click;
$driver->pause(20000);
- $driver->find_element_by_xpath('/html/body/div[4]/div/div[1]/div/div[2]/table/tbody/tr[5]/td[3]/div/a')->click;
- $driver->find_element_by_xpath('/html/body/div[4]/div/div[1]/div/div[2]/table/tbody/tr[5]/td[3]/div/ul/li[1]/a')->click;
+ $driver->find_element('//a[@id="frameworkactionsFA"]')->click;
+ $driver->find_element('//a[@href="marctagstructure.pl?frameworkcode=FA"]')->click;
$driver->pause(20000);
- $driver->find_element_by_xpath('/html/body/div[4]/div/div[1]/div/div[2]/table/tbody/tr[3]/td[6]/div/a')->click;
- $driver->find_element_by_xpath('/html/body/div[4]/div/div[1]/div/div[2]/table/tbody/tr[3]/td[6]/div/ul/li[3]/a')->click;
+ $driver->find_element('//a[@id="marctagactions010"]')->click;
+ $driver->find_element('//a[@href="/cgi-bin/koha/admin/marctagstructure.pl?op=delete_confirm&searchfield=010&frameworkcode=FA"]')->click;
$driver->pause(20000);
- $driver->find_element_by_xpath('/html/body/div[4]/div/div[1]/div/div/form[1]/button')->click;
- $driver->find_element_by_xpath('/html/body/div[4]/div/div[1]/div/div/form/button')->click;
+ $driver->find_element('//button[@class="approve"]')->click;
+ $driver->find_element('//button[@class="approve"]')->click;
$driver->pause(20000);
- $driver->find_element_by_xpath('/html/body/div[4]/div/div[1]/div/div[1]/a')->click;
+ $driver->find_element('//a[@id="addtag"]')->click;
$driver->pause(20000);
- $driver->find_element_by_xpath('/html/body/div[4]/div/div[1]/div/form/fieldset[1]/ol/li[1]/input')->send_keys("092");
- $driver->find_element_by_xpath('/html/body/div[4]/div/div[1]/div/form/fieldset[1]/ol/li[2]/input')->send_keys("Local Dewey");
- $driver->find_element_by_xpath('/html/body/div[4]/div/div[1]/div/form/fieldset[1]/ol/li[3]/input')->send_keys("Local Dewey");
- $driver->find_element_by_xpath('/html/body/div[4]/div/div[1]/div/form/fieldset[2]/input')->click;
+ $driver->find_element('//input[@id="tagfield"]')->send_keys("092");
+ $driver->find_element('//input[@id="liblibrarian"]')->send_keys("Local Dewey");
+ $driver->find_element('//input[@id="libopac"]')->send_keys("Local Dewey");
+ $driver->find_element('//input[@id="save"]')->click;
$driver->pause(20000);
t::lib::Selenium::time_diff($prev_time, "Added subfield to framework");
#Add library
- $driver->get_title();
- $driver->find_element_by_xpath('/html/body/div[2]/h1/a')->click;
- $driver->pause(20000);
- $driver->find_element_by_xpath('/html/body/div[4]/div/div[1]/div/div[1]/div[2]/div/ul/li[5]/a')->click;
+ $driver->find_element('//a[@id="administration"]')->click;
$driver->pause(20000);
- $driver->find_element_by_xpath('/html/body/div[4]/div/div/div[2]/div[1]/dl[1]/dt[1]/a')->click;
+ $driver->find_element('//a[@id="libraries"]')->click;
$driver->pause(20000);
- $driver->find_element_by_xpath('/html/body/div[4]/div/div[1]/div/div[1]/a[1]')->click;
+ $driver->find_element('//a[@id="newbranch"]')->click;
$driver->pause(20000);
- $driver->find_element_by_xpath('/html/body/div[4]/div/div[1]/div/form/fieldset[1]/ol/li[1]/input')->send_keys("Test");
- $driver->find_element_by_xpath('/html/body/div[4]/div/div[1]/div/form/fieldset[1]/ol/li[2]/input')->send_keys("Test library");
- $driver->find_element_by_xpath('/html/body/div[4]/div/div[1]/div/form/fieldset[3]/input')->click;
+ $driver->find_element('//input[@id="branchcode"]')->send_keys("Test");
+ $driver->find_element('//input[@id="branchname"]')->send_keys("Test library");
+ $driver->find_element('//input[@id="submit"]')->click;
$driver->pause(20000);
- $driver->find_element_by_xpath('/html/body/div[4]/div/div[1]/div/div[3]/div[1]/div[2]/label/select')->click;
- $driver->find_element_by_xpath('/html/body/div[4]/div/div[1]/div/div[3]/div[1]/div[2]/label/select/option[3]')->click;
+ $driver->find_element('//select[@name="branchest_length"]')->click;
+ $driver->find_element('//option[@value="50"]')->click;
if ($driver->find_element('//td[text()="Test library"]')) {
t::lib::Selenium::time_diff($prev_time, "Library successfully added");
} else {
@@ -158,19 +155,19 @@ SKIP: {
#Add authorised values
- $driver->find_element_by_xpath('/html/body/div[3]/a[2]')->click;
+ $driver->find_element('//a[@id="administration"]')->click;
$driver->pause(20000);
- $driver->find_element_by_xpath('/html/body/div[4]/div/div/div[2]/div[1]/dl[1]/dt[3]/a')->click;
+ $driver->find_element('//a[@id="authorisedvalues"]')->click;
$driver->pause(20000);
- $driver->find_element_by_xpath('/html/body/div[4]/div/div[1]/div/form/select')->click;
- $driver->find_element_by_xpath('/html/body/div[4]/div/div[1]/div/form/select/option[7]')->click;
+ $driver->find_element('//select[@id="searchfield"]')->click;
+ $driver->find_element('//option[@value="CCODE"]')->click;
$driver->pause(20000);
- $driver->find_element_by_xpath('/html/body/div[4]/div/div[1]/div/div[1]/a[1]')->click;
+ $driver->find_element('//a[@id="addauth"]')->click;
$driver->pause(20000);
- $driver->find_element_by_xpath('/html/body/div[4]/div/div[1]/div/form/fieldset[1]/ol/li[2]/input')->send_keys("HBK");
- $driver->find_element_by_xpath('/html/body/div[4]/div/div[1]/div/form/fieldset[1]/ol/li[3]/input')->send_keys("Hardback");
- $driver->find_element_by_xpath('/html/body/div[4]/div/div[1]/div/form/fieldset[1]/ol/li[4]/input')->send_keys("Hardcover");
- $driver->find_element_by_xpath('/html/body/div[4]/div/div[1]/div/form/fieldset[2]/input[2]')->click;
+ $driver->find_element('//input[@id="authorised_value"]')->send_keys("HBK");
+ $driver->find_element('//input[@id="lib"]')->send_keys("Hardback");
+ $driver->find_element('//input[@id="lib_opac"]')->send_keys("Hardcover");
+ $driver->find_element('//input[@id="save"]')->click;
if ($driver->find_element('//td[text()="HBK"]')) {
t::lib::Selenium::time_diff($prev_time, "Authorised value successfully added");
} else {
@@ -178,18 +175,18 @@ SKIP: {
}
#Patron category
- $driver->find_element_by_xpath('/html/body/div[3]/a[2]')->click;
+ $driver->find_element('//a[@id="administration"]')->click;
$driver->pause(20000);
- $driver->find_element_by_xpath('/html/body/div[4]/div/div/div[2]/div[1]/dl[2]/dt[1]/a')->click;
+ $driver->find_element('//a[@id="categories"]')->click;
$driver->pause(20000);
- $driver->find_element_by_xpath('/html/body/div[4]/div/div[1]/div/div[1]/a')->click;
+ $driver->find_element('//a[@id="newcategory"]')->click;
$driver->pause(20000);
- $driver->find_element_by_xpath('/html/body/div[4]/div/div[1]/div/form/fieldset[1]/ol/li[1]/input')->send_keys("AD");
- $driver->find_element_by_xpath('/html/body/div[4]/div/div[1]/div/form/fieldset[1]/ol/li[2]/input')->send_keys("Adult");
- $driver->find_element_by_xpath("/html/body/div[4]/div/div[1]/div/form/fieldset[1]/ol/li[3]/fieldset/ol/li[1]/input")->send_keys(12);
- $driver->find_element_by_xpath('/html/body/div[4]/div/div[1]/div/form/fieldset[1]/ol/li[10]/select')->click;
- $driver->find_element_by_xpath('/html/body/div[4]/div/div[1]/div/form/fieldset[1]/ol/li[10]/select/option[6]')->click;
- $driver->find_element_by_xpath('/html/body/div[4]/div/div[1]/div/form/fieldset[2]/input')->click;
+ $driver->find_element('//input[@id="categorycode"]')->send_keys("AD");
+ $driver->find_element('//input[@id="description"]')->send_keys("Adult");
+ $driver->find_element('//input[@id="enrolmentperiod"]')->send_keys(12);
+ $driver->find_element('//select[@id="category_type"]')->click;
+ $driver->find_element('//option[@value="P"]')->click;
+ $driver->find_element('//input[@id="save"]')->click;
$driver->pause(20000);
if ($driver->find_element('//td[text()="AD"]')) {
t::lib::Selenium::time_diff($prev_time, "Patron category successfully added");
@@ -198,17 +195,17 @@ SKIP: {
}
#Add patron attribute type
- $driver->find_element_by_xpath('/html/body/div[3]/a[2]')->click;
+ $driver->find_element('//a[@id="administration"]')->click;
$driver->pause(20000);
- $driver->find_element_by_xpath('/html/body/div[4]/div/div/div[2]/div[1]/dl[2]/dt[3]/a')->click;
+ $driver->find_element('//a[@id="attributetypes"]')->click;
$driver->pause(20000);
- $driver->find_element_by_xpath('/html/body/div[4]/div/div[1]/div/div[2]/a')->click;
+ $driver->find_element('//a[@id="newrule"]')->click;
$driver->pause(20000);
- $driver->find_element_by_xpath('/html/body/div[4]/div/div[1]/div/form/fieldset[1]/ol/li[1]/input')->send_keys("DL");
- $driver->find_element_by_xpath('/html/body/div[4]/div/div[1]/div/form/fieldset[1]/ol/li[2]/input')->send_keys("Driver's License");
- $driver->find_element_by_xpath('/html/body/div[4]/div/div[1]/div/form/fieldset[1]/ol/li[11]/select')->click;
- $driver->find_element_by_xpath('/html/body/div[4]/div/div[1]/div/form/fieldset[1]/ol/li[11]/select/option[2]')->click;
- $driver->find_element_by_xpath('/html/body/div[4]/div/div[1]/div/form/fieldset[2]/input')->click;
+ $driver->find_element('//input[@id="code"]')->send_keys("DL");
+ $driver->find_element('//input[@id="description"]')->send_keys("Driver's License");
+ $driver->find_element('//select[@id="category"]')->click;
+ $driver->find_element('//option[@value="BOR_NOTES"]')->click;
+ $driver->find_element('//input[@id="save"]')->click;
$driver->pause(20000);
if ($driver->find_element('//td[text()="DL"]')) {
t::lib::Selenium::time_diff($prev_time, "Patron attribute type successfully added");
@@ -217,19 +214,19 @@ SKIP: {
}
#Add Z39.50 target server
- $driver->find_element_by_xpath('/html/body/div[3]/a[2]')->click;
+ $driver->find_element('//a[@id="administration"]')->click;
$driver->pause(20000);
- $driver->find_element_by_xpath('/html/body/div[4]/div/div/div[2]/div[2]/dl[3]/dt[1]/a')->click;
+ $driver->find_element('//a[@id="z39.50server"]')->click;
$driver->pause(20000);
- $driver->find_element_by_xpath('/html/body/div[4]/div/div[1]/div/div[1]/a[1]')->click;
+ $driver->find_element('//a[@id="newserver"]')->click;
$driver->pause(20000);
- $driver->find_element_by_xpath('/html/body/div[4]/div/div[1]/div/form/fieldset[1]/ol/li[1]/input')->send_keys("University of London");
- $driver->find_element_by_xpath('/html/body/div[4]/div/div[1]/div/form/fieldset[1]/ol/li[2]/input')->send_keys("consull.ull.ac.uk");
- $driver->find_element_by_xpath('/html/body/div[4]/div/div[1]/div/form/fieldset[1]/ol/li[3]/input')->send_keys(210);
- $driver->find_element_by_xpath('/html/body/div[4]/div/div[1]/div/form/fieldset[1]/ol/li[4]/input')->send_keys("INNOPAC");
- $driver->find_element_by_xpath('/html/body/div[4]/div/div[1]/div/form/fieldset[1]/ol/li[9]/select')->click;
- $driver->find_element_by_xpath('/html/body/div[4]/div/div[1]/div/form/fieldset[1]/ol/li[9]/select/option[4]')->click;
- $driver->find_element_by_xpath('/html/body/div[4]/div/div[1]/div/form/fieldset[2]/input')->click;
+ $driver->find_element('//input[@id="servername"]')->send_keys("University of London");
+ $driver->find_element('//input[@id="host"]')->send_keys("consull.ull.ac.uk");
+ $driver->find_element('//input[@id="port"]')->send_keys(210);
+ $driver->find_element('//input[@id="db"]')->send_keys("INNOPAC");
+ $driver->find_element('//select[@id="syntax"]')->click;
+ $driver->find_element('//option[@value="USMARC"]')->click;
+ $driver->find_element('//input[@id="save"]')->click;
$driver->pause(20000);
if ($driver->find_element('//td[text()="consull.ull.ac.uk:210"]')) {
t::lib::Selenium::time_diff($prev_time, "Z39.50 target successfully added");
@@ -238,24 +235,24 @@ SKIP: {
}
#Add item circulation alerts
- $driver->find_element_by_xpath('/html/body/div[3]/a[2]')->click;
+ $driver->find_element('//a[@id="administration"]')->click;
$driver->pause(20000);
- $driver->find_element_by_xpath('/html/body/div[4]/div/div/div[2]/div[1]/dl[2]/dt[6]/a')->click;
+ $driver->find_element('//a[@id="circulationalters"]')->click;
$driver->pause(20000);
- $driver->find_element_by_xpath('/html/body/div[4]/div/div[1]/div/div[2]/div[1]/table/tbody/tr[1]/td[1]')->click;
+ $driver->find_element('//td[@id="B-BK-CHECKOUT"]')->click;
t::lib::Selenium::time_diff($prev_time, "Added item circulation alert");
#Add city
- $driver->find_element_by_xpath('/html/body/div[3]/a[2]')->click;
+ $driver->find_element('//a[@id="administration"]')->click;
$driver->pause(20000);
- $driver->find_element_by_xpath('/html/body/div[4]/div/div/div[2]/div[1]/dl[2]/dt[7]/a')->click;
+ $driver->find_element('//a[@id="cities"]')->click;
$driver->pause(20000);
- $driver->find_element_by_xpath('/html/body/div[4]/div/div[1]/div/div[1]/a')->click;
+ $driver->find_element('//a[@id="newcity"]')->click;
$driver->pause(20000);
- $driver->find_element_by_xpath('/html/body/div[4]/div/div[1]/div/form/fieldset[1]/ol/li[1]/input')->send_keys("Wellington");
- $driver->find_element_by_xpath('/html/body/div[4]/div/div[1]/div/form/fieldset[1]/ol/li[3]/input')->send_keys(6011);
- $driver->find_element_by_xpath('/html/body/div[4]/div/div[1]/div/form/fieldset[1]/ol/li[4]/input')->send_keys("New Zealand");
- $driver->find_element_by_xpath('/html/body/div[4]/div/div[1]/div/form/fieldset[2]/input')->click;
+ $driver->find_element('//input[@id="city_name"]')->send_keys("Wellington");
+ $driver->find_element('//input[@id="city_zipcode"]')->send_keys(6011);
+ $driver->find_element('//input[@id="city_country"]')->send_keys("New Zealand");
+ $driver->find_element('//input[@id="submit"]')->click;
$driver->pause(20000);
if ($driver->find_element('//td[text()="Wellington"]')) {
t::lib::Selenium::time_diff($prev_time, "City successfully added");
--