e2e delete tag test (#3583)

This commit is contained in:
Eugenio Romano 2018-07-12 03:13:40 +01:00 committed by Eugenio Romano
parent fcaa033a57
commit 7e3c5b4051
3 changed files with 64 additions and 8 deletions

View File

@ -68,6 +68,21 @@ var TagPage = function () {
return this; return this;
}; };
this.deleteTagFromTagListByNodeId = function () {
var deleteChip = element(by.css('button[id=\'tag_delete_0\']'));
Util.waitUntilElementIsVisible(deleteChip);
deleteChip.click();
return this;
};
this.deleteTagFromTagList = function () {
var deleteChip = element(by.xpath('//*[@id="tag_delete_0"]/mat-icon'));
Util.waitUntilElementIsVisible(deleteChip);
deleteChip.click();
return this;
};
this.getNewTagInput = function () { this.getNewTagInput = function () {
Util.waitUntilElementIsVisible(newTagInput); Util.waitUntilElementIsVisible(newTagInput);
return newTagInput.getAttribute('value'); return newTagInput.getAttribute('value');
@ -93,8 +108,9 @@ var TagPage = function () {
return Util.waitUntilElementIsNotOnPage(tag); return Util.waitUntilElementIsNotOnPage(tag);
}; };
this.checkTagListIsEmpty = function () { this.checkTagIsNotDisplayedInTagListByNodeId = function (tagName) {
Util.waitUntilElementIsNotOnPage(tagListRow); var tag = element(by.cssContainingText("span[id*='tag_name']", tagName));
return Util.waitUntilElementIsNotOnPage(tag);
}; };
this.checkTagIsDisplayedInTagListByNodeId = function (tagName) { this.checkTagIsDisplayedInTagListByNodeId = function (tagName) {
@ -102,6 +118,10 @@ var TagPage = function () {
return Util.waitUntilElementIsVisible(tag); return Util.waitUntilElementIsVisible(tag);
}; };
this.checkTagListIsEmpty = function () {
Util.waitUntilElementIsNotOnPage(tagListRow);
};
this.checkTagListByNodeIdIsEmpty = function () { this.checkTagListByNodeIdIsEmpty = function () {
return Util.waitUntilElementIsNotOnPage(tagListByNodeIdRow); return Util.waitUntilElementIsNotOnPage(tagListByNodeIdRow);
}; };

View File

@ -129,7 +129,7 @@ describe('Attachment list action menu for processes', () => {
attachmentListPage.checkFileIsRemoved(jpgFile.name); attachmentListPage.checkFileIsRemoved(jpgFile.name);
}); });
it('[C279886Edit] Option menu functionality - Completed Process', () => { it('[C279886] Option menu functionality - Completed Process', () => {
processServicesPage.goToProcessServices().goToApp(app.title).clickProcessButton(); processServicesPage.goToProcessServices().goToApp(app.title).clickProcessButton();
processFiltersPage.clickRunningFilterButton(); processFiltersPage.clickRunningFilterButton();

View File

@ -35,6 +35,7 @@ describe('Tag component', () => {
let acsUser = new AcsUserModel(); let acsUser = new AcsUserModel();
let pdfFileModel = new FileModel({ 'name': resources.Files.ADF_DOCUMENTS.PDF.file_name }); let pdfFileModel = new FileModel({ 'name': resources.Files.ADF_DOCUMENTS.PDF.file_name });
let deleteFile = new FileModel({ 'name': 'deleteFile.id' });
let sameTag = Util.generateRandomStringToLowerCase(); let sameTag = Util.generateRandomStringToLowerCase();
let tagList = [Util.generateRandomStringToLowerCase(), Util.generateRandomStringToLowerCase()]; let tagList = [Util.generateRandomStringToLowerCase(), Util.generateRandomStringToLowerCase()];
let uppercaseTag = Util.generateRandomStringToUpperCase(); let uppercaseTag = Util.generateRandomStringToUpperCase();
@ -57,14 +58,18 @@ describe('Tag component', () => {
let pdfUploadedFile = await uploadActions.uploadFile(this.alfrescoJsApi, pdfFileModel.location, pdfFileModel.name, '-my-'); let pdfUploadedFile = await uploadActions.uploadFile(this.alfrescoJsApi, pdfFileModel.location, pdfFileModel.name, '-my-');
let uploadedDeleteFile = await uploadActions.uploadFile(this.alfrescoJsApi, deleteFile.location, deleteFile.name, '-my-');
Object.assign(pdfFileModel, pdfUploadedFile.entry); Object.assign(pdfFileModel, pdfUploadedFile.entry);
Object.assign(deleteFile, uploadedDeleteFile.entry);
loginPage.loginToContentServicesUsingUserModel(acsUser); loginPage.loginToContentServicesUsingUserModel(acsUser);
done(); done();
}); });
it('Tag node ID', () => { it('[C260374] Tag node ID', () => {
tagPage.goToTagPage(); tagPage.goToTagPage();
expect(tagPage.getNodeId()).toEqual(''); expect(tagPage.getNodeId()).toEqual('');
expect(tagPage.getNewTagPlaceholder()).toEqual('New Tag'); expect(tagPage.getNewTagPlaceholder()).toEqual('New Tag');
@ -75,7 +80,7 @@ describe('Tag component', () => {
expect(tagPage.getNewTagInput()).toEqual('a'); expect(tagPage.getNewTagInput()).toEqual('a');
}); });
it('New tag for specific Node ID', () => { it('[C268151] New tag for specific Node ID', () => {
tagPage.goToTagPage(); tagPage.goToTagPage();
tagPage.insertNodeId(pdfFileModel.id); tagPage.insertNodeId(pdfFileModel.id);
tagPage.addTag(tagList[0]); tagPage.addTag(tagList[0]);
@ -84,7 +89,7 @@ describe('Tag component', () => {
tagPage.checkTagIsDisplayedInTagListByNodeId(tagList[0]); tagPage.checkTagIsDisplayedInTagListByNodeId(tagList[0]);
}); });
it('Tag name already exists', () => { it('[C260377] Tag name already exists', () => {
tagPage.goToTagPage(); tagPage.goToTagPage();
tagPage.insertNodeId(pdfFileModel.id); tagPage.insertNodeId(pdfFileModel.id);
tagPage.addTag(sameTag); tagPage.addTag(sameTag);
@ -93,7 +98,7 @@ describe('Tag component', () => {
expect(tagPage.getErrorMessage()).toEqual('Tag already exists'); expect(tagPage.getErrorMessage()).toEqual('Tag already exists');
}); });
it('Multiple tags', () => { it('[C260378] Multiple tags', () => {
tagPage.goToTagPage(); tagPage.goToTagPage();
tagPage.insertNodeId(pdfFileModel.id); tagPage.insertNodeId(pdfFileModel.id);
tagPage.checkTagListIsOrderedAscending(); tagPage.checkTagListIsOrderedAscending();
@ -101,7 +106,7 @@ describe('Tag component', () => {
tagPage.checkTagListContentServicesIsOrderedAscending(); tagPage.checkTagListContentServicesIsOrderedAscending();
}); });
it('Tag text field', () => { it('[C91326] Tag text field', () => {
tagPage.goToTagPage(); tagPage.goToTagPage();
tagPage.insertNodeId(pdfFileModel.id); tagPage.insertNodeId(pdfFileModel.id);
@ -125,4 +130,35 @@ describe('Tag component', () => {
tagPage.checkTagIsDisplayedInTagList(nonLatinTag); tagPage.checkTagIsDisplayedInTagList(nonLatinTag);
tagPage.checkTagIsDisplayedInTagListByNodeId(nonLatinTag); tagPage.checkTagIsDisplayedInTagListByNodeId(nonLatinTag);
}); });
it('[C260375] Delete tag', () => {
let deleteTag = Util.generateRandomStringToUpperCase();
tagPage.goToTagPage();
tagPage.insertNodeId(deleteFile.id);
tagPage.addTag(deleteTag);
tagPage.checkTagIsDisplayedInTagList(deleteTag.toLowerCase());
tagPage.checkTagIsDisplayedInTagListByNodeId(deleteTag.toLowerCase());
tagPage.deleteTagFromTagListByNodeId();
tagPage.checkTagIsNotDisplayedInTagList(deleteTag.toLowerCase());
tagPage.checkTagIsNotDisplayedInTagListByNodeId(deleteTag.toLowerCase());
tagPage.insertNodeId(deleteFile.id);
tagPage.addTag(deleteTag);
tagPage.checkTagIsDisplayedInTagList(deleteTag.toLowerCase());
tagPage.checkTagIsDisplayedInTagListByNodeId(deleteTag.toLowerCase());
tagPage.deleteTagFromTagList();
tagPage.checkTagIsNotDisplayedInTagList(deleteTag.toLowerCase());
tagPage.checkTagIsNotDisplayedInTagListByNodeId(deleteTag.toLowerCase());
});
}); });