2018-11-22 04:58:45 +08:00
|
|
|
const e = require('./elements');
|
|
|
|
|
|
|
|
async function openChat(test) {
|
2018-11-24 03:18:05 +08:00
|
|
|
// TODO: Check this if it's open before click
|
2020-01-29 03:25:27 +08:00
|
|
|
// await test.click(ce.userList);
|
|
|
|
// await test.click(e.chatButton, true);
|
2018-11-23 22:43:35 +08:00
|
|
|
await test.waitForSelector(e.chatBox);
|
|
|
|
await test.waitForSelector(e.chatMessages);
|
2018-11-22 04:58:45 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
async function getTestElements(test) {
|
2020-01-29 03:25:27 +08:00
|
|
|
const messages = await test.page.$$(`${e.chatUserMessage} ${e.chatMessageText}`);
|
2018-11-22 04:58:45 +08:00
|
|
|
return messages;
|
|
|
|
}
|
|
|
|
|
|
|
|
exports.openChat = openChat;
|
|
|
|
exports.getTestElements = getTestElements;
|