Skip to content

Instantly share code, notes, and snippets.

View ndmanvar's full-sized avatar

Neil Manvar ndmanvar

  • Sentry.io
  • San Francisco, CA
View GitHub Profile
var wd = require('wd')
wd.configureHttp({
timeout: 60000,
retries: 3,
retryDelay: 100,
baseUrl: 'http://example.com/',
proxy: 'http://localhost:53809'
});
# Non-Atomic Example
Scenario: Test Case: Test Email Search by Subject Functionality
# Setup
Given I am logged in with "account_1"
And I send an email to "account_1" with subject "123" and body "xyz"
And I wait until an email with subject "123" appears in the Inbox
# Search
When I enter "folder:inbox subject:123" in the Search field and click Search
# Verify Search
dir1:
file1:
- checkout
- search
dir2:
- homepage
- widget
file3:
- homepage
@ndmanvar
ndmanvar / conf.js
Created June 22, 2016 22:24
Without Sauce (Exos's grid)
exports.config = {
// EXOS local selenium grid location in Hollywood office:
seleniumAddress: 'http://slim.hollywood.athletesperformance.com:4444/wd/hub/',
framework: 'jasmine2',
// NEIL EDITS
multiCapabilities: [{
browserName: 'chrome',
@ndmanvar
ndmanvar / conf.js
Created June 22, 2016 22:23
With sauce
exports.config = {
framework: 'jasmine2',
// NEIL EDITS
sauceUser: process.env.SAUCE_USERNAME,
sauceKey: process.env.SAUCE_ACCESS_KEY,
multiCapabilities: [{
browserName: 'chrome',
# get mda 5 check sum of current apk (Android) /.app.zip (iOS)
current_mda_checksum = get_md5(x.apk)
# get md 5 check sum of application from list of apps in sauce storage using sauce rest api (https://wiki.saucelabs.com/display/DOCS/Temporary+Storage+Methods)
apps = get_stored_files()
mda_checksum_of_app_in_sauce_storage = find_checksum(x.apk, apps)
# compare mda checksum.
# if false (not equal), then uplaod to sauce using sauce rest api for uploading file (https://wiki.saucelabs.com/display/DOCS/Temporary+Storage+Methods)
# else then don't need to uplaod to sauce storage
# usage: $ python appium_start_manual_test.py
# remember to replace YOUR_SAUCE_USERNAME and YOUR_SAUCE_ACCESS_KEY with actual username/access_key
from appium import webdriver
import time
driver = webdriver.Remote(
command_executor="http://YOUR_SAUCE_USERNAME:[email protected]/wd/hub",
desired_capabilities={
'deviceName': 'iPhone 5',
# prereq: have sauce username and accesskey set as environment variables
# i.e. export SAUCE_USERNAME=YOUR_USERNAME
# export SAUCE_ACCESS_KEY=YOUR_ACCESS_KEY
# Only works in firefox
require 'selenium-webdriver'
url = "http://#{ENV['SAUCE_USERNAME']}:#{ENV['SAUCE_ACCESS_KEY']}@ondemand.saucelabs.com:80/wd/hub".strip
@ndmanvar
ndmanvar / gist:dd5c4abcc81a3c620ab6
Last active October 29, 2015 19:08
How use cucumber-watir-webdriver with Allure and Sauce Jenkins plugin
export SAUCE_USERNAME=YOUR_SAUCE_USERNAME
export SAUCE_ACCESS_KEY=YOUR_ACCESS_KEY
git clone https://github.com/ndmanvar/Ruby-Cucumber-WatirWebdriver
cd Ruby-Cucumber-WatirWebdriver
git checkout manheim
bundle install
rake test_sauce show_sessionid_and_job_name
import requests
import json
# limit = 379 for now. Alex must change
r = requests.get('https://api.clever.com/v1.1/sections?limit=379&where=%7B%22district%22%3A%224fd43cc56d11340000000005%22%7D&distinct=district%2Cstudents%2Ccourse_name%2Csis_id', headers={'Authorization':'Bearer DEMO_TOKEN'})
# putting r.text (string) into as json object (json_obj)
json_obj = json.loads(r.text)