partey_workadventure/tests/tests/utils/roles.ts
2022-02-18 15:43:06 +01:00

21 lines
579 B
TypeScript

import { Page } from '@playwright/test';
export async function login(
page: Page,
userName: string = 'Alice',
characterNumber: number = 2,
browserLanguage: string | null = 'en-US'
) {
// window.localStorage.setItem('language', browserLanguage)
await page.fill('input[name="loginSceneName"]', userName);
await page.click('button.loginSceneFormSubmit');
for (let i = 0; i < characterNumber; i++) {
await page.click('button.selectCharacterButtonRight');
}
await page.click('button.selectCharacterSceneFormSubmit');
await page.click('button.letsgo');
}