Skip to content
This repository has been archived by the owner on Mar 23, 2020. It is now read-only.
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: appium-boneyard/sample-code
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: master
Choose a base ref
...
head repository: mmcintyre123/sample-code
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
Checking mergeability… Don’t worry, you can still create the pull request.

Commits on Jun 21, 2016

  1. commenting out unecessary saucelabs in appium-servers.js

    Matthew McIntyre authored and Matthew McIntyre committed Jun 21, 2016
    Copy the full SHA
    eb505f6 View commit details

Commits on Jul 24, 2016

  1. pushing some edits

    mmcintyre123 committed Jul 24, 2016
    Copy the full SHA
    5a055a8 View commit details
  2. Copy the full SHA
    f48fa81 View commit details

Commits on Aug 1, 2016

  1. updating test

    mmcintyre123 committed Aug 1, 2016
    Copy the full SHA
    ab646f4 View commit details

Commits on Aug 5, 2016

  1. updates to test

    mmcintyre123 committed Aug 5, 2016
    Copy the full SHA
    5121d96 View commit details
  2. Copy the full SHA
    cdc9535 View commit details

Commits on Aug 9, 2016

  1. Updates, reorganizing

    mmcintyre123 committed Aug 9, 2016
    Copy the full SHA
    68ac912 View commit details

Commits on Aug 11, 2016

  1. Copy the full SHA
    0a460ab View commit details

Commits on Oct 5, 2016

  1. some additions

    mmcintyre123 committed Oct 5, 2016
    Copy the full SHA
    6c4734b View commit details
  2. script passing

    mmcintyre123 committed Oct 5, 2016
    Copy the full SHA
    a51699d View commit details

Commits on Nov 1, 2016

  1. Copy the full SHA
    22b3f09 View commit details
  2. Updating test

    mmcintyre123 committed Nov 1, 2016
    Copy the full SHA
    24ebb96 View commit details

Commits on Nov 4, 2016

  1. updates

    mmcintyre123 committed Nov 4, 2016
    Copy the full SHA
    4cb7ddc View commit details

Commits on Nov 18, 2016

  1. lots of updates

    mmcintyre123 committed Nov 18, 2016
    Copy the full SHA
    3a88a80 View commit details
  2. one more file

    mmcintyre123 committed Nov 18, 2016
    Copy the full SHA
    285f436 View commit details
  3. more updates

    mmcintyre123 committed Nov 18, 2016
    Copy the full SHA
    b436e4e View commit details

Commits on Nov 28, 2016

  1. Copy the full SHA
    fb48215 View commit details

Commits on Nov 29, 2016

  1. Copy the full SHA
    3dff514 View commit details
  2. Copy the full SHA
    ed28b81 View commit details

Commits on Dec 6, 2016

  1. updates

    mmcintyre123 committed Dec 6, 2016
    Copy the full SHA
    ecca30e View commit details
  2. removing blank line

    mmcintyre123 committed Dec 6, 2016
    Copy the full SHA
    91faf75 View commit details
  3. Copy the full SHA
    b8ca0c8 View commit details
  4. Copy the full SHA
    fe74240 View commit details
