identation and update copy checks

This commit is contained in:
Gabriel Porfirio 2022-09-16 17:26:47 -03:00
parent 53673e848e
commit dd4dadde3e
2 changed files with 103 additions and 103 deletions

View File

@ -103,112 +103,112 @@ class Chat extends Page {
await expect(messageLocator).toHaveCount(0);
}
// Emojis
async sendEmoji() {
const { emojiPickerEnabled } = getSettings();
test.fail(!emojiPickerEnabled, 'Emoji Picker is disabled');
await openChat(this);
const message = this.getLocator(e.chatUserMessageText);
await expect(message).toHaveCount(0);
await this.waitAndClick(e.emojiPickerButton);
await this.waitAndClick(e.emojiSent);
await this.waitAndClick(e.sendButton);
await this.waitForSelector(e.chatUserMessageText);
await expect(message).toHaveCount(1);
}
async emojiCopyChat(context) {
const { emojiPickerEnabled } = getSettings();
test.fail(!emojiPickerEnabled, 'Emoji Picker is disabled');
await openChat(this);
await this.waitAndClick(e.emojiPickerButton);
await this.waitAndClick(e.emojiSent);
await this.waitAndClick(e.sendButton);
await this.waitAndClick(e.chatOptions);
await this.waitForSelector(e.chatUserMessageText);
await this.waitAndClick(e.chatCopy);
// Emojis
async sendEmoji() {
const { emojiPickerEnabled } = getSettings();
test.fail(!emojiPickerEnabled, 'Emoji Picker is disabled');
const copiedText = await this.getCopiedText(context);
const check = copiedText.includes(`${p.fullName}: ${e.emojiSent}`);
expect(check).toBeTruthy();
}
await openChat(this);
const message = this.getLocator(e.chatUserMessageText);
await expect(message).toHaveCount(0);
async emojiSaveChat(testInfo) {
const { emojiPickerEnabled } = getSettings();
test.fail(!emojiPickerEnabled, 'Emoji Picker is disabled');
await openChat(this);
await this.waitAndClick(e.emojiPickerButton);
await this.waitAndClick(e.emojiSent);
await this.waitAndClick(e.sendButton);
await this.waitForSelector(e.chatUserMessageText);
await this.waitAndClick(e.chatOptions);
const { content } = await this.handleDownload(e.chatSave, testInfo);
const dataToCheck = [
this.meetingId,
this.username,
e.frequentlyUsedEmoji,
];
await checkTextContent(content, dataToCheck);
}
async autoConvertEmojiPublicChat() {
const { autoConvertEmojiEnabled } = getSettings();
test.fail(!autoConvertEmojiEnabled, 'Auto Convert Emoji is disabled');
await openChat(this);
const message = this.getLocator(e.chatUserMessageText);
await expect(message).toHaveCount(0);
await this.type(e.chatBox, e.autoConvertEmojiMessage);
await this.waitAndClick(e.sendButton);
await this.waitForSelector(e.chatUserMessageText);
await expect(message).toHaveCount(1);
}
async autoConvertEmojiCopyChat(context) {
const { autoConvertEmojiEnabled } = getSettings();
test.fail(!autoConvertEmojiEnabled, 'Auto Convert Emoji is disabled');
await openChat(this);
await this.type(e.chatBox, e.autoConvertEmojiMessage);
await this.waitAndClick(e.sendButton);
await this.waitAndClick(e.chatOptions);
await this.waitForSelector(e.chatUserMessageText);
await this.waitAndClick(e.chatCopy);
await this.waitAndClick(e.emojiPickerButton);
await this.waitAndClick(e.emojiSent);
await this.waitAndClick(e.sendButton);
const copiedText = await this.getCopiedText(context);
const check = copiedText.includes(`${p.fullName}: ${e.autoConvertEmojiMessage}`);
expect(check).toBeTruthy();
}
await this.waitForSelector(e.chatUserMessageText);
await expect(message).toHaveCount(1);
}
async autoConvertEmojiSaveChat(testInfo) {
const { autoConvertEmojiEnabled } = getSettings();
test.fail(!autoConvertEmojiEnabled, 'Auto Convert Emoji is disabled');
await openChat(this);
await this.type(e.chatBox, e.autoConvertEmojiMessage);
await this.waitAndClick(e.sendButton);
await this.waitForSelector(e.chatUserMessageText);
await this.waitAndClick(e.chatOptions);
const { content } = await this.handleDownload(e.chatSave, testInfo);
const dataToCheck = [
this.meetingId,
this.username,
e.convertedEmojiMessage,
];
await checkTextContent(content, dataToCheck);
}
async emojiCopyChat(context) {
const { emojiPickerEnabled } = getSettings();
test.fail(!emojiPickerEnabled, 'Emoji Picker is disabled');
await openChat(this);
await this.waitAndClick(e.emojiPickerButton);
await this.waitAndClick(e.emojiSent);
await this.waitAndClick(e.sendButton);
await this.waitAndClick(e.chatOptions);
await this.waitForSelector(e.chatUserMessageText);
await this.waitAndClick(e.chatCopy);
const copiedText = await this.getCopiedText(context);
const check = copiedText.includes(`${p.fullName}: ${e.frequentlyUsedEmoji}`);
expect(check).toBeTruthy();
}
async emojiSaveChat(testInfo) {
const { emojiPickerEnabled } = getSettings();
test.fail(!emojiPickerEnabled, 'Emoji Picker is disabled');
await openChat(this);
await this.waitAndClick(e.emojiPickerButton);
await this.waitAndClick(e.emojiSent);
await this.waitAndClick(e.sendButton);
await this.waitForSelector(e.chatUserMessageText);
await this.waitAndClick(e.chatOptions);
const { content } = await this.handleDownload(e.chatSave, testInfo);
const dataToCheck = [
this.meetingId,
this.username,
e.frequentlyUsedEmoji,
];
await checkTextContent(content, dataToCheck);
}
async autoConvertEmojiPublicChat() {
const { autoConvertEmojiEnabled } = getSettings();
test.fail(!autoConvertEmojiEnabled, 'Auto Convert Emoji is disabled');
await openChat(this);
const message = this.getLocator(e.chatUserMessageText);
await expect(message).toHaveCount(0);
await this.type(e.chatBox, e.autoConvertEmojiMessage);
await this.waitAndClick(e.sendButton);
await this.waitForSelector(e.chatUserMessageText);
await expect(message).toHaveCount(1);
}
async autoConvertEmojiCopyChat(context) {
const { autoConvertEmojiEnabled } = getSettings();
test.fail(!autoConvertEmojiEnabled, 'Auto Convert Emoji is disabled');
await openChat(this);
await this.type(e.chatBox, e.autoConvertEmojiMessage);
await this.waitAndClick(e.sendButton);
await this.waitAndClick(e.chatOptions);
await this.waitForSelector(e.chatUserMessageText);
await this.waitAndClick(e.chatCopy);
const copiedText = await this.getCopiedText(context);
const check = copiedText.includes(`${p.fullName}: ${e.convertedEmojiMessage}`);
expect(check).toBeTruthy();
}
async autoConvertEmojiSaveChat(testInfo) {
const { autoConvertEmojiEnabled } = getSettings();
test.fail(!autoConvertEmojiEnabled, 'Auto Convert Emoji is disabled');
await openChat(this);
await this.type(e.chatBox, e.autoConvertEmojiMessage);
await this.waitAndClick(e.sendButton);
await this.waitForSelector(e.chatUserMessageText);
await this.waitAndClick(e.chatOptions);
const { content } = await this.handleDownload(e.chatSave, testInfo);
const dataToCheck = [
this.meetingId,
this.username,
e.convertedEmojiMessage,
];
await checkTextContent(content, dataToCheck);
}
}
exports.Chat = Chat;

View File

@ -23,7 +23,7 @@ test.describe.parallel('Chat', () => {
await chat.clearChat();
});
test.only('Copy chat', async ({ browser, context, page }, testInfo) => {
test('Copy chat', async ({ browser, context, page }, testInfo) => {
test.fixme(testInfo.project.use.headless, 'Only works in headed mode');
const chat = new Chat(browser, page);
await chat.init(true, true);