Skip to content

Instantly share code, notes, and snippets.

@VasilyStrelyaev
Created July 24, 2017 08:22
Show Gist options
  • Save VasilyStrelyaev/0bc4ef527ad7fb5a127afca6490416b0 to your computer and use it in GitHub Desktop.
Save VasilyStrelyaev/0bc4ef527ad7fb5a127afca6490416b0 to your computer and use it in GitHub Desktop.
import { Role } from 'testcafe';
const loginPageUrl = 'http://example.com/login';
const regularUser = Role(loginPageUrl, async t => {
await t
.typeText('#login', 'TestUser')
.typeText('#password', 'testpass')
.click('#sign-in');
});
const admin = Role(loginPageUrl, async t => {
await t
.typeText('#login', 'Admin')
.typeText('#password', 'adminpass')
.click('#sign-in');
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment