Skip to content

Instantly share code, notes, and snippets.

~/gitRepos/gaia-ui-tests[pr647*]$ gaiatest --address=localhost:2828 --testvars=mine/b2g.gaia.json --type=b2g-xfail gaiatest/tests/manifest.ini
starting httpd
running webserver on http://192.168.0.20:50819/
TEST-START test_settings.py
test_get_all_settings (test_settings.TestSettings) ... ok
test_set_named_setting (test_settings.TestSettings) ... ok
test_set_volume (test_settings.TestSettings) ... ok
----------------------------------------------------------------------
Ran 3 tests in 88.430s
~/gitRepos/gaia-ui-tests[fix_contact_sort*]$ gaiatest --address=localhost:2828 --testvars=mine/b2g.gaia.json gaiatest/tests/contacts/test_sort_contacts.py
starting httpd
running webserver on http://192.168.0.20:54819/
TEST-START test_sort_contacts.py
test_sort_contacts (test_sort_contacts.TestContacts)
Test sorting of contacts ... ERROR
======================================================================
ERROR: test_sort_contacts (test_sort_contacts.TestContacts)
Test sorting of contacts
~/gitRepos/gaia-ui-tests[fix_add_new_contact*]$ gaiatest --address=localhost:2828 --testvars=mine/b2g.gaia.json gaiatest/tests/contacts/test_add_new_contact.py
starting httpd
running webserver on http://192.168.0.20:56885/
TEST-START test_add_new_contact.py
test_add_new_contact (test_add_new_contact.TestContacts) ... ERROR
======================================================================
ERROR: test_add_new_contact (test_add_new_contact.TestContacts)
----------------------------------------------------------------------
Traceback (most recent call last):
def should_verify_url(self, url):
"""Return false if the url does not need to be verified."""
bad_urls = ['%s/' % self.base_url, '%s#' % self.base_url]
return not (url.startswith('%sjavascript' % self.base_url) or
url.startswith('%sftp://' % self.base_url) or
url.startswith('%sirc://' % self.base_url) or
url in bad_urls)
@bobsilverberg
bobsilverberg / gist:5713590
Created June 5, 2013 12:44
Example of using @pytest.mark.parametrize for mcom-tests
@pytest.mark.nondestructive
@pytest.mark.parametrize('link_list', ['product_link_list_1','product_link_list_2','product_link_list_3'])
def test_product_link_urls_are_valid(self, mozwebqa, link_list):
mozillabased_page = MozillaBasedPage(mozwebqa)
mozillabased_page.go_to_page()
bad_urls = []
links = getattr(mozillabased_page, link_list)
for link in links:
url = mozillabased_page.link_destination(link.get('locator'))
response_code = mozillabased_page.get_response_code(url)
#!/bin/bash
set -e
echo "Plug in your device"
adb wait-for-device
echo "Found device"
#dir=$(mktemp -d -t revision)
dir=$(mktemp -d -t revision.XXXXXX)
cd $dir
adb pull /system/b2g/omni.ja &>/dev/null || echo "Error pulling gecko"
adb pull /system/b2g/webapps/settings.gaiamobile.org/application.zip &> /dev/null || echo "Error pulling gaia file"
@bobsilverberg
bobsilverberg / gist:6246473
Created August 16, 2013 01:27
mozwebqa-vagrant testing
~/gitRepos/mozwebqa-vagrant[master*]$ vagrant status
Current machine states:
default running (virtualbox)
The VM is running. To stop this VM, you can run `vagrant halt` to
shut it down forcefully, or you can run `vagrant suspend` to simply
suspend the virtual machine. In either case, to restart it again,
simply run `vagrant up`.
~/gitRepos/mozwebqa-vagrant[master*]$ vagrant suspend
Greetings from Mozilla's Web QA team. Thanks for your interest in helping us test Mozilla's many Web properties! If you are interested in manual testing, a great place to get started is at https://quality.mozilla.org/teams/web-qa/#Manual. Likewise, if you are interested in automated testing, you can start by looking at https://quality.mozilla.org/teams/web-qa/#Automated.
Are you familiar with some/most of our Web properties? If not you can take a look at the projects listed on and linked to in https://wiki.mozilla.org/QA/Execution/Web_Testing#Current_Projects_.2B_Webdev_Processes to get an idea of what we do. Is there a specific type of test or tests/testing you'd like to perform? We have opportunities for bug verification, exploratory testing, new-feature testing, and a lot more, so please let us know.
Often the best step is to stop by IRC (#mozwebqa on irc.mozilla.org) and say Hi; if you'd like to one-click chat with us, just click on http://widget.mibbit.com/?settings=0a187437b06ca9bcb0cff2a717e985c5&s
def fun():
print("Yes")
return 1
or_test = lambda x, y: x or y
>>> or_test(1, 2)
1
>>> or_test(2, 3)
2
@bobsilverberg
bobsilverberg / local.py
Created September 5, 2013 01:20
settings for Moztrap
"""
Settings overrides for a particular deployment of this app. The defaults should
be suitable for local development; other settings below are likely to need
adjustment for a staging or production deployment.
Copy local.sample.py to local.py and modify as needed.
"""
#Database settings.