Skip to content

Instantly share code, notes, and snippets.

@hyperh
Last active September 12, 2017 02:31
Show Gist options
  • Select an option

  • Save hyperh/8406e93678935b8bd1c57212938dbccc to your computer and use it in GitHub Desktop.

Select an option

Save hyperh/8406e93678935b8bd1c57212938dbccc to your computer and use it in GitHub Desktop.
import wd from 'wd';
jasmine.DEFAULT_TIMEOUT_INTERVAL = 60000;
const PORT = 4723;
const config = {
platformName: 'Android',
deviceName: 'Android Emulator',
app: './android/app/build/outputs/apk/app-debug.apk' // relative to root of project
};
const driver = wd.promiseChainRemote('localhost', PORT);
beforeAll(async () => {
await driver.init(config);
await driver.sleep(2000); // wait for app to load
})
test('appium renders', async () => {
expect(await driver.hasElementByAccessibilityId('testview')).toBe(true);
expect(await driver.hasElementByAccessibilityId('notthere')).toBe(false);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment