2021-11-03 03:27:41 +01:00
|
|
|
async function interactiveChatTest(
|
|
|
|
browser,
|
|
|
|
page,
|
|
|
|
newName,
|
|
|
|
chatMessage,
|
|
|
|
device
|
|
|
|
) {
|
2021-09-17 23:04:09 +02:00
|
|
|
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');
|
2021-11-03 03:27:41 +01:00
|
|
|
await page.evaluate(() => document.querySelector('#message-input').click());
|
2021-09-17 23:04:09 +02:00
|
|
|
await page.waitForTimeout(1000);
|
2021-11-03 03:27:41 +01:00
|
|
|
await page.focus('#message-input');
|
|
|
|
await page.keyboard.type(chatMessage);
|
2021-09-17 23:04:09 +02:00
|
|
|
page.keyboard.press('Enter');
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
module.exports.interactiveChatTest = interactiveChatTest;
|