Modified advertising test to be complete test.

This commit is contained in:
Daniel Maldonado 2012-07-05 13:11:55 -04:00 committed by Scott Walters
parent 0bc252b179
commit cd5f29f5dc
10 changed files with 120 additions and 68 deletions

View file

@ -19,7 +19,7 @@ Download the Selenium server from: http://seleniumhq.org/download/)
Running the Selenium Server (run in a separate command line/window)
java -jar selenium-server-standalone-2.24.1.jar
The -browserSessionReuse is to keep the selenium session open so you may troubleshoot page issues
The -browserSessionReuse is to keep the selenium session open so you may troubleshoot page issues (helpful for test writers)
The Selenium software automatically closes the browser when the tests are concluded. If you are writing/troubleshooting tests
and need the browser to remain open use:
java -jar selenium-server-standalone-2.24.1.jar -browserSessionReuse
@ -44,5 +44,21 @@ Download and install the Selenium IDE from: http://seleniumhq.org/projects/ide/
Take a look at the Selenium IDE documentation: http://seleniumhq.org/docs/02_selenium_ide.html
Youtube videos can be quite handy:
http://www.youtube.com/watch?v=MXuhevKqImI
http://www.youtube.com/watch?v=i4NTGUm6oeQ
http://www.youtube.com/results?search_query=selenium+tutorial+for+beginner
http://www.youtube.com/results?search_query=selenium+tutorial+for+beginner
Errors:
$ perl test.pl
1..98
Error requesting http://localhost:4444/selenium-server/driver/:
500 Can't connect to localhost:4444 (Connection refused)
# Looks like your test exited with 61 before it could output anything.
--- this means you forgot to run the Selenium server or you are not running the Selenium server on the same
host:port as specified in your webgui.conf file.
Perl requirements:
Test::WWW::Selenium
Test::WWW::Selenium::HTML

View file

@ -17,11 +17,15 @@
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>verifyElementPresent</td>
<td>css=img[alt=&quot;Delete&quot;]</td>
<td></td>
</tr>
<tr>
<td>clickAndWait</td>
<td>css=img[alt=&quot;Delete&quot;]</td>
<td></td>
</tr>
</tbody></table>
</body>
</html>

View file

@ -11,27 +11,21 @@
<thead>
<tr><td rowspan="1" colspan="3">Addons</td></tr>
</thead><tbody>
<tr>
<td>open</td>
<td>/?op=viewActiveSessions</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>link=Show admin console.</td>
<td></td>
</tr>
<tr>
<td>clickAndWait</td>
<td>css=img[alt=&quot;Addons&quot;]</td>
<td></td>
<td>assertText</td>
<td>link=Addons</td>
<td>Addons</td>
</tr>
<tr>
<td>assertLocation</td>
<td></td>
<td>http://www.webgui.org/addons </td>
</tr>
<tr>
<td>open</td>
<td></td>
<td>/</td>
</tr>
</tbody></table>
</body>
</html>

View file

