Skip to content

Instantly share code, notes, and snippets.

View edwindotcom's full-sized avatar
:octocat:
hubba hubba

Edwin Wong edwindotcom

:octocat:
hubba hubba
  • Alameda, CA
View GitHub Profile
client.switchToFrame();
console.log("waiting....fxa-email");
client.switchToFrame(selectors.fxaFrame);
client.pageSource(function(err, dump){
console.log('DUMP');
console.log(dump);
});
@edwindotcom
edwindotcom / user.js
Last active August 29, 2015 13:57
server prefs for FxAccounts
/* copy the pref group below into a user.js file created in profile dir. e.g.
* Mac: /Users/<user>/Library/Application\ Support/Firefox/Profiles/<obfuscate_chars>.default/user.js
* Win: C:/Users/Username/Appdata/Roaming/Mozilla/Firefox/Profiles/<obfuscate_chars>.default/user.js
* Lnx: ~/.mozilla/firefox/<obfuscate_chars>.default/user.js
* Restart Firefox
*/
/*
// useful
user_pref("general.warnOnAboutConfig", false);
import urllib2
import urllib
import urlparse
import json
import sys
if len(sys.argv) < 2:
sys.stderr.write('Usage: python verifyAcct.py email ')
sys.exit(1)
#!/bin/bash
if [ "$1" == "" ]; then
echo 'appends pref to your profile pref.js'
echo 'Usage: ./addPref.bash [path to prefs.js]'
exit
fi
pref0="user_pref(\"services.sync.log.appender.file.logOnSuccess\", true);"
echo $pref0 >> $1
echo "pref added"
git checkout master
git fetch upstream
git merge upstream/master
git push origin master
for i in $(eval echo {1..$1})
do
echo $(date +"%T")
curl -v "https://accounts.firefox.com" -o /dev/null
sleep 20
done
@edwindotcom
edwindotcom / print_iframes
Created December 4, 2013 00:03
way to print iframes on b2g
self.marionette.switch_to_frame()
iframes = self.marionette.find_elements(*self._frame_locator)
for iframe in iframes:
print 'src', iframe.get_attribute("src")
@edwindotcom
edwindotcom / genCovCmd.py
Created November 26, 2013 17:43
generate code cover bash script
#! /usr/bin/python
import os
files = os.listdir("test/run")
for file in files:
print "istanbul cover test/run/%s" % file
print "mv coverage coverage_%s" % file
@edwindotcom
edwindotcom / gist:7221127
Created October 29, 2013 19:36
run gaiatest
gaiatest --testvars=/Users/Edwin/home.json --address=localhost:2828 test_persona_cookie.py
@edwindotcom
edwindotcom / gist:6126978
Created July 31, 2013 22:58
quick and dirty ui test for b2g
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from gaiatest import GaiaTestCase
from gaiatest.apps.browser.app import Browser
from gaiatest.apps.persona.app import Persona
from gaiatest.mocks.persona_test_user import PersonaTestUser