Skip to content

Commit

Permalink
Adding selenium tests for filterMembers
Browse files Browse the repository at this point in the history
  • Loading branch information
laurenthdl committed Sep 30, 2009
1 parent dadd030 commit 7a2efb2
Show file tree
Hide file tree
Showing 3 changed files with 114 additions and 0 deletions.
2 changes: 2 additions & 0 deletions selenium/KohaTests
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
<tr><td><a href="Members/AddMember">Enregistrement Lecteur</a></td></tr>
<tr><td><a href="Members/SearchMember">Recherche Lecteur</a></td></tr>
<tr><td><a href="Members/DeletMember">DeletMember</a></td></tr>
<tr><td><a href="Members/EditMember">EditMember</a></td></tr>
<tr><td><a href="filter_members">filter_members</a></td></tr>
</tbody></table>
</body>
</html>
82 changes: 82 additions & 0 deletions selenium/Members/filter_members
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head profile="http://selenium-ide.openqa.org/profiles/test-case">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link rel="selenium.base" href="" />
<title>filter_members</title>
</head>
<body>
<table cellpadding="1" cellspacing="1" border="1">
<thead>
<tr><td rowspan="1" colspan="3">filter_members</td></tr>
</thead><tbody>
<tr>
<td>open</td>
<td>/cgi-bin/koha/mainpage.pl</td>
<td></td>
</tr>
<tr>
<td>clickAndWait</td>
<td>//div[@id='yui-main']/div/div/div[1]/h3[2]/a</td>
<td></td>
</tr>
<tr>
<td>clickAndWait</td>
<td>link=C</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>memberresultst</td>
<td></td>
</tr>
<tr>
<td>select</td>
<td>branchcode</td>
<td>label=Bibliothèque de Luminy</td>
</tr>
<tr>
<td>clickAndWait</td>
<td>//div[@id='bd']/div[2]/form/input[3]</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>memberresultst</td>
<td></td>
</tr>
<tr>
<td>select</td>
<td>categorycode</td>
<td>label=Etudiant niveau M</td>
</tr>
<tr>
<td>clickAndWait</td>
<td>//div[@id='bd']/div[2]/form/input[3]</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>memberresultst</td>
<td></td>
</tr>
<tr>
<td>type</td>
<td>//input[@name='member' and @value='']</td>
<td>cas</td>
</tr>
<tr>
<td>clickAndWait</td>
<td>//div[@id='bd']/div[2]/form/input[3]</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>memberresultst</td>
<td></td>
</tr>

</tbody></table>
</body>
</html>
30 changes: 30 additions & 0 deletions selenium/PERL/Members/FilterMembers.pl
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
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/mainpage.pl");
$sel->click_ok("//div[\@id='yui-main']/div/div/div[1]/h3[2]/a");
$sel->wait_for_page_to_load_ok("30000");
$sel->click_ok("link=C");
$sel->wait_for_page_to_load_ok("30000");
$sel->is_element_present_ok("memberresultst");
$sel->select_ok("branchcode", "label=Bibliothèque de Luminy");
$sel->click_ok("//div[\@id='bd']/div[2]/form/input[3]");
$sel->wait_for_page_to_load_ok("30000");
$sel->is_element_present_ok("memberresultst");
$sel->select_ok("categorycode", "label=Etudiant niveau M");
$sel->click_ok("//div[\@id='bd']/div[2]/form/input[3]");
$sel->wait_for_page_to_load_ok("30000");
$sel->is_element_present_ok("memberresultst");
$sel->type_ok("//input[\@name='member' and \@value='']", "cas");
$sel->click_ok("//div[\@id='bd']/div[2]/form/input[3]");
$sel->wait_for_page_to_load_ok("30000");
$sel->is_element_present_ok("memberresultst");

0 comments on commit 7a2efb2

Please sign in to comment.