mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-31 17:38:48 +00:00
[ADF-3378] Create automated tests for comments - Content Services PT2 (#3708)
* [ADF-3378] Create automated tests for comments - Content Services PT2 * Removing unnecessary import
This commit is contained in:
@@ -53,7 +53,8 @@ describe('Comment Component', () => {
|
|||||||
First name: <input type="text" name="fname"><br>
|
First name: <input type="text" name="fname"><br>
|
||||||
Last name: <input type="text" name="lname"><br>
|
Last name: <input type="text" name="lname"><br>
|
||||||
<input type="submit" value="Submit">
|
<input type="submit" value="Submit">
|
||||||
</form>`
|
</form>`,
|
||||||
|
test: 'Test'
|
||||||
};
|
};
|
||||||
|
|
||||||
beforeAll(async (done) => {
|
beforeAll(async (done) => {
|
||||||
@@ -96,6 +97,26 @@ describe('Comment Component', () => {
|
|||||||
done();
|
done();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('[C276947] Should be able to add a comment on ACS and view on ADF', () => {
|
||||||
|
|
||||||
|
browser.controlFlow().execute(async() => {
|
||||||
|
await this.alfrescoJsApi.core.commentsApi.addComment(nodeId, {content: comments.test});
|
||||||
|
});
|
||||||
|
|
||||||
|
viewerPage.viewFile(pngFileModel.name);
|
||||||
|
viewerPage.clickInfoButton();
|
||||||
|
viewerPage.checkInfoSideBarIsDisplayed();
|
||||||
|
|
||||||
|
commentsPage.checkCommentsTabIsSelected();
|
||||||
|
commentsPage.checkCommentInputIsDisplayed();
|
||||||
|
|
||||||
|
expect(commentsPage.getTotalNumberOfComments()).toEqual('Comments (1)');
|
||||||
|
expect(commentsPage.getMessage(0)).toEqual(comments.test);
|
||||||
|
expect(commentsPage.getUserName(0)).toEqual(userFullName);
|
||||||
|
expect(commentsPage.getTime(0)).toContain('ago');
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
it('[C276948] Should be able to add a comment on a file', () => {
|
it('[C276948] Should be able to add a comment on a file', () => {
|
||||||
viewerPage.viewFile(pngFileModel.name);
|
viewerPage.viewFile(pngFileModel.name);
|
||||||
viewerPage.clickInfoButton();
|
viewerPage.clickInfoButton();
|
||||||
|
@@ -28,6 +28,7 @@ export class CommentsPage {
|
|||||||
commentTime = element.all(by.id('comment-time'));
|
commentTime = element.all(by.id('comment-time'));
|
||||||
commentInput = element(by.id('comment-input'));
|
commentInput = element(by.id('comment-input'));
|
||||||
addCommentButton = element(by.css("[data-automation-id='comments-input-add']"));
|
addCommentButton = element(by.css("[data-automation-id='comments-input-add']"));
|
||||||
|
commentsTab = element(by.cssContainingText("div[id*='mat-tab-label']", 'Comments'));
|
||||||
|
|
||||||
getTotalNumberOfComments() {
|
getTotalNumberOfComments() {
|
||||||
Util.waitUntilElementIsVisible(this.numberOfComments);
|
Util.waitUntilElementIsVisible(this.numberOfComments);
|
||||||
@@ -63,4 +64,14 @@ export class CommentsPage {
|
|||||||
this.commentInput.sendKeys(comment);
|
this.commentInput.sendKeys(comment);
|
||||||
return this.addCommentButton.click();
|
return this.addCommentButton.click();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
checkCommentsTabIsSelected() {
|
||||||
|
this.commentsTab.getAttribute('aria-selected').then((result) => {
|
||||||
|
expect(result).toBe('true');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
checkCommentInputIsDisplayed() {
|
||||||
|
Util.waitUntilElementIsVisible(this.commentInput);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user