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
# 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',
# 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
@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',
@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',
dir1:
file1:
- checkout
- search
dir2:
- homepage
- widget
file3:
- homepage
# 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
var wd = require('wd')
wd.configureHttp({
timeout: 60000,
retries: 3,
retryDelay: 100,
baseUrl: 'http://example.com/',
proxy: 'http://localhost:53809'
});
while false do
if file.exists? then
content = read(file)
if content == 'delete file/folder x' then
# delete file/folder x
elsif content == 'install plugin y' then
# install plugin y, or call script that will install plugin y
elsif content == 'some other thing'
# insert other commands as needed
import time
import os
write_file = 'C:\Users\Administrator\Downloads\zzz.log'
w_file = open(write_file, 'w')
w_file.write('testing\n')
w_file.close()
while True:
before(:each) do | test |
browser = Selenium::WebDriver.for(:remote, :url => 'https://ondemand.saucelabs.com:443/wd/hub', { :browserName => 'chrome' })
end
it 'this is my test' do
browser.get('http://www.yahoo.com')
browser.element(:id => 'abc').click()
assertTrue(browser.element('def').visible?)
end