Skip to content

Instantly share code, notes, and snippets.

View antranapp's full-sized avatar

An Tran antranapp

View GitHub Profile
@antranapp
antranapp / gist:7263973
Created November 1, 2013 11:08
Tear down script for appium, phpunit integration to wait for the last session to be destroyed before starting a new one
public function tearDown() {
$count = 0;
$sessionId = $this->getSessionId();
while ($sessionId !== FALSE && $count < 5) {
printf("\n".$count." - ".$sessionId."\n");
parent::tearDown();
sleep(2);
$sessionId = $this->getSessionId();
$count++;
}
var shake = (function () {
var shake = {},
watchId = null,
options = { frequency: 300 },
previousAcceleration = { x: null, y: null, z: null },
shakeCallBack = null;
// Start watching the accelerometer for a shake gesture
shake.startWatch = function (onShake) {
shakeCallBack = onShake;
var shake = (function () {
var shake = {},
watchId = null,
options = { frequency: 300 },
previousAcceleration = { x: null, y: null, z: null },
shakeCallBack = null;
// Start watching the accelerometer for a shake gesture
shake.startWatch = function (onShake) {
shakeCallBack = onShake;
<!doctype html>
<html>
<head>
<title>
</title>
<script src="http://yui.yahooapis.com/3.5.0/build/yui/yui-min.js">
</script>
</head>

Making behat use phantomjs for the tests

If you want to run it on phantomjs (a headless browser) you can add this profile to your behat.yml and you need phantomjs >= 1.8.0

phantomjs:
    extensions:
        Behat\MinkExtension\Extension:
            base_url: http://dev.local
            goutte: ~
            selenium2:
 wd_host: "http://localhost:8643/wd/hub"