mirror of
https://github.com/scratchfoundation/scratch-www.git
synced 2025-02-17 00:21:20 -05:00
add project comment reply integration test
This commit is contained in:
parent
375d37d225
commit
aa27e2c809
1 changed files with 26 additions and 0 deletions
|
@ -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);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue