Commit 0998146d 0998146d484ec3926a3de29aeb05783359bc8a74 by Shiryaev Andrey

fix

1 parent 79747496
......@@ -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);
};
......
......@@ -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;
......