From 5624387755c5c5f5bcded69912b190e1e871e384 Mon Sep 17 00:00:00 2001 From: rahuljain-dev Date: Wed, 8 Jan 2025 13:34:28 +0530 Subject: [PATCH] SUPINT-2431: Analyse and find the way to fix table elements issue in ftest --- .../pages/ui/browser/document_comment.js | 12 ++++++++---- .../pages/ui/browser/document_comment_thread.js | 2 +- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/packages/nuxeo-web-ui-ftest/pages/ui/browser/document_comment.js b/packages/nuxeo-web-ui-ftest/pages/ui/browser/document_comment.js index aff36429c9..eeb33ffbd9 100644 --- a/packages/nuxeo-web-ui-ftest/pages/ui/browser/document_comment.js +++ b/packages/nuxeo-web-ui-ftest/pages/ui/browser/document_comment.js @@ -1,20 +1,23 @@ import DocumentCommentThread from './document_comment_thread'; /* eslint import/no-cycle: 0 */ export default class DocumentComment { - constructor(element) { + constructor(element, index) { this._el = element; + this._index = index; } get author() { return (async () => { - const author = await this._el.element('.author'); + const ele = await this._el.elements('.author'); + const author = await ele[this._index]; return author; })(); } get dialog() { return (async () => { - const dialog = this._el.element('#dialog'); + const ele = this._el.elements('#dialog'); + const dialog = await ele[this._index]; return dialog; })(); } @@ -42,7 +45,8 @@ export default class DocumentComment { get text() { return (async () => { - const text = await this._el.element('.text span'); + const ele = await this._el.elements('.text span'); + const text = await ele[this._index]; return text; })(); } diff --git a/packages/nuxeo-web-ui-ftest/pages/ui/browser/document_comment_thread.js b/packages/nuxeo-web-ui-ftest/pages/ui/browser/document_comment_thread.js index c9c96798d9..ba2ae1c80e 100644 --- a/packages/nuxeo-web-ui-ftest/pages/ui/browser/document_comment_thread.js +++ b/packages/nuxeo-web-ui-ftest/pages/ui/browser/document_comment_thread.js @@ -37,7 +37,7 @@ export default class DocumentCommentThread extends BasePage { let trueIndex; for (let i = 0; i < comments.length; i++) { const item = await comments[i]; - const comment = new DocumentComment(item); + const comment = new DocumentComment(item, i); const authorName = await comment.author; const authorText = await authorName.getText(); const commentText = await comment.text;