Skip to content

Instantly share code, notes, and snippets.

@devinmancuso
devinmancuso / chromemobiletest.py
Last active May 26, 2023 11:00
Example Python Chrome Mobile Emulation Automated Unit Testing Using Selenium 2 WebDriver ChromeDriver
# Import unittest module for creating unit tests
import unittest
# Import time module to implement
import time
# Import the Selenium 2 module (aka "webdriver")
from selenium import webdriver
# For automating data input
import os
import subprocess
class Colorcodes(object):
"""
Provides ANSI terminal color codes which are gathered via the ``tput``
utility. That way, they are portable. Color codes are initialized to
empty strings. If the output is being redirected or if there occurs
any error with ``tput``, keep empty strings.
import os
import subprocess
class Colorcodes(object):
"""
Provides ANSI terminal color codes which are gathered via the ``tput``
utility. That way, they are portable. Color codes are initialized to
empty strings. If the output is being redirected or if there occurs
any error with ``tput``, keep empty strings.
@martin-ueding
martin-ueding / colorcodes.py
Created November 3, 2012 11:04
Python Colorcodes class
class Colorcodes(object):
"""
Provides ANSI terminal color codes which are gathered via the ``tput``
utility. That way, they are portable. If there occurs any error with
``tput``, all codes are initialized as an empty string.
The provides fields are listed below.
Control:
@baijum
baijum / selenium_with_python.rst
Last active April 19, 2024 14:37
Selenium with Python
#!/bin/bash
#
# git-svn-diff originally by (http://mojodna.net/2009/02/24/my-work-git-workflow.html)
# modified by mike@mikepearce.net
#
# Generate an SVN-compatible diff against the tip of the tracking branch
# Get the tracking branch (if we're on a branch)
TRACKING_BRANCH=`git svn info | grep URL | sed -e 's/.*\/branches\///'`
#!/bin/sh
# Edit these values for your subversion repository
hudson_user=my_username
hudson_passwd=my_password
# Initialization -- Set up the svn repository before running this script
# cd $HUDSON_HOME
# svn mkdir --parents --username=my_username -m "Hudson configuration" REPOSITORY_URL
# svn co REPOSITORY_URL .