mirror of
https://github.com/appium/appium.git
synced 2026-05-13 06:18:42 -05:00
Add broken tests for last()
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user