bigbluebutton-Github/bigbluebutton-html5/tests/puppeteer/chat/copy.js

32 lines
703 B
JavaScript
Raw Normal View History

// Test: Cleaning a chat message
const clipboardy = require('clipboardy');
2018-11-23 20:55:16 +08:00
const Page = require('../core/page');
const e = require('./elements');
const util = require('./util');
class Copy extends Page {
constructor() {
super('chat-copy');
}
async test() {
await util.openChat(this);
// sending a message
await this.type(e.chatBox, e.message);
await this.click(e.sendButton);
await this.screenshot(true);
await this.click(e.chatOptions);
await this.click(e.chatCopy, true);
const copiedChat = clipboardy.readSync();
expect(copiedChat).toEqual(expect.stringContaining(`User1 : ${e.message}`));
return true;
}
}
module.exports = exports = Copy;