Skip to content

Instantly share code, notes, and snippets.

View 0x1mason's full-sized avatar

Eric Millin 0x1mason

  • IBM
  • Durm, Cackalack del Norte
View GitHub Profile
@0x1mason
0x1mason / clear-spec.js
Created September 17, 2014 13:08
hide keyboard
it('should hide keyboard using bad key', function (done) {
driver
.elementByClassName('UIATextField').sendKeys("1")
.elementByClassName('UIASwitch').isDisplayed()
.should.become(false)
.hideKeyboard("f")
.elementByClassName('UIASwitch').isDisplayed()
.should.become(true)
.nodeify(done);
@0x1mason
0x1mason / _readme
Last active August 29, 2015 14:06
Pseudo code example of lib/devices refactoring using a polymorphic approach. I also tried to use class names that might work with changes bootstrap suggested.
The files will make the most sense if you read them in this order:
device.js
android-base-device.js
android-uiautomator.js
others.js
I hate how gist doesn't give you the ability to keep the files in the original order.
@0x1mason
0x1mason / string_template.js
Last active August 29, 2015 13:56
C# and Python inspired string templates for JavaScript
// Eric Millin (c) 2014
// MIT X11 license (http://opensource.org/licenses/MIT)
//
// C# and Python inspired string templating. Target tokens must be numbered with the index of the
// replacement string and surrounded by curly brackets; e.g:
//
// "{0} {1} {0}".format("foo", "bar"); // "foo bar foo"
//