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
0998146d
...
0998146d484ec3926a3de29aeb05783359bc8a74
authored
2013-07-08 02:37:27 +0400
by
Shiryaev Andrey
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
fix
1 parent
79747496
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
3 deletions
modules/casper.js
modules/utils.js
modules/casper.js
View file @
0998146
...
...
@@ -446,7 +446,7 @@ Casper.prototype.clickLabel = function clickLabel(label, tag) {
this
.
checkStarted
();
tag
=
tag
||
"*"
;
var
escapedLabel
=
utils
.
quoteXPathAttributeString
(
label
);
var
selector
=
selectXPath
(
f
(
'//%s[text()=
"%s"
]'
,
tag
,
escapedLabel
));
var
selector
=
selectXPath
(
f
(
'//%s[text()=
%s
]'
,
tag
,
escapedLabel
));
return
this
.
click
(
selector
);
};
...
...
modules/utils.js
View file @
0998146
...
...
@@ -636,9 +636,9 @@ exports.objectValues = objectValues;
function
quoteXPathAttributeString
(
string
)
{
"use strict"
;
if
(
/"/g
.
test
(
str
))
{
return
'
concat("'
+
str
.
toString
().
replace
(
/"/g
,
'", \'"\', "'
)
+
'")
'
;
return
'
\'concat("'
+
str
.
toString
().
replace
(
/"/g
,
'", \'"\', "'
)
+
'")\'
'
;
}
else
{
return
'
"'
+
str
+
'"
'
;
return
'
\'"'
+
str
+
'"\'
'
;
}
}
exports
.
quoteXPathAttributeString
=
quoteXPathAttributeString
;
...
...
Please
register
or
sign in
to post a comment