Showing with 720 additions and 13 deletions.
  1. +2 −0 README.md
  2. +68 −0 sample-code/examples/node/android-walk-login.js
  3. +150 −0 sample-code/examples/node/android_local_server_MMTest.js
  4. +129 −0 sample-code/examples/node/android_local_server_MMTest_new.js
  5. 0 sample-code/examples/node/{ → examples}/android-complex.js
  6. 0 sample-code/examples/node/{ → examples}/android-local-server.js
  7. +17 −0 sample-code/examples/node/examples/android-login.js
  8. 0 sample-code/examples/node/{ → examples}/android-simple.js
  9. 0 sample-code/examples/node/{ → examples}/android-webview.js
  10. 0 sample-code/examples/node/{ → examples}/ios-actions.js
  11. 0 sample-code/examples/node/{ → examples}/ios-complex.js
  12. 0 sample-code/examples/node/{ → examples}/ios-local-server.js
  13. 0 sample-code/examples/node/{ → examples}/ios-safari.js
  14. 0 sample-code/examples/node/{ → examples}/ios-selenium-webdriver-bridge.js
  15. 0 sample-code/examples/node/{ → examples}/ios-simple.js
  16. 0 sample-code/examples/node/{ → examples}/ios-webview.js
  17. 0 sample-code/examples/node/{ → examples}/ios-yiewd.js
  18. 0 sample-code/examples/node/{ → examples}/selendroid-simple.js
  19. +2 −1 sample-code/examples/node/helpers/appium-servers.js
  20. +1 −0 sample-code/examples/node/helpers/apps.js
  21. +1 −0 sample-code/examples/node/helpers/caps.js
  22. +97 −0 sample-code/examples/node/helpers/commons.js
  23. +14 −0 sample-code/examples/node/helpers/config.js
  24. +56 −0 sample-code/examples/node/helpers/elements.js
  25. +3 −3 sample-code/examples/node/helpers/local-server.js
  26. +7 −7 sample-code/examples/node/helpers/setup.js
  27. +5 −2 sample-code/examples/node/package.json
  28. +168 −0 sample-code/examples/node/walk_sandbox.js
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#sample-code

Don't commit to this repository. Tests have been moved to AppiumAutomation repository.

This repository contains sample applications which are used mostly by appium functional tests.
68 changes: 68 additions & 0 deletions sample-code/examples/node/android-walk-login.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
"use strict";

require("./helpers/setup");

var wd = require("wd");
var assert = require('assert');
var serverConfigs = require('./helpers/appium-servers');
// var args = process.args.slice(2);
// var config = require('./helpers/config')
// var actions = require('/helpers/actions')
// var elements = require('/helpers/elements')
var desired;
var simulator = false
var _ = require('underscore');
var localServer = require('./helpers/local-server');
// wd.addPromiseChainMethod('swipe', actions.swipe);


describe("android local server", function () {
this.timeout(30000);
var driver;
var allPassed = true;

before(function () {
localServer.start();
var serverConfig = serverConfigs.local;
driver = wd.promiseChainRemote(serverConfig);
require("./helpers/logging").configure(driver);

var desired = process.env.npm_package_config_sauce ?
_.clone(require("./helpers/caps").android18) :
_.clone(require("./helpers/caps").android19);
desired.app = require("./helpers/apps").i360Walk;
if (process.env.npm_package_config_sauce) {
desired.name = 'android - local server';
desired.tags = ['sample'];
}
return driver.init(desired);
});

after(function () {
localServer.stop();
return driver
.quit()
.finally(function () {
if (process.env.npm_package_config_sauce) {
return driver.sauceJobStatus(allPassed);
}
});
});

afterEach(function () {
allPassed = allPassed && this.currentTest.state === 'passed';
});


it("should open the app and wait for input", function () {
return driver
.elementById('com.i360.i360Walk:id/etLoginUsername')
.sendKeys('test_1654wseward')
.elementById('com.i360.i360Walk:id/etPassword')
.sendKeys('asdf')
.elementById('com.i360.i360Walk:id/btnLogin')
.click()
.sleep(400000)
});

});
150 changes: 150 additions & 0 deletions sample-code/examples/node/android_local_server_MMTest.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,150 @@
// this is a test

"use strict";

require("./helpers/setup");

var wd = require("wd");
var assert = require('assert');
var serverConfigs = require('./helpers/appium-servers');
// var args = process.args.slice(2);
// var config = require('./helpers/config')
// var actions = require('./helpers/actions.')
var elements = require('./helpers/elements')
var desired;
var simulator = false
var _ = require('underscore');
var localServer = require('./helpers/local-server');
// wd.addPromiseChainMethod('swipe', actions.swipe);
var chai = require("chai");
chai.config.includeStack = true;
var assert = chai.assert;


