Add broken tests for last()

This commit is contained in:
bootstraponline
2013-04-17 15:47:36 -04:00
parent 5a9259911c
commit 139176bfaf
2 changed files with 22 additions and 0 deletions
+10
View File
@@ -172,6 +172,16 @@ describeWd('xpath', function(h) {
});
});
});
it('should find the last element', function(done) {
h.driver.elementByXPath("//text[last()]", function(err, el) {
should.not.exist(err);
el.text(function(err, text) {
should.not.exist(err);
text.should.eql("Accessibility");
done();
});
});
});
it('should find element by xpath index and child', function(done) {
h.driver.elementByXPath("//frame[1]/frame[1]/list[1]/text[3]", function(err, el) {
should.not.exist(err);
+12
View File
@@ -74,6 +74,18 @@ var setupXpath = function(d, cb) {
};
describeWd('findElement(s)ByXpath', function(h) {
it('should return the last button', function(done) {
setupXpath(h.driver, function() {
h.driver.elementByXPath("//button[last()]", function(err, el) {
should.not.exist(err);
el.text(function(err, text) {
should.not.exist(err);
text.should.equal("Back");
done();
});
});
});
});
it('should return a single element', function(done) {
setupXpath(h.driver, function() {
h.driver.elementByXPath("//button", function(err, el) {