-
-
Notifications
You must be signed in to change notification settings - Fork 8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* EC for finding visible elements There already was a way of finding a list of elements that are present on the page, but there was none for finding visible elements. I've created a class that makes this possible. * Clean * Changed to list comprehension * visibility_of_all_elements tests added * Created hidden_partially.html Used in the visibility_of_all_elements tests * Now uses assertRaises * Fixed usage of assertRaises * Fixed exception name I'm an idiot
- Loading branch information
1 parent
aadaa15
commit 71aa100
Showing
3 changed files
with
75 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<title></title> | ||
<script type="text/javascript"> | ||
var next = 0; | ||
|
||
function addVisibleBox() { | ||
var box = document.createElement('DIV'); | ||
box.id = 'box' + next++; | ||
box.className = 'redbox'; | ||
box.style.width = '150px'; | ||
box.style.height = '150px'; | ||
box.style.backgroundColor = 'red'; | ||
box.style.border = '1px solid black'; | ||
box.style.margin = '5px'; | ||
box.style.visibility = 'visible' | ||
|
||
window.setTimeout(function() { | ||
document.body.appendChild(box); | ||
}, 1000); | ||
} | ||
|
||
function addHiddenBox() { | ||
var box = document.createElement('DIV'); | ||
box.id = 'box' + next++; | ||
box.className = 'redbox'; | ||
box.style.width = '150px'; | ||
box.style.height = '150px'; | ||
box.style.backgroundColor = 'red'; | ||
box.style.border = '1px solid black'; | ||
box.style.margin = '5px'; | ||
box.style.visibility = 'hidden'; | ||
|
||
window.setTimeout(function() { | ||
document.body.appendChild(box); | ||
}, 1000); | ||
} | ||
</script> | ||
</head> | ||
<body> | ||
<input id="addVisible" type="button" value="Add a visible box!" onclick="addVisibleBox()"/> | ||
<input id="addHidden" type="button" value="Add a hidden box!" onclick="addHiddenBox();" /> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters