Skip to content

Instantly share code, notes, and snippets.

@VasilyStrelyaev
Created July 24, 2017 08:25
Show Gist options
  • Save VasilyStrelyaev/2de92b851fc1ecfe2c2422d8b294b5b3 to your computer and use it in GitHub Desktop.
Save VasilyStrelyaev/2de92b851fc1ecfe2c2422d8b294b5b3 to your computer and use it in GitHub Desktop.
import { Role } from 'testcafe';
import { LoginPage } from './page-object';
const page = new LoginPage();
const loginPageUrl = 'https://github.com/login';
export const johnSmith = Role(loginPageUrl, async t => {
await t
// To try the test in action, provide real credentials.
.typeText(page.login, 'johnsmith')
.typeText(page.password, 'iamjohnsmith')
.click(page.signIn);
});
export const aliceBrown = Role(loginPageUrl, async t => {
await t
// To try the test in action, provide real credentials.
.typeText(page.login, 'alicebrown')
.typeText(page.password, 'mynameisalice')
.click(page.signIn);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment