Skip to content

Instantly share code, notes, and snippets.

@gregmercer
Last active February 17, 2019 17:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gregmercer/5f712019e98082bb40a43d1f820c0160 to your computer and use it in GitHub Desktop.
Save gregmercer/5f712019e98082bb40a43d1f820c0160 to your computer and use it in GitHub Desktop.
Testing Web App AWS Web Farm Appium Nodejs
// https://aws.amazon.com/blogs/mobile/testing-mobile-apps-across-hundreds-of-real-devices-with-appium-node-js-and-aws-device-farm/
var expect = require('chai').expect;
var desiredCaps = {
// The generated session will be visible to you only.
sessionName: 'Automation test session',
sessionDescription: '',
deviceOrientation: 'portrait',
browserName: 'Safari',
deviceName: process.env.DEVICEFARM_DEVICE_NAME,
platformName: process.env.DEVICEFARM_DEVICE_PLATFORM_NAME
}
var wd = require('wd'),
driver = wd.promiseChainRemote({
host: 'localhost',
port: 4723
});
var assert = require('assert');
describe('test on aws device farm', function () {
before(function () {
this.timeout(300 * 1000);
return driver.init(desiredCaps);
});
after(function () {
console.log("quitting");
});
it('do get', async function () {
this.timeout(10000);
await driver.get('https://google.com')
.sleep(6000)
let title = await driver.title()
console.log('found this title ' + title)
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment