Created
March 28, 2018 08:29
-
-
Save AlexanderMoskovkin/f1e0e74540b3e1a59490e2cb9183673d to your computer and use it in GitHub Desktop.
[Stack Overflow Question] Define testcafe userrole in typescript
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
import { Role, t } from 'testcafe'; | |
export const UserRole: Role = Role('https://github.com/login', async (t) => { | |
await t | |
.typeText('#login_field', '<my-login>') | |
.typeText('#password', '<my-password>') | |
.click('input[value="Sign in"]'); | |
}, { preserveUrl: true }); |
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
import { Selector } from 'testcafe'; | |
import { UserRole } from './role'; | |
fixture('Check logged user') | |
.beforeEach(async t => { | |
await t.useRole(UserRole); | |
}); | |
test('test', async t => { | |
await t.wait(1000); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment