From 6aff71af4b97b6076d750e87f424d3ceb516e55d Mon Sep 17 00:00:00 2001 From: Henri-Damien LAURENT Date: Fri, 28 Aug 2009 23:47:43 +0200 Subject: [PATCH] Adding Selenium tests for Members --- selenium/KohaTests | 16 ++++++ selenium/Members/AddMember | 72 +++++++++++++++++++++++++++ selenium/Members/DeletMember | 32 ++++++++++++ selenium/Members/SearchMember | 67 +++++++++++++++++++++++++ selenium/PERL/Members/AddMember.pl | 24 +++++++++ selenium/PERL/Members/Searchmember.pl | 25 ++++++++++ 6 files changed, 236 insertions(+) create mode 100644 selenium/KohaTests create mode 100644 selenium/Members/AddMember create mode 100644 selenium/Members/DeletMember create mode 100644 selenium/Members/SearchMember create mode 100644 selenium/PERL/Members/AddMember.pl create mode 100644 selenium/PERL/Members/Searchmember.pl diff --git a/selenium/KohaTests b/selenium/KohaTests new file mode 100644 index 0000000000..9c5ba199a1 --- /dev/null +++ b/selenium/KohaTests @@ -0,0 +1,16 @@ + + + + + + Test Suite + + + + + + + +
Test Suite
Enregistrement Lecteur
Recherche Lecteur
DeletMember
+ + diff --git a/selenium/Members/AddMember b/selenium/Members/AddMember new file mode 100644 index 0000000000..75921691b5 --- /dev/null +++ b/selenium/Members/AddMember @@ -0,0 +1,72 @@ + + + + + + +Enregistrement Lecteur + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Enregistrement Lecteur
open/cgi-bin/koha/members/memberentry.pl?op=add&categorycode=PERS
typesurnameCocteau
typefirstnameJean
typedateofbirth12/02/1967
clicksex-male
selectbtitlelabel=Mr
typeaddress123, rue de la gaieté
typecityMarseille
typecardnumber123141
clickAndWaitsave
assertTextPresentMr Jean Cocteau (123141)
+ + diff --git a/selenium/Members/DeletMember b/selenium/Members/DeletMember new file mode 100644 index 0000000000..09a41acf75 --- /dev/null +++ b/selenium/Members/DeletMember @@ -0,0 +1,32 @@ + + + + + + +DeletMember + + + + + + + + + + + + + + + + + + + + + + +
DeletMember
click//li[4]/span/span/button
clicklink=Delete
assertConfirmationAre you sure you want to delete this patron? This cannot be undone.
+ + diff --git a/selenium/Members/SearchMember b/selenium/Members/SearchMember new file mode 100644 index 0000000000..c1f2a1b503 --- /dev/null +++ b/selenium/Members/SearchMember @@ -0,0 +1,67 @@ + + + + + + +Recherche Lecteur + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Recherche Lecteur
open/cgi-bin/koha/members/members-home.pl
typesearchmemberCocteau
clickAndWait//input[@value='Search']
assertTextsearchheaderResults 1 to 1 of 1 found for 'Cocteau'
typesearchmember123141
selectsearchorderbylabel=Cardnumber
clickAndWait//input[@value='Search']
assertTextsearchheaderResults 1 to 1 of 1 found for '123141'
clickAndWaitlink=Cocteau, Jean
assertTextPresentJean Cocteau (123141)
+ + diff --git a/selenium/PERL/Members/AddMember.pl b/selenium/PERL/Members/AddMember.pl new file mode 100644 index 0000000000..a9d43dd088 --- /dev/null +++ b/selenium/PERL/Members/AddMember.pl @@ -0,0 +1,24 @@ +use strict; +use warnings; +use Time::HiRes qw(sleep); +use Test::WWW::Selenium; +use Test::More "no_plan"; +use Test::Exception; + +my $sel = Test::WWW::Selenium->new( host => "localhost", + port => 4444, + browser => "*chrome", + browser_url => "http://change-this-to-the-site-you-are-testing/" ); + +$sel->open_ok("/cgi-bin/koha/members/memberentry.pl?op=add&categorycode=PERS"); +$sel->type_ok("surname", "Cocteau"); +$sel->type_ok("firstname", "Jean"); +$sel->type_ok("dateofbirth", "12/02/1967"); +$sel->click_ok("sex-male"); +$sel->select_ok("btitle", "label=Mr"); +$sel->type_ok("address", "123, rue de la gaieté"); +$sel->type_ok("city", "Marseille"); +$sel->type_ok("cardnumber", "123141"); +$sel->click_ok("save"); +$sel->wait_for_page_to_load_ok("30000"); +$sel->is_text_present_ok("Mr Jean Cocteau (123141)"); diff --git a/selenium/PERL/Members/Searchmember.pl b/selenium/PERL/Members/Searchmember.pl new file mode 100644 index 0000000000..d24efd0dd7 --- /dev/null +++ b/selenium/PERL/Members/Searchmember.pl @@ -0,0 +1,25 @@ +use strict; +use warnings; +use Time::HiRes qw(sleep); +use Test::WWW::Selenium; +use Test::More "no_plan"; +use Test::Exception; + +my $sel = Test::WWW::Selenium->new( host => "localhost", + port => 4444, + browser => "*chrome", + browser_url => "http://change-this-to-the-site-you-are-testing/" ); + +$sel->open_ok("/cgi-bin/koha/members/members-home.pl"); +$sel->type_ok("searchmember", "Cocteau"); +$sel->click_ok("//input[\@value='Search']"); +$sel->wait_for_page_to_load_ok("30000"); +$sel->text_is("searchheader", "Results 1 to 1 of 1 found for 'Cocteau'"); +$sel->type_ok("searchmember", "123141"); +$sel->select_ok("searchorderby", "label=Cardnumber"); +$sel->click_ok("//input[\@value='Search']"); +$sel->wait_for_page_to_load_ok("30000"); +$sel->text_is("searchheader", "Results 1 to 1 of 1 found for '123141'"); +$sel->click_ok("link=Cocteau, Jean"); +$sel->wait_for_page_to_load_ok("30000"); +$sel->is_text_present_ok(""); -- 2.39.5