add project comment reply integration test

This commit is contained in:
BryceLTaylor 2021-10-26 12:02:25 -04:00
parent 375d37d225
commit aa27e2c809

View file

@ -39,6 +39,8 @@ let projectComment = buildNumber + ' project';
let profileComment = buildNumber + ' profile';
let studioComment = buildNumber + ' studio';
let projectReply = projectComment + ' reply';
if (remote) {
jest.setTimeout(60000);
} else {
@ -254,5 +256,29 @@ describe('comment tests', async () => {
let isHighlighted = await containsClass(commentContainer, 'highlighted');
await expect(isHighlighted).toBe(true);
});
test('project: reply to comment', async () => {
await driver.get(projectUrl);
let commentXpath = `//span[contains(text(), "${projectComment}")]`;
let replyXpath = commentXpath + '/../following-sibling::div/span[@class = "comment-reply"]';
await clickXpath(replyXpath);
// type reply
let replyRow = '//div[contains(@class, "comment-reply-row")]';
let replyComposeXpath = replyRow + '//textArea[@class = "inplace-textarea"]';
let composeBox = await findByXpath(replyComposeXpath);
await composeBox.sendKeys(projectReply);
// click post
let postButton = await findByXpath(replyRow + '//button[@class = "button compose-post"]');
await postButton.click();
// find reply
await driver.sleep(500);
await driver.get(projectUrl);
let postedReply = await findByXpath(`//span[contains(text(), "${projectReply}")]`);
let commentVisible = await postedReply.isDisplayed();
await expect(commentVisible).toBe(true);
});
});
});