Skip to content

Instantly share code, notes, and snippets.

@shamique
Created February 17, 2020 15:53
Show Gist options
  • Save shamique/e469c48b25ebd0559c8aec563b9ac4a1 to your computer and use it in GitHub Desktop.
Save shamique/e469c48b25ebd0559c8aec563b9ac4a1 to your computer and use it in GitHub Desktop.
var expect = require('chai').expect;
describe('Simple App testing', () => {
// Adding time out to make sure the app is load prior to test is run
beforeEach(() => {
$("~app-root").waitForDisplayed(11000, false)
});
it('Valid Login Test', async => {
$('~username').setValue("shamique");
$('~password').setValue("123456");
$("~login").click();
$("~loginstatus").waitForDisplayed(11000);
const status = $("~loginstatus").getText();
expect(status).to.equal('success');
});
it('Invalid Login Test', async => {
$('~username').setValue("shamique");
$('~password').setValue("12345");
$("~login").click();
$("~loginstatus").waitForDisplayed(11000);
const status = $("~loginstatus").getText();
expect(status).to.equal('fail');
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment