Skip to content

Instantly share code, notes, and snippets.

@jlipps
Created September 4, 2013 18:42
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/6441051 to your computer and use it in GitHub Desktop.
Save jlipps/6441051 to your computer and use it in GitHub Desktop.
"use strict";
var driverBlock = require('../../helpers/driverblock_harmony.js')
, describe = driverBlock.describeForApp('UICatalog')
, it = driverBlock.it
, should = require('should');
describe('basic', function(h) {
it('should confirm element is not visible', function*() {
yield (yield h.driver.byTagName('tableCell')).click();
var el = yield h.driver.byName("UIButtonTypeContactAdd");
(yield el.displayed()).should.equal(false);
});
it('should confirm element is visible', function*() {
yield (yield h.driver.byTagName('tableCell')).click();
var el = yield h.driver.byName("UIButtonTypeRoundedRect");
(yield el.displayed()).should.equal(true);
});
it('should confirm element is selected', function*() {
yield (yield h.driver.byXPath("text[contains(@text, 'Picker')]")).click();
var el = yield h.driver.byXPath("button[contains(@text, 'UIPicker')]");
(yield el.selected()).should.equal(true);
});
it('should confirm element is not selected returns false', function*() {
yield (yield h.driver.byXPath("text[contains(@text, 'Picker')]")).click();
var el = yield h.driver.byXPath("button[contains(@text, 'Custom')]");
(yield el.selected()).should.equal(false);
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment