Last active
February 17, 2019 17:32
-
-
Save gregmercer/5f712019e98082bb40a43d1f820c0160 to your computer and use it in GitHub Desktop.
Testing Web App AWS Web Farm Appium Nodejs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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