@ -11,9 +11,74 @@
<thead>
<tr><td rowspan="1" colspan="3">Advertising</td></tr>
</thead><tbody>
<tr>
<td>open</td>
<td>/?op=manageAdSpaces</td>
<td></td>
</tr>
<tr>
<td>clickAndWait</td>
<td>css=img[alt=&quot;Advertising&quot;]</td>
<td>link=Add ad space.</td>
<td></td>
</tr>
<tr>
<td>type</td>
<td>id=name_formId</td>
<td>testAd</td>
</tr>
<tr>
<td>type</td>
<td>id=title_formId</td>
<td>Just a test Ad</td>
</tr>
<tr>
<td>type</td>
<td>id=description_formId</td>
<td>Just a test ad to ...</td>
</tr>
<tr>
<td>clickAndWait</td>
<td>xpath=(//input[@value='save'])[2]</td>
<td></td>
</tr>
<tr>
<td>clickAndWait</td>
<td>link=Manage ad spaces.</td>
<td></td>
</tr>
<tr>
<td>verifyTextPresent</td>
<td>Just a test Ad</td>
<td></td>
</tr>
<tr>
<td>clickAndWait</td>
<td>css=img[alt=&quot;Edit&quot;]</td>
<td></td>
</tr>
<tr>
<td>type</td>
<td>id=title_formId</td>
<td>Just a test Ad (Changed)</td>
</tr>
<tr>
<td>clickAndWait</td>
<td>css=input[type=&quot;submit&quot;]</td>
<td></td>
</tr>
<tr>
<td>verifyTextPresent</td>
<td>Just a test Ad (Changed)</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>css=img[alt=&quot;Delete&quot;]</td>
<td></td>
</tr>
<tr>
<td>assertConfirmation</td>
<td>Are you certain you want to delete this ad space and all the ads attached to it?</td>
<td></td>
</tr>
<tr>
@ -21,7 +86,6 @@
<td>id=application_title</td>
<td>Advertising</td>
</tr>
</tbody></table>
</body>
</html>

View file

@ -12,8 +12,8 @@
<tr><td rowspan="1" colspan="3">Asset History</td></tr>
</thead><tbody>
<tr>
<td>clickAndWait</td>
<td>css=img[alt=&quot;Asset History&quot;]</td>
<td>open</td>
<td>/?op=assetHistory</td>
<td></td>
</tr>
<tr>
@ -21,7 +21,6 @@
<td>id=application_title</td>
<td>Asset History</td>
</tr>
</tbody></table>
</body>
</html>

View file

@ -12,8 +12,8 @@
<tr><td rowspan="1" colspan="3">Cache</td></tr>
</thead><tbody>
<tr>
<td>clickAndWait</td>
<td>css=img[alt=&quot;Cache&quot;]</td>
<td>open</td>
<td>/?op=manageCache</td>
<td></td>
</tr>
<tr>
@ -26,7 +26,6 @@
<td>css=input[type=&quot;button&quot;]</td>
<td></td>
</tr>
</tbody></table>
</body>
</html>

View file

@ -13,12 +13,7 @@
</thead><tbody>
<tr>
<td>open</td>
<td>/?op=viewActiveSessions#</td>
<td></td>
</tr>
<tr>
<td>clickAndWait</td>
<td>css=img[alt=&quot;Clipboard&quot;]</td>
<td>/?func=manageClipboard</td>
<td></td>
</tr>
<tr>
@ -36,7 +31,6 @@
<td>//input[@value='Delete']</td>
<td></td>
</tr>
</tbody></table>
</body>
</html>

View file

@ -1,26 +0,0 @@
<?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="http://webgui.dbash.com/" />
<title>showAdminConsole</title>
</head>
<body>
<table cellpadding="1" cellspacing="1" border="1">
<thead>
<tr><td rowspan="1" colspan="3">showAdminConsole</td></tr>
</thead><tbody>
<tr>
<td>open</td>
<td>/?op=viewActiveSessions</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>link=Show admin console.</td>
<td></td>
</tr>
</tbody></table>
</body>
</html>

View file

@ -9,17 +9,11 @@
<table id="suiteTable" cellpadding="1" cellspacing="1" border="1" class="selenium"><tbody>
<tr><td><b>Test Suite</b></td></tr>
<tr><td><a href="activeSessions.html">Active Sessions</a></td></tr>
<tr><td><a href="showAdminConsole.html">showAdminConsole</a></td></tr>
<tr><td><a href="addons.html">Addons</a></td></tr>
<tr><td><a href="showAdminConsole.html">showAdminConsole</a></td></tr>
<tr><td><a href="advertising.html">Advertising</a></td></tr>
<tr><td><a href="showAdminConsole.html">showAdminConsole</a></td></tr>
<tr><td><a href="assetHistory.html">Asset History</a></td></tr>
<tr><td><a href="showAdminConsole.html">showAdminConsole</a></td></tr>
<tr><td><a href="cache.html">Cache</a></td></tr>
<tr><td><a href="showAdminConsole.html">showAdminConsole</a></td></tr>
<tr><td><a href="clipboard.html">Clipboard</a></td></tr>
<tr><td><a href="showAdminConsole.html">showAdminConsole</a></td></tr>
</tbody></table>
</body>
</html>

View file

@ -1,5 +1,5 @@
#!/usr/bin/perl
use Test::More tests => 98;
use Test::More tests => 159;
use Test::WWW::Selenium;
use Test::WWW::Selenium::HTML;
use WebGUI::Paths -inc;
@ -42,13 +42,13 @@ my $selh = Test::WWW::Selenium::HTML->new( $sel );
$selh->diag_body_text_on_failure(0);
#------------------------- Run All Tests here -----------------------
# Test basic interface links
ok(1, "Login test");
$selh->run(path => "login.html");
ok(1, "Turn On Admin test");
$selh->run(path => "turnOnAdmin.html");
ok(1, "Admin Console tests");
$selh->run(path => "turnOnAdmin.html");
$selh->run(path => "adminConsole.html");
ok(1, "Version Tags tests");
$selh->run(path => "versionTags.html");
ok(1, "Clipboard test");
@ -67,3 +67,17 @@ ok(1, "New Content->Shop tests");
$selh->run(path => "newContentShop.html");
ok(1, "New Content->Utilities tests");
$selh->run(path => "newContentUtilities.html");
#
ok(1, "FRAMELESS->Active Sessions");
$selh->run(path => "frameless/activeSessions.html");
ok(1, "FRAMELESS->Addons");
$selh->run(path => "frameless/addons.html");
ok(1, "FRAMELESS->Advertising");
$selh->run(path => "frameless/advertising.html");
ok(1, "FRAMELESS->Asset History");
$selh->run(path => "frameless/assetHistory.html");
ok(1, "FRAMELESS->Cache");
$selh->run(path => "frameless/cache.html");
ok(1, "FRAMELESS->Clipboard");
$selh->run(path => "frameless/clipboard.html");