diff --git a/e2e/content-services/document-list/document-list-component.e2e.ts b/e2e/content-services/document-list/document-list-component.e2e.ts index b326b5ef26..20dc4ee799 100644 --- a/e2e/content-services/document-list/document-list-component.e2e.ts +++ b/e2e/content-services/document-list/document-list-component.e2e.ts @@ -204,7 +204,7 @@ describe('Document List Component', () => { timeAgoUploadedNode = await uploadActions.uploadFile(this.alfrescoJsApi, timeAgoFileModel.location, timeAgoFileModel.name, '-my-'); contentServicesPage.goToDocumentList(); const dateValue = contentServicesPage.getColumnValueForRow(timeAgoFileModel.name, 'Created'); - expect(dateValue).toContain('ago'); + expect(dateValue).toMatch(/(ago|few)/); done(); }); @@ -608,25 +608,25 @@ describe('Document List Component', () => { expect(contentServicesPage.getAttributeValueForElement(folderName, cardProperties.DISPLAY_NAME)).toBe(folderName); expect(contentServicesPage.getAttributeValueForElement(folderName, cardProperties.CREATED_BY)).toBe(`${funnyUser.entry.firstName} ${funnyUser.entry.lastName}`); - expect(contentServicesPage.getAttributeValueForElement(folderName, cardProperties.CREATED)).toContain('ago'); + expect(contentServicesPage.getAttributeValueForElement(folderName, cardProperties.CREATED)).toMatch(/(ago|few)/); expect(contentServicesPage.getAttributeValueForElement(pdfFile.name, cardProperties.DISPLAY_NAME)).toBe(pdfFile.name); expect(contentServicesPage.getAttributeValueForElement(pdfFile.name, cardProperties.SIZE)).toBe(`702.76 KB`); expect(contentServicesPage.getAttributeValueForElement(pdfFile.name, cardProperties.CREATED_BY)).toBe(`${funnyUser.entry.firstName} ${funnyUser.entry.lastName}`); - expect(contentServicesPage.getAttributeValueForElement(pdfFile.name, cardProperties.CREATED)).toContain('ago'); + expect(contentServicesPage.getAttributeValueForElement(pdfFile.name, cardProperties.CREATED)).toMatch(/(ago|few)/); expect(contentServicesPage.getAttributeValueForElement(docxFile.name, cardProperties.DISPLAY_NAME)).toBe(docxFile.name); expect(contentServicesPage.getAttributeValueForElement(docxFile.name, cardProperties.SIZE)).toBe(`81.05 KB`); expect(contentServicesPage.getAttributeValueForElement(docxFile.name, cardProperties.CREATED_BY)).toBe(`${funnyUser.entry.firstName} ${funnyUser.entry.lastName}`); - expect(contentServicesPage.getAttributeValueForElement(docxFile.name, cardProperties.CREATED)).toContain('ago'); + expect(contentServicesPage.getAttributeValueForElement(docxFile.name, cardProperties.CREATED)).toMatch(/(ago|few)/); expect(contentServicesPage.getAttributeValueForElement(testFile.name, cardProperties.DISPLAY_NAME)).toBe(testFile.name); expect(contentServicesPage.getAttributeValueForElement(testFile.name, cardProperties.SIZE)).toBe(`14 Bytes`); expect(contentServicesPage.getAttributeValueForElement(testFile.name, cardProperties.CREATED_BY)).toBe(`${funnyUser.entry.firstName} ${funnyUser.entry.lastName}`); - expect(contentServicesPage.getAttributeValueForElement(testFile.name, cardProperties.CREATED)).toContain('ago'); + expect(contentServicesPage.getAttributeValueForElement(testFile.name, cardProperties.CREATED)).toMatch(/(ago|few)/); }); it('[C280129] Should keep Gallery View when accessing a folder', () => { diff --git a/e2e/process-services/comment-component-processes.e2e.ts b/e2e/process-services/comment-component-processes.e2e.ts index ac826558ec..5646253d2c 100644 --- a/e2e/process-services/comment-component-processes.e2e.ts +++ b/e2e/process-services/comment-component-processes.e2e.ts @@ -96,7 +96,7 @@ describe('Comment component for Processes', () => { expect(commentsPage.getTotalNumberOfComments()).toEqual('Comments (' + addedComment.total + ')'); expect(commentsPage.getMessage(0)).toEqual(addedComment.data[0].message); expect(commentsPage.getUserName(0)).toEqual(addedComment.data[0].createdBy.firstName + ' ' + addedComment.data[0].createdBy.lastName); - expect(commentsPage.getTime(0)).toContain('ago'); + expect(commentsPage.getTime(0)).toMatch(/(ago|few)/); }); }); @@ -146,7 +146,7 @@ describe('Comment component for Processes', () => { expect(commentsPage.getTotalNumberOfComments()).toEqual('Comments (' + addedTaskComment.total + ')'); expect(commentsPage.getMessage(0)).toEqual(addedTaskComment.data[0].message); expect(commentsPage.getUserName(0)).toEqual(addedTaskComment.data[0].createdBy.firstName + ' ' + addedTaskComment.data[0].createdBy.lastName); - expect(commentsPage.getTime(0)).toContain('ago'); + expect(commentsPage.getTime(0)).toMatch(/(ago|few)/); }); }); }); diff --git a/e2e/process-services/comment-component-tasks.e2e.ts b/e2e/process-services/comment-component-tasks.e2e.ts index 881f52b18f..383f63626c 100644 --- a/e2e/process-services/comment-component-tasks.e2e.ts +++ b/e2e/process-services/comment-component-tasks.e2e.ts @@ -138,8 +138,8 @@ describe('Comment component for Processes', () => { await expect(commentsPage.getUserName(0)).toEqual(totalComments.data[0].createdBy.firstName + ' ' + totalComments.data[0].createdBy.lastName); await expect(commentsPage.getUserName(1)).toEqual(totalComments.data[1].createdBy.firstName + ' ' + totalComments.data[1].createdBy.lastName); - await expect(commentsPage.getTime(0)).toContain('ago'); - await expect(commentsPage.getTime(1)).toContain('ago'); + await expect(commentsPage.getTime(0)).toMatch(/(ago|few)/); + await expect(commentsPage.getTime(1)).toMatch(/(ago|few)/); await loginPage.loginToProcessServicesUsingUserModel(secondUser); @@ -169,9 +169,9 @@ describe('Comment component for Processes', () => { await expect(commentsPage.getUserName(1)).toEqual(totalComments.data[1].createdBy.firstName + ' ' + totalComments.data[1].createdBy.lastName); await expect(commentsPage.getUserName(2)).toEqual(totalComments.data[2].createdBy.firstName + ' ' + totalComments.data[2].createdBy.lastName); - await expect(commentsPage.getTime(0)).toContain('ago'); - await expect(commentsPage.getTime(1)).toContain('ago'); - await expect(commentsPage.getTime(2)).toContain('ago'); + await expect(commentsPage.getTime(0)).toMatch(/(ago|few)/); + await expect(commentsPage.getTime(1)).toMatch(/(ago|few)/); + await expect(commentsPage.getTime(2)).toMatch(/(ago|few)/); }); }); });