cbe469ef87
* Chat menu restyle * Update username.js updated span to have id #username-display. Needed for tests * removed chat menu failing tests * hide form on username change (while same username) * fixed onusernamechange handler * resized username label, removed some margins * removed commented out code
30 lines
839 B
JavaScript
30 lines
839 B
JavaScript
async function interactiveChatTest(
|
|
browser,
|
|
page,
|
|
newName,
|
|
chatMessage,
|
|
device
|
|
) {
|
|
it('should have the chat input', async () => {
|
|
await page.waitForSelector('#message-input');
|
|
});
|
|
|
|
it('should have the chat input enabled', async () => {
|
|
const isDisabled = await page.evaluate(
|
|
'document.querySelector("#message-input").getAttribute("disabled")'
|
|
);
|
|
expect(isDisabled).not.toBe('true');
|
|
});
|
|
|
|
it('should allow typing a chat message', async () => {
|
|
await page.waitForSelector('#message-input');
|
|
await page.evaluate(() => document.querySelector('#message-input').click());
|
|
await page.waitForTimeout(1000);
|
|
await page.focus('#message-input');
|
|
await page.keyboard.type(chatMessage);
|
|
page.keyboard.press('Enter');
|
|
});
|
|
}
|
|
|
|
module.exports.interactiveChatTest = interactiveChatTest;
|