describe("android local server", function () {
this.timeout(30000);
var driver;
var allPassed = true;

before(function () {
localServer.start();
var serverConfig = serverConfigs.local;
driver = wd.promiseChainRemote(serverConfig);
require("./helpers/logging").configure(driver);

var desired = process.env.npm_package_config_sauce ?
_.clone(require("./helpers/caps").android18) :
_.clone(require("./helpers/caps").android19);

desired.app = require("./helpers/apps").i360Walk;

if (process.env.npm_package_config_sauce) {
desired.name = 'android - local server';
desired.tags = ['sample'];
}
return driver.init(desired);
});

after(function () {
localServer.stop();
return driver
.quit()
.finally(function () {
if (process.env.npm_package_config_sauce) {
return driver.sauceJobStatus(allPassed);
}
});
});

afterEach(function () {
allPassed = allPassed && this.currentTest.state === 'passed';
});


it("should open the app", function () {
return driver
.elementById(elements.loginScreen.rememberMe)
.click().sleep(500)
.elementById(elements.loginScreen.userName)
.sendKeys('test_1654wseward')
.elementById(elements.loginScreen.password)
.sendKeys('asdf')
.elementById(elements.loginScreen.logIn)
.click()
var walkbookID = elements.homeScreen.walkbooks.split(/\//).splice(1,1)
.waitForElementById(walkbookID, 3000);
});

it("should open Walkbooks and Preview the Survey", function() {
var previewSource;
return driver
.elementByName('Walkbooks')
.click().sleep(1000)
.waitForElementByName('and another one', 2000)
.elementByName('and another one')
.click()

// Survey Preview Validations

.elementByName('Preview Survey Questions')
.click()
.source().then(function (source) {
previewSource = source;
previewSource.should.include('and another one'); // survey title
previewSource.should.include('Question 1');
previewSource.should.include('Answer 1');
previewSource.should.include('Answer 2');
})
});

it('should select a walkbook, household, target, and take a survey', function () {
return driver
// Select a walkbook, list view, make assertions
.back()
.elementByName('Start')
.click()
.waitForElementByName('Select Walkbook', 2000)
.elementByXPath("//android.widget.TextView[@text='List']")
.click()
.waitForElementByName('Walkbook 28', 2000)
.elementByName('Walkbook 28')
.click().sleep(1000)
.waitForElementByName('Houses in Walkbook 28', 2000)
.elementByXPath("//android.widget.TextView[@text='List']")
.click()

// Select a house & assertions

.waitForElementByName('Keene')
.elementByName('Keene')
.click()

//ASSERTIONS

// select a target & assertions

.waitForElementById('dispoVoterRowParent')
.elementById('com.i360.i360Walk:id/dispoVoterRowParent')
.click()

//ASSERTIONS


// take survey

.waitForElementById('btnTakeSurvey', 2000 )
.elementByName('Take Survey')
.click()

//ASSERTIONS

.waitForElementByName('Answer 1', 2000)
.elementByName('Answer 1')
.click()
.elementByName('Next')
.click()
.waitForElementById('Finished with Household', 2000)
.elementByName('Finished with Household')
.click()
});
});
129 changes: 129 additions & 0 deletions sample-code/examples/node/android_local_server_MMTest_new.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
"use strict";

require('colors');
require("./helpers/setup");

var actions = require('./helpers/actions');
var _p = require('./helpers/promise-utils'); // needed?
var _ = require('underscore');
var wd = require("wd"); // - move to config?
var Q = require('q');


var elements = require('./helpers/elements')
var simulator = false
var chai = require("chai");
var assert = chai.assert;
// var assert = require('assert'); //needed?
var config = require('./helpers/config')
chai.config.includeStack = true;
var commons = require('./helpers/commons').Commons;
var commonMethods = new commons();
var driver = config.driver;
var pry = require('pryjs');
// var actions = require('./helpers/actions')

wd.addPromiseChainMethod('swipe', actions.swipe);


describe("android local server", function () {

// Set up stuff

// this.timeout(30000);
this.timeout(33333333);
commonMethods.beforeAll();
commonMethods.afterAll();
commonMethods.afterEach();

// Tests

it("should open the app", function () {
var walkbookID = elements.homeScreen.walkbooks.split(/\//).splice(1,1).toString();
return driver

.elementById(elements.loginScreen.rememberMe)
.click()
.elementById(elements.loginScreen.userName)
.sendKeys('test_1654wseward')
.elementById(elements.loginScreen.password)
.sendKeys('asdf')
.elementById(elements.loginScreen.logIn)
.click().sleep(1000)
.waitForElementById(walkbookID, 5000)
});

it("should open Walkbooks and Preview the Survey", function() {
var previewSource
return driver
.elementById(elements.homeScreen.walkbooks)
.click().sleep(3000)
.waitForElementByName('and another one', 2000)
.elementByName('and another one')
.click()

// Survey Preview Validations

.elementByName('Preview Survey Questions')
.click()
.source().then(function (source) {
previewSource = source;
previewSource.should.include('and another one'); // survey title
previewSource.should.include('Question 1');
previewSource.should.include('Answer 1');
previewSource.should.include('Answer 2');
})
});

it('should select a walkbook, household, target, and take a survey', function () {
return driver
// Select a walkbook, list view, make assertions
.back()
.elementByName('Start')
.click()
.waitForElementByName('Select Walkbook', 2000)
.elementByXPath("//android.widget.TextView[@text='List']")
.click()
.waitForElementByName('Walkbook 28', 2000)
.elementByName('Walkbook 28')
.click().sleep(1000)
.waitForElementByName('Houses in Walkbook 28', 2000)
.elementByXPath("//android.widget.TextView[@text='List']")
.click()

// Select a house & assertions

.waitForElementByName('Parrott')
.elementByName('Parrott')
.click()

//ASSERTIONS

// select a target & assertions

.waitForElementById('dispoVoterRowParent')
.elementById('com.i360.i360Walk:id/dispoVoterRowParent')
.click()

//ASSERTIONS


// take survey

.waitForElementById('btnTakeSurvey', 2000 )
.elementByName('Take Survey')
.click()

//ASSERTIONS

.waitForElementByName('Answer 1', 2000)
.elementByName('Answer 1')
.click()
.elementByName('Next')
.click()
.then(function () {eval(pry.it); return this;})
.waitForElementById('Finished with Household', 2000)
.elementByName('Finished with Household')
.click()
});
});
17 changes: 17 additions & 0 deletions sample-code/examples/node/examples/android-login.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
"use strict";

require("./helpers/setup");

var wd = require("wd"),
_ = require('underscore'),
serverConfigs = require('./helpers/appium-servers');

//Let's try it!

it("should find an element", function () {
return driver
//.elementByAccessibilityId('etLoginUsername')
//.click()
.elementByXPath('//android.widget.EditText[@text=\'Username\']')
.should.exists;
});
3 changes: 2 additions & 1 deletion sample-code/examples/node/helpers/appium-servers.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@

exports.local = {
host: 'localhost',
port: 4723
};

/*
exports.sauce = {
host: 'ondemand.saucelabs.com',
port: 80,
username: process.env.npm_package_config_username,
password: process.env.npm_package_config_key
};
*/
1 change: 1 addition & 0 deletions sample-code/examples/node/helpers/apps.js
Original file line number Diff line number Diff line change
@@ -13,4 +13,5 @@ if (process.env.DEV) {

exports.iosWebviewAppLocal = "http://localhost:3000/WebViewApp7.1.app.zip";
exports.androidApiDemosLocal = "http://localhost:3000/ApiDemos-debug.apk";
exports.i360Walk = "https://www.seisan.us/clients/i360/walk/i360Walk.apk"
}
Loading