workadventure/tests/tests/utils/roles.ts
David Négrier eac4bb2875 Refactoring test cafe tests
- Using "Roles" to log users
- Adding seemingly useless import statement but important for code completion
2021-11-28 16:43:12 +01:00

21 lines
773 B
TypeScript

import { Role } from 'testcafe';
export const userAlice = Role('http://play.workadventure.localhost/', async t => {
await t
.typeText('input[name="loginSceneName"]', 'Alice')
.click('button.loginSceneFormSubmit')
.click('button.selectCharacterButtonRight')
.click('button.selectCharacterButtonRight')
.click('button.selectCharacterSceneFormSubmit')
.click('button.letsgo');
});
export const userBob = Role('http://play.workadventure.localhost/', async t => {
await t
.typeText('input[name="loginSceneName"]', 'Bob')
.click('button.loginSceneFormSubmit')
.click('button.selectCharacterButtonRight')
.click('button.selectCharacterSceneFormSubmit')
.click('button.letsgo');
});