[prev in list] [next in list] [prev in thread] [next in thread]
List: selenium-commits
Subject: [Selenium-commits] [613] trunk/code/javascript: Apply Alexander
From: mdub () codehaus ! org
Date: 2005-08-24 12:39:36
Message-ID: 20050824123936.11907.qmail () codehaus ! org
[Download RAW message or body]
[Attachment #2 (text/html)]
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><style type="text/css"><!--
body {background:#ffffff;font-family:Verdana,Helvetica,Arial,sans-serif;}
h3 {margin:15px 0;padding:0;line-height:0;}
#msg {margin: 0 0 2em 0;}
#msg dl, #msg ul, #msg pre {padding:1em;border:1px dashed black;margin: 10px 0 30px \
0;} #msg dl {background:#ccccff;}
#msg pre {background:#ffffcc;}
#msg ul {background:#cc99ff;list-style:none;}
#msg dt {font-weight:bold;float:left;width: 6em;}
#msg dt:after { content:':';}
#patch h4 {padding: 0 \
10px;line-height:1.5em;margin:0;background:#ccffff;border-bottom:1px solid \
black;margin:0 0 10px 0;} #patch .propset h4, #patch .binary h4 {margin: 0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {background:#eeeeee;padding: 0 0 10px 0;}
#patch .propset .diff, #patch .binary .diff {padding: 10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary \
{border:1px solid black;margin:10px 0;} #patch .add {background:#ddffdd;}
#patch .rem {background:#ffdddd;}
#patch .lines, .info {color:#888888;background:#ffffff;}
--></style>
<title>[613] trunk/code/javascript: Apply Alexander Dvoretskiy's patch implementing \
support for window.prompt().</title> </head>
<body>
<div id="msg">
<dl>
<dt>Revision</dt> <dd>613</dd>
<dt>Author</dt> <dd>mdub</dd>
<dt>Date</dt> <dd>2005-08-24 08:39:36 -0400 (Wed, 24 Aug 2005)</dd>
</dl>
<h3>Log Message</h3>
<pre>Apply Alexander Dvoretskiy's patch implementing support for window.prompt().
Closes SEL-141.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkcodejavascriptseleniumapijs">trunk/code/javascript/selenium-api.js</a></li>
<li><a href="#trunkcodejavascriptseleniumbrowserbotjs">trunk/code/javascript/selenium-browserbot.js</a></li>
<li><a href="#trunkcodejavascripttestsTestSuiteInternetExplorerhtml">trunk/code/javascript/tests/TestSuite-InternetExplorer.html</a></li>
<li><a href="#trunkcodejavascripttestsTestSuiteKonquerorhtml">trunk/code/javascript/tests/TestSuite-Konqueror.html</a></li>
<li><a href="#trunkcodejavascripttestsTestSuiteSafarihtml">trunk/code/javascript/tests/TestSuite-Safari.html</a></li>
<li><a href="#trunkcodejavascripttestsTestSuitehtml">trunk/code/javascript/tests/TestSuite.html</a></li>
</ul>
<h3>Added Paths</h3>
<ul>
<li><a href="#trunkcodejavascripttestsTestPromptinghtml">trunk/code/javascript/tests/TestPrompting.html</a></li>
<li><a href="#trunkcodejavascripttestshtmltest_prompthtml">trunk/code/javascript/tests/html/test_prompt.html</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkcodejavascriptseleniumapijs"></a>
<div class="modfile"><h4>Modified: trunk/code/javascript/selenium-api.js (612 => \
613)</h4> <pre class="diff">
<span class="info">--- trunk/code/javascript/selenium-api.js 2005-08-24 10:35:26 UTC \
(rev 612)
+++ trunk/code/javascript/selenium-api.js 2005-08-24 12:39:36 UTC (rev 613)
</span><span class="lines">@@ -99,6 +99,13 @@
</span><span class="cx"> };
/*
</span><span class="add">+ * Instruct Selenium what to answear on the next prompt \
dialog it encounters + */
+Selenium.prototype.doAnswerOnNextPrompt = function(answer) {
+ this.browserbot.setNextPromptResult(answer);
+};
+
+/*
</span><span class="cx"> * Simulate the browser back button
*/
Selenium.prototype.doGoBack = function() {
</span><span class="lines">@@ -149,6 +156,20 @@
</span><span class="cx"> };
/*
</span><span class="add">+ * Asserts that the supplied message was received as a \
prompt + */
+Selenium.prototype.assertPrompt = function(promptPattern) {
+ if (this.browserbot.hasPrompts()) {
+ receivedPrompt = this.browserbot.getNextPrompt();
+ if (! PatternMatcher.matches(promptPattern, receivedPrompt)) {
+ Assert.fail("The prompt message was [" + receivedPrompt + \
"]"); + }
+ } else {
+ Assert.fail("There were no prompts");
+ }
+};
+
+/*
</span><span class="cx"> * Verify the location of the current page.
*/
Selenium.prototype.assertAbsoluteLocation = function(expectedLocation) {
</span></pre></div>
<a id="trunkcodejavascriptseleniumbrowserbotjs"></a>
<div class="modfile"><h4>Modified: trunk/code/javascript/selenium-browserbot.js (612 \
=> 613)</h4> <pre class="diff">
<span class="info">--- trunk/code/javascript/selenium-browserbot.js 2005-08-24 \
10:35:26 UTC (rev 612)
+++ trunk/code/javascript/selenium-browserbot.js 2005-08-24 12:39:36 UTC (rev 613)
</span><span class="lines">@@ -50,8 +50,10 @@
</span><span class="cx"> this.modalDialogTest = null;
this.recordedAlerts = new Array();
this.recordedConfirmations = new Array();
</span><span class="add">+ this.recordedPrompts = new Array();
</span><span class="cx"> this.openedWindows = {};
this.nextConfirmResult = true;
</span><span class="add">+ this.nextPromptResult = '';
</span><span class="cx"> this.newPageLoaded = false;
var self = this;
</span><span class="lines">@@ -95,6 +97,10 @@
</span><span class="cx"> this.nextConfirmResult = false;
};
</span><span class="add">+BrowserBot.prototype.setNextPromptResult = function(result) \
{ + this.nextPromptResult = result;
+};
+
</span><span class="cx"> BrowserBot.prototype.hasAlerts = function() {
return (this.recordedAlerts.length > 0) ;
};
</span><span class="lines">@@ -111,7 +117,14 @@
</span><span class="cx"> return this.recordedConfirmations.shift();
};
</span><span class="add">+BrowserBot.prototype.hasPrompts = function() {
+ return (this.recordedPrompts.length > 0) ;
+};
</span><span class="cx">
</span><span class="add">+BrowserBot.prototype.getNextPrompt = function() {
+ return this.recordedPrompts.shift();
+};
+
</span><span class="cx"> BrowserBot.prototype.getFrame = function() {
return this.frame;
};
</span><span class="lines">@@ -164,6 +177,14 @@
</span><span class="cx"> return result;
};
</span><span class="add">+ windowToModify.prompt = function(message) {
+ browserBot.recordedPrompts.push(message);
+ var result = !browserBot.nextConfirmResult ? null : \
browserBot.nextPromptResult; + browserBot.nextConfirmResult = true;
+ browserBot.nextPromptResult = '';
+ return result;
+ };
+
</span><span class="cx"> // Keep a reference to all popup windows by name
// note that in IE the "windowName" argument must be a valid \
javascript identifier, it seems. var originalOpen = windowToModify.open;
</span></pre></div>
<a id="trunkcodejavascripttestsTestPromptinghtml"></a>
<div class="addfile"><h4>Added: trunk/code/javascript/tests/TestPrompting.html (612 \
=> 613)</h4> <pre class="diff">
<span class="info">--- trunk/code/javascript/tests/TestPrompting.html 2005-08-24 \
10:35:26 UTC (rev 612)
+++ trunk/code/javascript/tests/TestPrompting.html 2005-08-24 12:39:36 UTC (rev 613)
</span><span class="lines">@@ -0,0 +1,82 @@
</span><span class="add">+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 \
Transitional//EN"> +<!--
+Copyright 2004 ThoughtWorks, Inc
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<html>
+<head>
+ <meta content="text/html; charset=ISO-8859-1"
+ http-equiv="content-type">
+ <title>Test Prompting Verifification</title>
+</head>
+<body>
+<table cellpadding="1" cellspacing="1" \
border="1"> + <tbody>
+ <tr>
+ <td rowspan="1" colspan="3">Test verify \
Prompting<br> + </td>
+ </tr>
+
+ <tr>
+ <td>open</td>
+ <td>./tests/html/test_prompt.html</td>
+ <td>&nbsp;</td>
+ </tr>
+ <tr>
+ <td>answerOnNextPrompt</td>
+ <td>no</td>
+ <td></td>
+ </tr>
+ <tr>
+ <td>click</td>
+ <td>promptAndLeave</td>
+ <td></td>
+ </tr>
+ <tr>
+ <td>verifyPrompt</td>
+ <td>Type 'yes' and click OK</td>
+ <td></td>
+ </tr>
+ <tr>
+ <td>verifyTitle</td>
+ <td>Test Prompt</td>
+ <td></td>
+ </tr>
+ <tr>
+ <td>answerOnNextPrompt</td>
+ <td>yes</td>
+ <td></td>
+ </tr>
+ <tr>
+ <td>clickAndWait</td>
+ <td>promptAndLeave</td>
+ <td></td>
+ </tr>
+ <tr>
+ <td>verifyPrompt</td>
+ <td>*'yes'*</td>
+ <td></td>
+ </tr>
+
+ <tr>
+ <td>verifyTitle</td>
+ <td>Dummy Page</td>
+ <td></td>
+ </tr>
+
+
+ </tbody>
+</table>
+</body>
+</html>
</span><span class="cx">Property changes on: \
trunk/code/javascript/tests/TestPrompting.html \
___________________________________________________________________
Name: svn:eol-style
+ native
</span></pre></div>
<a id="trunkcodejavascripttestsTestSuiteInternetExplorerhtml"></a>
<div class="modfile"><h4>Modified: \
trunk/code/javascript/tests/TestSuite-InternetExplorer.html (612 => 613)</h4> <pre \
class="diff"> <span class="info">--- \
trunk/code/javascript/tests/TestSuite-InternetExplorer.html 2005-08-24 10:35:26 UTC \
(rev 612)
+++ trunk/code/javascript/tests/TestSuite-InternetExplorer.html 2005-08-24 12:39:36 \
UTC (rev 613) </span><span class="lines">@@ -57,6 +57,7 @@
</span><span class="cx"> <tr><td><a \
href="./TestFocusOnBlur.html">TestFocusOnBlur</a></td></tr>
<tr><td><a \
href="./TestVerifyAlerts.html">TestVerifyAlerts</a></td></tr>
<tr><td><a \
href="./TestConfirmations.html">TestVerifyConfirmations</a></td></tr>
</span><span class="add">+ <tr><td><a \
href="./TestPrompting.html">TestVerifyPrompt</a></td></tr>
</span><span class="cx"> <tr><td><a \
href="./TestVisibility.html">TestVisibility</a></td></tr>
<tr><td><a \
href="./TestVerifyEditable.html">TestVerifyEditable</a></td></tr>
</span></pre></div>
<a id="trunkcodejavascripttestsTestSuiteKonquerorhtml"></a>
<div class="modfile"><h4>Modified: \
trunk/code/javascript/tests/TestSuite-Konqueror.html (612 => 613)</h4> <pre \
class="diff"> <span class="info">--- \
trunk/code/javascript/tests/TestSuite-Konqueror.html 2005-08-24 10:35:26 UTC (rev \
612)
+++ trunk/code/javascript/tests/TestSuite-Konqueror.html 2005-08-24 12:39:36 UTC (rev \
613) </span><span class="lines">@@ -57,6 +57,7 @@
</span><span class="cx"> <tr><td><a \
href="./TestFocusOnBlur.html">TestFocusOnBlur</a></td></tr>
<tr><td><a \
href="./TestVerifyAlerts.html">TestVerifyAlerts</a></td></tr>
<tr><td><a \
href="./TestConfirmations.html">TestVerifyConfirmations</a></td></tr>
</span><span class="add">+ <tr><td><a \
href="./TestPrompting.html">TestVerifyPrompt</a></td></tr>
</span><span class="cx"> <!-- <tr><td><a \
href="./TestVisibility.html">TestVisibility</a></td></tr>-->
<tr><td><a \
href="./TestVerifyEditable.html">TestVerifyEditable</a></td></tr>
</span></pre></div>
<a id="trunkcodejavascripttestsTestSuiteSafarihtml"></a>
<div class="modfile"><h4>Modified: trunk/code/javascript/tests/TestSuite-Safari.html \
(612 => 613)</h4> <pre class="diff">
<span class="info">--- trunk/code/javascript/tests/TestSuite-Safari.html 2005-08-24 \
10:35:26 UTC (rev 612)
+++ trunk/code/javascript/tests/TestSuite-Safari.html 2005-08-24 12:39:36 UTC (rev \
613) </span><span class="lines">@@ -57,6 +57,7 @@
</span><span class="cx"> <tr><td><a \
href="./TestFocusOnBlur.html">TestFocusOnBlur</a></td></tr>
<tr><td><a \
href="./TestVerifyAlerts.html">TestVerifyAlerts</a></td></tr>
<tr><td><a \
href="./TestConfirmations.html">TestVerifyConfirmations</a></td></tr>
</span><span class="add">+ <tr><td><a \
href="./TestPrompting.html">TestVerifyPrompt</a></td></tr>
</span><span class="cx"> <!-- <tr><td><a \
href="./TestVisibility.html">TestVisibility</a></td></tr>-->
<tr><td><a \
href="./TestVerifyEditable.html">TestVerifyEditable</a></td></tr>
</span></pre></div>
<a id="trunkcodejavascripttestsTestSuitehtml"></a>
<div class="modfile"><h4>Modified: trunk/code/javascript/tests/TestSuite.html (612 => \
613)</h4> <pre class="diff">
<span class="info">--- trunk/code/javascript/tests/TestSuite.html 2005-08-24 10:35:26 \
UTC (rev 612)
+++ trunk/code/javascript/tests/TestSuite.html 2005-08-24 12:39:36 UTC (rev 613)
</span><span class="lines">@@ -57,6 +57,7 @@
</span><span class="cx"> <tr><td><a \
href="./TestFocusOnBlur.html">TestFocusOnBlur</a></td></tr>
<tr><td><a \
href="./TestVerifyAlerts.html">TestVerifyAlerts</a></td></tr>
<tr><td><a \
href="./TestConfirmations.html">TestVerifyConfirmations</a></td></tr>
</span><span class="add">+ <tr><td><a \
href="./TestPrompting.html">TestVerifyPrompt</a></td></tr>
</span><span class="cx"> <tr><td><a \
href="./TestVisibility.html">TestVisibility</a></td></tr>
<tr><td><a \
href="./TestVerifyEditable.html">TestVerifyEditable</a></td></tr>
</span></pre></div>
<a id="trunkcodejavascripttestshtmltest_prompthtml"></a>
<div class="addfile"><h4>Added: trunk/code/javascript/tests/html/test_prompt.html \
(612 => 613)</h4> <pre class="diff">
<span class="info">--- trunk/code/javascript/tests/html/test_prompt.html 2005-08-24 \
10:35:26 UTC (rev 612)
+++ trunk/code/javascript/tests/html/test_prompt.html 2005-08-24 12:39:36 UTC (rev \
613) </span><span class="lines">@@ -0,0 +1,34 @@
</span><span class="add">+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 \
Transitional//EN"> +<html>
+<head>
+<!--
+Copyright 2004 ThoughtWorks, Inc
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+ <script type="text/javascript">
+
+ function confirmLeaving() {
+ if (prompt("Type 'yes' and click OK") == 'yes') {
+ document.location = "test_dummy_page.html";
+ }
+ }
+
+ </script>
+ <title>Test Prompt</title>
+</head>
+<body>
+<img style="width: 644px; height: 41px;" alt="banner" \
src="banner.gif"><br> +<a id="promptAndLeave" \
href="javascript:confirmLeaving();">click to navigate to a new \
page</a> +</body>
+</html>
</span><span class="cx">Property changes on: \
trunk/code/javascript/tests/html/test_prompt.html \
___________________________________________________________________
Name: svn:eol-style
+ native
</span>
</pre>
</div>
</div>
</body>
</html>
_______________________________________________
Selenium-commits mailing list
Selenium-commits@lists.public.thoughtworks.org
http://lists.public.thoughtworks.org/mailman/listinfo/selenium-commits
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic