-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
29 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import { test as base, expect } from '@playwright/test'; | ||
import { Menu } from './fixtures/menu'; | ||
import { RoomPage } from './fixtures/room-page'; | ||
import { user2AuthFile } from './config'; | ||
|
||
const test = base.extend<{ menu: Menu, roomPage: RoomPage }>({ | ||
async menu({ page }, use) { | ||
const menu = new Menu(page); | ||
await use(menu); | ||
}, | ||
|
||
async roomPage({ page }, use) { | ||
const roomPage = new RoomPage(page); | ||
await use(roomPage); | ||
} | ||
}) | ||
|
||
test('users can rename themselves', async ({ page, menu, roomPage }) => { | ||
await page.goto('/'); | ||
|
||
await menu.open(); | ||
await menu.createRoom(); | ||
|
||
await roomPage.sendMessage('/rename user Joe Bloggs'); | ||
await expect(roomPage.getMessage('User Test User 1 renamed to Joe Bloggs')).toBeVisible(); | ||
|
||
await roomPage.sendMessage('/rename user Test User 1'); | ||
await expect(roomPage.getMessage('User Joe Bloggs renamed to Test User 1')).toBeVisible(); | ||
}); |