Lithium-WebDriver

 view release on metacpan or  search on metacpan

t/dance.pm  view on Meta::CPAN

			<p class="whitespace">&nbsp;</p>
			<p class="full"><strong>There's data in them thar P tags</strong></p>
		</div>
		<div id="get_val">
			<input name="empty" class="empty" type="text">
			<input name="whitespace" class="whitespace" type="text" value=" ">
			<input name="full" class="full" type="text" value="myVal">
		</div>
		<div id="get_html">
			<div class="empty"></div>
			<div class="full"><div>&nbsp</div></div>
		</div>

		<a id="_test1"  target="_blank" href="/" >Test 1</a>
		<a id="_test2"   target="_blank" href="/test2" >Test 2</a>
		<a id="_test3" target="_blank" href="/test3" >Test 3</a>
		<select name="selector" form="_form">
			<option value="val 1">Label 1</option>
			<option value="val 2">Label 2</option>
			<option value="val 3">Label 3</option>
		</select>
		<form action="/" method="post" id="_form">
			<input class="_placeholder" type="text" placeholder="test?" name="test1">
			<input class="_value"       type="text" value="val 1" name="test2">
			<input class="_checkbox"    type="checkbox" value="option1" name="test3">
			<input type="submit" value="Done">
		</form>

		<br />
		<a id="_test_a" onclick="test_anchor()" href="#">Test anchor</a>
		<div id="_div_test_a" style="display:none"></div>
		<script>
			var div_is_vis = 0;
			function div_to_visible () {
				if (!div_is_vis) {
					var y = document.getElementById("_div_test_a");
					y.innerHTML = "You clicked on the link! Good on you";
					y.style.display = 'inline';
					div_is_vis = 1;
				} else {
					var y = document.getElementById("_div_test_a");
					y.style.display = 'none';
					div_is_vis = 0;
				}
			};
			function test_anchor () {
				setTimeout("div_to_visible()", 2000);
			};
		</script>
		<br />
		<a id="_murder" onclick="delete_guy()" href="#">Murder</a><div id="_that_guy"> Some guy here</div>
		<script>
			function delete_element () {
				document.getElementById("_that_guy").remove();
			};
			function delete_guy () {
				setTimeout("delete_element()", 2000);
			};
		</script>
		<br />
		<button class="popup" onclick="popup_func()">Popup</button>
		<script>
			function popup_func()
			{
				alert("I am an alert box!");
			}
		</script>

		<br />
		<button class="popup confirm" onclick="myFunction()">Popup Confirm</button>
		<p style="display:none" id="ok_cancel"></p>
		<script>
			function myFunction()
			{
				var x;
				var r=confirm("Press a button!");
				if (r==true) {
					x="OK!";
				} else {
					x="Cancel!";
				}
				var y = document.getElementById("ok_cancel");
				y.innerHTML = x;
				y.style.display = "inline";
			}
		</script>

		<br />
		<button class="popup input" onclick="my_Function()">Popup Input</button>
		<p id="popup_input"></p>
		<script>
			function my_Function()
			{
				var x;
				var person=prompt("Please enter your name", "synmon01");
				if (person!=null) {
					x="Hello " + person + "! How are you today?";
					var y = document.getElementById("popup_input");
					y.innerHTML = x;
					y.style.display = "inline";
				}
			}
		</script>
		<p id="test_text">
			Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irur...
		</p>
	</body>
</html>
EOF
};

post '/' => sub {
	
	return "<!DOCTYPE html>
<html>
	<head>
		<meta charset=\"UTF-8\">
		<title>webdriver test 2</title>
	</head>
	<body>_placeholder: <div style=\"display:inline;\" id=\"_placeholder\">".param('test1')."</div>
	<br />_value: <div style=\"display:inline;\" id=\"_value\">".param('test2')."</div>
	<br />select: <div style=\"display:inline;\" id=\"select\">".param('selector')."</div>
	</body></html>"
};

get '/test2' => sub {
	return<<EOF
<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>webdriver test 2</title>
	</head>
	<body>TEST 2</body>
</html>
EOF
};

get '/test3' => sub {
	return<<EOF
<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>webdriver test 3</title>
	</head>
	<body>TEST 3</body>
</html>
EOF
};


get '/p_tag' => sub {
	return<<EOF
<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">



( run in 0.678 second using v1.01-cache-2.11-cpan-364913b4093 )