mirror of
https://github.com/scratchfoundation/scratch-www.git
synced 2025-02-17 00:21:20 -05:00
Add studio comment reply integration test
This commit is contained in:
parent
aa594a48fc
commit
bf9b14633f
1 changed files with 26 additions and 0 deletions
|
@ -40,6 +40,7 @@ let profileComment = buildNumber + ' profile';
|
|||
let studioComment = buildNumber + ' studio';
|
||||
|
||||
let projectReply = projectComment + ' reply';
|
||||
let studioReply = studioComment + ' reply';
|
||||
|
||||
if (remote) {
|
||||
jest.setTimeout(60000);
|
||||
|
@ -282,5 +283,30 @@ describe('comment tests', async () => {
|
|||
let commentVisible = await postedReply.isDisplayed();
|
||||
await expect(commentVisible).toBe(true);
|
||||
});
|
||||
|
||||
test('studio: reply to comment', async () => {
|
||||
await driver.get(studioUrl);
|
||||
|
||||
// find the comment and click reply
|
||||
let commentXpath = `//span[contains(text(), "${studioComment}")]/../..`;
|
||||
await clickXpath(commentXpath + '//span[@class = "comment-reply"]');
|
||||
|
||||
// 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(studioReply);
|
||||
|
||||
// click post
|
||||
let postButton = await findByXpath(replyRow + '//button[@class = "button compose-post"]');
|
||||
await postButton.click();
|
||||
|
||||
// find reply
|
||||
await driver.sleep(500);
|
||||
await driver.get(studioUrl);
|
||||
let postedReply = await findByXpath(`//span[contains(text(), "${studioReply}")]`);
|
||||
let commentVisible = await postedReply.isDisplayed();
|
||||
await expect(commentVisible).toBe(true);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue