Browse Source

Adding selenium tests for filterMembers

3.2.x
Henri-Damien LAURENT 12 years ago
parent
commit
7a2efb285d
  1. 2
      selenium/KohaTests
  2. 82
      selenium/Members/filter_members
  3. 30
      selenium/PERL/Members/FilterMembers.pl

2
selenium/KohaTests

@ -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
selenium/Members/filter_members

@ -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
selenium/PERL/Members/FilterMembers.pl

@ -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");
Loading…
Cancel
Save