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
a8f292bc
...
a8f292bc175c69393435efffaccf20aa5bb19055
authored
2014-05-11 11:01:05 -0700
by
Ryan Frederick
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
refs #917 - added capture zoom factor tests
1 parent
038f36c0
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
0 deletions
tests/suites/clientutils.js
tests/suites/clientutils.js
View file @
a8f292b
...
...
@@ -142,6 +142,35 @@ casper.test.begin('ClientUtils.getElementBounds() tests', 3, function(test) {
});
});
casper
.
test
.
begin
(
'ClientUtils.getElementBounds() page zoom factor tests'
,
3
,
function
(
test
)
{
casper
.
start
().
zoom
(
2
).
then
(
function
()
{
var
html
=
'<div id="boxes">'
;
html
+=
' <div id="b1" style="position:fixed;top:10px;left:11px;width:50px;height:60px"></div>'
;
html
+=
' <div style="position:fixed;top:20px;left:21px;width:70px;height:80px"></div>'
;
html
+=
'</div>'
;
this
.
page
.
content
=
html
;
test
.
assertEquals
(
this
.
getElementBounds
(
'#b1'
),
{
top
:
20
,
left
:
22
,
width
:
100
,
height
:
120
},
'ClientUtils.getElementBounds() is aware of the page zoom factor'
);
var
bounds
=
this
.
getElementsBounds
(
'#boxes div'
);
test
.
assertEquals
(
bounds
[
0
],
{
top
:
20
,
left
:
22
,
width
:
100
,
height
:
120
},
'ClientUtils.getElementsBounds() is aware of the page zoom factor'
);
test
.
assertEquals
(
bounds
[
1
],
{
top
:
40
,
left
:
42
,
width
:
140
,
height
:
160
},
'ClientUtils.getElementsBounds() is aware of the page zoom factor'
);
});
casper
.
run
(
function
()
{
test
.
done
();
});
});
casper
.
test
.
begin
(
'ClientUtils.getElementInfo() tests'
,
10
,
function
(
test
)
{
casper
.
page
.
content
=
'<a href="plop" class="plip plup"><i>paf</i></a>'
;
var
info
=
casper
.
getElementInfo
(
'a.plip'
);
...
...
Please
register
or
sign in
to post a comment