HsacAcceptanceTests.SlimTests.BrowserTest.RepeatUntilTests.RefreshUntilInFrameTest


This test ensures that we can keep refreshing a page until a condition is met by one of its iframes.

We use a mock server running to serve the HTML defined in this page.

variable defined: HTML_MAIN1= {{{ <html> <title>Start Page Title</title> <body> <iframe id="iframe1" src="frame1.html"></iframe> <iframe id="iframe2" src="frame2.html"></iframe> </body> </html>}}}

variable defined: HTML_FRAME1_1= {{{ <html> <body> <input name="remove1" type="button" value="Remove1"> </body> </html>}}}


variable defined: HTML_FRAME1_2= {{{ <html> <body> <label id="label" for="field">Teller</label> <input id="field" value="1"> <script type="text/javascript"> window.onload = function() { setTimeout(function() { document.getElementById("label").innerHTML = "Counter"; }, 1500); } </script> </body> </html>}}}

script mock xml server setup
add response
<html>
<title>Start Page Title</title>
<body>
<iframe id="iframe1" src="frame1.html"></iframe>
<iframe id="iframe2" src="frame2.html"></iframe>
</body>
</html>
add response
<html>
<body>
<input name="remove1" type="button" value="Remove1">
</body>
</html>
for GET: /FitNesseMock/frame1.html
add response
<html>
<body>
<label id="label" for="field">Teller</label>
<input id="field" value="1">
<script type="text/javascript">
    window.onload = function() {
		setTimeout(function() { document.getElementById("label").innerHTML = "Counter"; }, 1500);
    }
</script>
</body>
</html>
for GET: /FitNesseMock/frame2.html
$url<-[http://127.0.0.1:8001/FitNesseMock] get mock server url

script browser test
open $url->[http://127.0.0.1:8001/FitNesseMock]/main
set repeat interval to 2000 milliseconds
repeat at most 3 times
refresh until value of Counter is 1
check repeat count 0

script mock xml server setup
stop