Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
John McEleney
/
casperjs
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
Commit
b7f4bdeb
...
b7f4bdebbfd2833cd5a412244e13115f1d36ca3a
authored
2013-05-04 18:11:01 -0600
by
hexid
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Split ClientUtils.getElementsInfo() tests
1 parent
8f8d8aad
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
2 deletions
tests/suites/clientutils.js
tests/suites/clientutils.js
View file @
b7f4bde
...
...
@@ -162,10 +162,9 @@ casper.test.begin('ClientUtils.getElementInfo() tests', 10, function(test) {
test
.
done
();
});
casper
.
test
.
begin
(
'ClientUtils.getElementsInfo()
tests'
,
2
0
,
function
(
test
)
{
casper
.
test
.
begin
(
'ClientUtils.getElementsInfo()
first element tests'
,
1
0
,
function
(
test
)
{
casper
.
page
.
content
=
'<a href="plop" class="plip plup"><i>paf</i></a><a href="plap" class="plip plup"><i>puf</i></a>'
;
var
info
=
casper
.
getElementsInfo
(
'a.plip'
);
test
.
assertEquals
(
info
[
0
].
nodeName
,
'a'
,
'ClientUtils.getElementsInfo() retrieves first element name'
);
test
.
assertEquals
(
info
[
0
].
attributes
,
{
'href'
:
'plop'
,
...
...
@@ -180,7 +179,11 @@ casper.test.begin('ClientUtils.getElementsInfo() tests', 20, function(test) {
test
.
assert
(
info
[
0
].
visible
,
'ClientUtils.getElementsInfo() retrieves first element visibility'
);
test
.
assertEquals
(
info
[
0
].
tag
,
'<a href="plop" class="plip plup"><i>paf</i></a>'
,
'ClientUtils.getElementsInfo() retrieves first element whole tag contents'
);
test
.
done
();
});
casper
.
test
.
begin
(
'ClientUtils.getElementsInfo() second element tests'
,
10
,
function
(
test
)
{
var
info
=
casper
.
getElementsInfo
(
'a.plip'
);
test
.
assertEquals
(
info
[
1
].
nodeName
,
'a'
,
'ClientUtils.getElementsInfo() retrieves second element name'
);
test
.
assertEquals
(
info
[
1
].
attributes
,
{
'href'
:
'plap'
,
...
...
Please
register
or
sign in
to post a comment