Skip to content

Instantly share code, notes, and snippets.

@jlipps
Created September 4, 2013 18:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jlipps/6441023 to your computer and use it in GitHub Desktop.
Save jlipps/6441023 to your computer and use it in GitHub Desktop.
/*global it:true */
"use strict";
var describeWd = require("../../helpers/driverblock.js").describeForApp('UICatalog')
, should = require('should');
describeWd('basic', function(h) {
it('should confirm element is not visible', function(done) {
h.driver.elementsByTagName('tableCell', function(err, els) {
els[0].click(function() {
h.driver.elementByName("UIButtonTypeContactAdd", function(err, el) {
should.not.exist(err);
el.displayed(function(err, val) {
should.not.exist(err);
val.should.equal(false);
done();
});
});
});
});
});
it('should confirm element is visible', function(done) {
h.driver.elementsByTagName('tableCell', function(err, els) {
els[0].click(function() {
h.driver.elementByName("UIButtonTypeRoundedRect", function(err, el) {
should.not.exist(err);
el.displayed(function(err, val) {
should.not.exist(err);
val.should.equal(true);
done();
});
});
});
});
});
it('should confirm element is selected', function(done) {
h.driver.elementByXPath("text[contains(@text, 'Picker')]", function(err, el) {
el.click(function() {
h.driver.elementByXPath("button[contains(@text, 'UIPicker')]", function(err, el1) {
should.not.exist(err);
el1.selected(function(err, val) {
should.not.exist(err);
val.should.equal(true);
done();
});
});
});
});
});
it('should confirm element is not selected returns false', function(done) {
h.driver.elementByXPath("text[contains(@text, 'Picker')]", function(err, el) {
el.click(function() {
h.driver.elementByXPath("button[contains(@text, 'Custom')]", function(err, el1) {
should.not.exist(err);
el1.selected(function(err, val) {
should.not.exist(err);
val.should.equal(false);
done();
});
});
});
});
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment