[Test failure] 'Choose' button locator also matches the document viewer's 'Choose File' input (2 tests)
The test is wrong confidence medium · medium priority · e2e-tests-master, last seen in build 881
The verdict
- Fix is in
- the automation suite (e2e): the test is wrong
- Issue
- ENG-8875 · Completed
- Owner
- Pranit Mahajan (the test agent opens the pull request once this is in Ready for Development)
- Filed in
- Backlog, Test Agent Automation
- Service
- sense
- History when filed
- intermittent, this error since build 881
- On screen
- The staging document viewer is open with its Versions panel (showing 'Choose File' and 'Upload new') and the location picker is on top with Cancel and Choose buttons.
- Branches
- fails on master only: production is unaffected (e2e-tests-production build 858). Fix it before master is released to production.
The shared locator `chooseButton = page.getByRole('button', { name: 'Choose' })` (e2e/pages/common/base.page.js:191) is a substring match. At documentsCRO.page.js:228 it resolved to two elements: the location picker's 'Choose' submit button and the `<input multiple type=file>`, which Chromium names 'Choose File'.
The input comes from the 'Upload new' re-upload control in the Versions panel of the document viewer that is open behind the picker. The page snapshot shows 'Choose File' next to 'Upload new', and 'Choose' in the picker footer.
It failed identically on the retry, so it is deterministic once the viewer's Versions panel is rendered. The 3-in-22 history fits that panel appearing late, while the viewer still says 'Detecting Language...'. That timing is my assumption and I did not verify it.
No recent commit explains it. The last commits to base.page.js and documentsCRO.page.js (Nov 10–12) predate the last pass, and the Nov 16 doc-management commits don't change the Versions or reupload UI. 54657bae7 only moves the options logic into `useDocumentModalOptions`.
staging TC-03 almost certainly fails the same way, since it shares the locator. I did not read its code.
Fix: make the locator exact, or scope it to the picker. Production is unaffected.
Proposed fix
In e2e/pages/common/base.page.js:191 change the locator to `page.getByRole('button', { name: 'Choose', exact: true })`. Better still, scope it to the picker, for example `page.locator('form#location-picker-form')` or the dialog containing it, with `.getByRole('button', { name: 'Choose' })`. Then `waitFor` and `click` in documentsCRO.page.js:228-229 only see the picker button.
History of this root cause
- filed ENG-8875 · build 881 6d ago
The test is wrong, confidence medium; 2 tests; to nobody in Backlog
Tests 2
Oldest to newest, up to 30 runs. Green passed, red failed with this error, amber failed with another error. Skipped and collapsed runs are left out. Newest build: 882.
| Test | History | Newest run | Reading |
|---|---|---|---|
| Files: Staging, Uncategorized, Templates, TDM and study Files › TC-03: The reviewer categorizes the document and marks it Ready for TMF staging |
did not run | ||
| Documents TMF CRO Page › Update Categorisation for Document documentsCRO |
did not run |
How the agent decided
- Models
- claude-sonnet-5-5 ($0.56, 14 lookups)
- Settled by
- the investigating model
- Cost
- $0.56
What it looked up (14, in order)
1. search_code repo=cleopatra, text=chooseButton, path_prefix=e2e/pages · 394 chars back
e2e/pages/tmf/documentsCRO.page.js
228: await this.chooseButton.waitFor({ state: 'visible', timeout: 5000 });
229: await this.chooseButton.click();
e2e/pages/common/base.page.js
191: this.chooseButton = page.getByRole('button', { name: 'Choose' });
1470: await this.chooseButton.click();
e2e/pages/tmf/documents.page.js
364: await this.chooseButton.click();
e2e/pages/edl/eventPage.js
2. commits repo=cleopatra, path=e2e/pages/tmf/documentsCRO.page.js, since=2026-11-01T00:00:00Z · 106 chars back
11c6b32b4 2026-11-10T11:42 Harsh-Tilda: [E2E] changes folder structure and run to run module wise (#16639)
3. page_snapshot text=Choose · 2176 chars back
12: # Error details
14: ```
15: Error: locator.waitFor: Error: strict mode violation: getByRole('button', { name: 'Choose' }) resolved to 2 elements:
16: 1) <input multiple type="file" tabindex="-1" accept="application/pdf,.pdf"/> aka getByRole('button', { name: 'Choose File' })
17: 2) <button data-rac="" tabindex="0" type="submit" data-size="normal" data-layout="inline" data-theme="regular" data-variant="primary" class="_button_1acvg_1" form="location-picker-form" data-react-aria-pressable="true" id="react-aria1412458209-_r_mt_" data-journey-label="Choose location" data-jo
19: Call log:
20: - waiting for getByRole('button', { name: 'Choose' }) to be visible
22: ```
24: # Page snapshot
…
341: - generic [ref=f14e711]: Detecting Language...
342: - generic [ref=f14e712]:
343: - banner [ref=f14e713]:
344: - button "Versions (1)" [expanded] [ref=f14e714] [cursor=pointer]
345: - button "Choose File" [ref=f14e721]
346: - button "Upload new" [ref=f14e722] [cursor=pointer]
347: - region [ref=f14e724]:
348: - generic [ref=f14e732]:
349: - heading "Version 1 Primary" [level=5] [ref=f14e733]:
…
530: - button "Expand 11 Statistics" [ref=f14e1254]
531: - generic [ref=f14e1263]: 11 Statistics
532: - contentinfo [ref=f14e1264]:
533: - b
… (676 more characters not kept)
4. commits repo=cleopatra, path=e2e/pages/common/base.page.js, since=2026-11-01T00:00:00Z · 436 chars back
a4e9aea2b 2026-11-12T17:57 Harsh-Tilda: [E2E] TA 230 shared state (#16769)
6fa3ebc48 2026-11-11T10:44 sbadiger: [E2E]: Simplify execution (#16679)
9595e30aa 2026-11-11T02:36 asatish: e2e: find toasts by the react-aria markup, not role="status" (#16634)
22bac70a0 2026-11-10T14:13 sbadiger: [E2E]: AE test and heloper fix (#16647)
11c6b32b4 2026-11-10T11:42 Harsh-Tilda: [E2E] changes folder structure and run to run module wise (#16639)
5. read_file repo=cleopatra, path=e2e/pages/tmf/documentsCRO.page.js, start_line=170, end_line=360 · 8302 chars back
e2e/pages/tmf/documentsCRO.page.js (600 lines), lines 170-360:
170 await this.selectTMFDocumentStudy(studyName);
171 logger.info('Clicking Certify and Upload');
172 await this.certifyAndUpload.click({ timeout: 50000 });
173 if (await this.signHere.isVisible()) {
174 await this.sign(signerName);
175 await this.enterPin();
176 }
177 await logger.info('Deutsch.pdf uploaded successfully');
178 return fileName;
179 }
180
181 async selectTMFDocumentStudy(studyName) {
182 await this.selectTMFStudyDropdown.click();
183 await this.page
184 .getByRole('option', { name: studyName })
185 .waitFor({ state: 'visible' });
186 await this.page.getByRole('option', { name: studyName }).click();
187 }
188
189 async selectTMFLocationDocumentStudy(studyName) {
190 if (await this.selectLocationStudyDropdown.isVisible()) {
191 await this.selectLocationStudyDropdown.click();
192 await this.page
193 .getByRole('searchbox', { name: 'Search...' })
194 .fill(studyName);
195 await this.page.getByRole('menuitemradio', { name: studyName }).click();
196 await this.page.waitForTimeout(2000);
197 }
198 }
199
200 async selecteTMFDocumentLocation(studyName) {
201 await logger.info('Selecting eTMF Document Location');
202 await this.stagingLocation.click();
203 await logger.info('Clicked staging location');
204
205 // Wait for trial management to be clickable instead of f
… (6802 more characters not kept)
6. read_file repo=cleopatra, path=e2e/pages/tmf/documentsCRO.page.js, start_line=326, end_line=380 · 2184 chars back
e2e/pages/tmf/documentsCRO.page.js (600 lines), lines 326-380:
326
327 async categorizeDocument(fileName, studyName) {
328 await logger.info(`Starting categorization process`);
329
330 await this.selectDocTabs('staging');
331 //await this.selectStagingSubTab('ai-review');
332 await this.selectManualReviewTab.click();
333 const documentElement = await this.getTMFDocumentInTable(fileName);
334 await documentElement.click();
335 await logger.info(`Opened document: ${fileName}`);
336
337 await this.sidebarEditButton.click();
338 await logger.info('Clicked on Edit Categorization button');
339 await this.verifyHeading('Edit Categorization');
340 await logger.info('Verified Edit Categorization heading');
341
342 await this.selecteTMFDocumentLocation(studyName);
343 await logger.info('Selected eTMF document location');
344
345 await this.updateButton.waitFor({ state: 'visible' });
346 await this.updateButton.click();
347 await logger.info('Clicked Update button');
348
349 await this.waitForTime(2000);
350 await this.verifyCategorization();
351 await this.closeDocument();
352 await logger.info('Categorization process completed');
353 }
354
355 async verifyCategorization() {
356 await logger.info('Verifying categorization section');
357
358 await expect(
359 this.page.getByText('01 Trial Management', { exact: true })
360 ).toBeVisible();
361 await logger.info('Verified Tr
… (684 more characters not kept)
7. search_code repo=cleopatra, text=location-picker-form · 107 chars back
packages/doc-upload/location-picker/location-picker-modal.tsx
35: const FORM_ID = 'location-picker-form';
8. search_code repo=cleopatra, text=Upload new, path_prefix=packages · 310 chars back
packages/doc-management/components/version-link-actions.tsx
49: label: 'Upload new',
packages/doc-management/components/header-actions.tsx
1078: }) => <DocReupload document={document} variant="outline" label="Upload new" />;
packages/doc-management/components/document-sidebar.tsx
612: label="Upload new"
9. commits repo=cleopatra, path=packages/doc-management, since=2026-11-15T00:00:00Z · 417 chars back
93e3c65f6 2026-11-16T08:40 arzatskis: Let reviewers review a template from its task and see its review assignees (#16847)
54657bae7 2026-11-16T07:53 arzatskis: Finish the review from the fill toolbar and lock the document header while filled values are unsaved (#16781)
5f5aae50d 2026-11-16T04:28 arzatskis: Assign only signers on documents with slots, lock signed slots and send DocumentSignoff review tasks (#16805)
10. read_file repo=cleopatra, path=packages/doc-management/components/document-sidebar.tsx, start_line=560, end_line=640 · 2837 chars back
packages/doc-management/components/document-sidebar.tsx (1159 lines), lines 560-640:
560 />
561 )}
562 </Text>
563 }
564 >
565 {!!pendingQcItems.length && (
566 <DocumentSidebarRecommendationsList
567 documentId={documentId}
568 allRecommendations={qcItems}
569 listRecommendations={pendingQcItems}
570 canConfirmFindings={!!canConfirmFindings}
571 disabled={false}
572 />
573 )}
574 <HiddenMinorFindingsNotice
575 count={hiddenMinorQcCount}
576 onShow={() => setMinorShownFor(documentId)}
577 journeyName="document.details.show-minor"
578 />
579 </Collapsible>
580 )}
581
582 {((canViewComments && !!queryDetails.length) ||
583 (canComment && !isVideo)) &&
584 !!user && (
585 <Collapsible
586 key="sidebar-queries"
587 title={`Queries (${queryDetails.length})`}
588 >
589 {queryDetails.length ? (
590 <DocQueries
591 documentId={documentId}
592 queryDetails={queryDetails}
593 currentUser={user}
594 />
595 ) : (
596 <DocQueryEmptyState />
597 )}
598 </Collapsible>
599 )}
600
601 {!!versions && (
602 <Collapsible
603
… (1337 more characters not kept)
11. commit_diff repo=cleopatra, sha=5f5aae50d · 6719 chars back
5f5aae50d 2026-11-16T04:28 arzatskis: Assign only signers on documents with slots, lock signed slots and send DocumentSignoff review tasks (#16805)
7 files changed: packages/api/hooks/useDocumentAssignMutation.ts, packages/doc-management/assignment/assign-fields.tsx, packages/doc-management/assignment/assignees-list-box.tsx, packages/doc-management/assignment/document-assign-modal.tsx, packages/doc-management/assignment/signer-slots.ts, packages/doc-management/assignment/unified-assign-content.tsx, packages/doc-management/hooks/useBinaryDocumentOptions.ts
--- packages/api/hooks/useDocumentAssignMutation.ts
@@ -97,7 +97,7 @@ export const useBatchDocumentAssignCreateMutation = () => {
await Promise.all(
assigneeIds.map((assigneeId) =>
api.documentsAssignmentsCreate(documentId, {
- purpose: 'Other',
+ purpose: 'DocumentSignoff',
assignees: [assigneeId]
})
)
--- packages/doc-management/assignment/assign-fields.tsx
@@ -1,11 +1,13 @@
import { DocSignerSpec, User } from 'api';
import { AssigneesListBoxField } from './assignees-list-box';
import { ReviewRoleOptions } from './review-roles';
+import { SlotUsers } from './signer-slots';
interface AssignFieldsProps {
users: User[];
/** Selecting is capped at the number of slots, and each selected member picks the signer they play */
slots?: DocSignerSpec[];
+ signedSlotUsers?: SlotUsers;
/** Each selected member also picks a review to p
… (5219 more characters not kept)
12. commit_diff repo=cleopatra, sha=54657bae7 · 5748 chars back
54657bae7 2026-11-16T07:53 arzatskis: Finish the review from the fill toolbar and lock the document header while filled values are unsaved (#16781)
12 files changed: packages/doc-management/components/header-actions.tsx, packages/doc-management/document-modal/binary-document.tsx, packages/doc-management/document-modal/document-modal-content.header-actions.test.ts, packages/doc-management/document-modal/document-modal-content.tsx, packages/doc-management/hooks/useBinaryDocumentOptions.ts, packages/doc-viewer/content/pdf-content/useScrollReviewPending.ts, packages/doc-viewer/controls/controls-toolbar.tsx, packages/doc-viewer/controls/template/template-utils.tsx, packages/doc-viewer/controls/tools/template-fields-toolbar.test.tsx, packages/doc-viewer/controls/tools/template-fields-toolbar.tsx, packages/doc-viewer/controls/types.ts, packages/doc-viewer/controls/useTranslationView.ts
--- packages/doc-management/components/header-actions.tsx
@@ -29,10 +29,7 @@ import { documentTarget } from '../journey';
import { formatMilissToHuman } from '../utils';
import { IS_DEVELOPMENT, trackEvent } from 'common';
import { getAuditTrailAvailability } from 'doc-viewer';
-import {
- useDocumentScrolledToEnd,
- useIsDocumentPdfViewerActive
-} from 'doc-viewer/content/pdf-content/pdf-content-context';
+import { useScrollReviewPending } from 'doc-viewer/content/pdf-content/useScrollReviewPending';
import { DocReupload } from './doc-reupload';
import { useMemo, useState } from 'react';
imp
… (4248 more characters not kept)
13. commit_diff repo=cleopatra, sha=93e3c65f6 · 2449 chars back
93e3c65f6 2026-11-16T08:40 arzatskis: Let reviewers review a template from its task and see its review assignees (#16847)
3 files changed: packages/doc-management/document-modal/document-modal-content.header-actions.test.ts, packages/doc-management/document-modal/document-modal-content.tsx, packages/doc-management/hooks/useBinaryDocumentOptions.ts
--- packages/doc-management/document-modal/document-modal-content.header-actions.test.ts
@@ -80,6 +80,16 @@ describe('initializeHeaderActions fill-capable review', () => {
expect(primary).not.toContain('Document_eSign');
});
+ it('keeps Review on a template with a signature field', () => {
+ const { primary } = actionsFor(['Document_eSign'], {
+ template: true,
+ annotationSpec: {
+ fields: [{ uniqueId: 'sig-1', inputType: 'signature' }]
+ } as DocumentDetails['annotationSpec']
+ });
+ expect(primary).toContain('Document_eSign');
+ });
+
it.each([
[['Document_Fill_Fields']],
[['Document_Fill_Fields', 'Document_eSign']]
--- packages/doc-management/document-modal/document-modal-content.tsx
@@ -412,7 +412,10 @@ export const initializeHeaderActions = ({
// field and Finish review, and the backend rejects a generic eSign on it.
// Not once the document is already reviewed either, nor when the fill
// toolbar is shown: its Finish review is the one review action then.
- const hasSignature = hasSignatureField(document.annotationSpec);
+ // A template's fields are filled on
… (949 more characters not kept)
14. commit_diff repo=cleopatra, sha=54657bae7, path=packages/doc-management/hooks/useBinaryDocumentOptions.ts · 2539 chars back
54657bae7 2026-11-16T07:53 arzatskis: Finish the review from the fill toolbar and lock the document header while filled values are unsaved (#16781)
12 files changed: packages/doc-management/components/header-actions.tsx, packages/doc-management/document-modal/binary-document.tsx, packages/doc-management/document-modal/document-modal-content.header-actions.test.ts, packages/doc-management/document-modal/document-modal-content.tsx, packages/doc-management/hooks/useBinaryDocumentOptions.ts, packages/doc-viewer/content/pdf-content/useScrollReviewPending.ts, packages/doc-viewer/controls/controls-toolbar.tsx, packages/doc-viewer/controls/template/template-utils.tsx, packages/doc-viewer/controls/tools/template-fields-toolbar.test.tsx, packages/doc-viewer/controls/tools/template-fields-toolbar.tsx, packages/doc-viewer/controls/types.ts, packages/doc-viewer/controls/useTranslationView.ts
--- packages/doc-management/hooks/useBinaryDocumentOptions.ts
@@ -192,3 +192,49 @@ export const useBinaryDocumentOptions = (
activityFill
]);
};
+
+/** The options a document opened in the document modal ends up with: a
+ * review-only modal, or an outbound work-order document, offers no
+ * collaboration or editing surface. */
+export const useDocumentModalOptions = (
+ document: DocumentDetails,
+ maybeVersionId?: string,
+ accessContext?: { entityType: string; entityId: string }
+): BinaryDocumentOptions => {
+ const options = useBinaryDocumentOptions(
+ document,
+ maybeVersi
… (1039 more characters not kept)
What it was shown (build 881, 52.7 KB)
The run
{
"job": "e2e-tests-master",
"build": 881,
"kind": "ui-tests",
"result": "UNSTABLE",
"started": "2026-11-16T08:54:38Z",
"tests": 714,
"failed": 36,
"test_commit": "de78c7210",
"branch": "master",
"cluster_prepared": {
"mode": "verify",
"result": "ready",
"product_commit": "82fca18"
}
}
services
[
"docsvc",
"execsvc",
"patientsvc",
"schedsvc",
"enrollsvc",
"studiosvc",
"finsvc",
"notifsvc",
"dslsvc",
"authz",
"dashQL",
"dashRsvc",
"regsvc",
"advpsvc",
"workplansvc",
"datasvc",
"payoutsvc",
"tusker",
"authsvc",
"eventsvc",
"ehrsvc",
"docproc",
"studioai",
"sense"
]
The cluster during the run
{
"cluster": "automation",
"findings_opened_around_the_run": [
{
"kind": "error.novel",
"severity": "critical",
"subject": "execsvc",
"title": "execsvc: a new error shape, 5\u00d7 in the last hour, never seen in 90 days (Request completed \u2014 ? \u00b7 {?:\" failed to create Actor for Study ? Actor )",
"opened_minutes_after_run_start": -38
},
{
"kind": "error.novel",
"severity": "critical",
"subject": "execsvc",
"title": "execsvc: a new error shape, 5\u00d7 in the last hour, never seen in 90 days (Request completed \u2014 ? \u00b7 {?:\" failed to create Actor for Study ? Actor )",
"opened_minutes_after_run_start": -38
},
{
"kind": "error.novel",
"severity": "critical",
"subject": "docproc",
"title": "docproc: a new error shape, 6\u00d7 in the last hour, never seen in 90 days (Failed to create document processing AIRun \u2014 aborting pipeline (refuse)",
"opened_minutes_after_run_start": -38
},
{
"kind": "error.novel",
"severity": "critical",
"subject": "docproc",
"title": "docproc: a new error shape, 5\u00d7 in the last hour, never seen in 90 days (Recovery failed \u2014 AIRun creation failed for document ? (document proce)",
"opened_minutes_after_run_start": -38
},
{
"kind": "error.novel",
"severity": "warning",
"subject": "execsvc",
"title": "execsvc: a new error shape, 5\u00d7 in the last hour, never seen in 90 days (failed to find study protocol for study study ? site ?: bad status of )",
"opened_minutes_after_run_start": 85
},
{
"kind": "error.novel",
"severity": "warning",
"subject": "execsvc",
"title": "execsvc: a new error shape, 10\u00d7 in the last hour, never seen in 90 days (failed to create Actor for Study error: user ? is not a member of orga)",
"opened_minutes_after_run_start": -38
},
{
"kind": "error.novel",
"severity": "warning",
"subject": "execsvc",
"title": "execsvc: a new error shape, 10\u00d7 in the last hour, never seen in 90 days (failed to create Actor for Study \u2014 user ? is not a member of organizat)",
"opened_minutes_after_run_start": -38
},
{
"kind": "error.novel",
"severity": "warning",
"subject": "virtual-assistant",
"title": "virtual-assistant: a new error shape, 23\u00d7 in the last hour, never seen in 90 days ([PlaceholderMatch][placeholder_id=?] Failed to record match: Failed to)",
"opened_minutes_after_run_start": 12
}
],
"long_standing_findings_left_out": 25,
"pods_in_trouble_during_the_run": [],
"deploys_during_the_run": []
}
The group
{
"tests": 2,
"suite": "documentsCRO",
"members": [
{
"test": "documentsCRO::Update Categorisation for Document",
"pattern": "intermittent",
"meaning": "3 failures in 22 runs, 1 in a row now",
"newest_first": "F P P P P P P P P P P P P P P F F P P P P P",
"failing_in_a_row": 1,
"this_error_in_a_row": 1,
"this_error_since_build": 881,
"build_before_this_error": 880,
"failing_since_build": 881,
"last_passed_build": 880
},
{
"test": "staging::TC-03: The reviewer categorizes the document and marks it Ready for TMF",
"pattern": "new",
"meaning": "failed 1 run after passing the 6 before",
"newest_first": "F P P P P P P",
"failing_in_a_row": 1,
"this_error_in_a_row": 1,
"this_error_since_build": 881,
"build_before_this_error": 880,
"failing_since_build": 881,
"last_passed_build": 880
}
]
}
The failure
{
"test": "documentsCRO::Update Categorisation for Document",
"status": "error",
"message": "locator.waitFor: Error: strict mode violation: getByRole('button', { name: 'Choose' }) resolved to 2 elements:",
"traceback_tail": " at DocumentsCROPage.categorizeDocument (/home/jenkins/agent/workspace/ui-tests-master/e2e/pages/tmf/documentsCRO.page.js:342:5)\n at /home/jenkins/agent/workspace/ui-tests-master/e2e/tests/tmf/documentsCRO.spec.js:66:5\n\n attachment #1: screenshot (image/png) \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n reports/documentsCRO-Documents-TMF-b61aa-Categorisation-for-Document-tmf/test-failed-1.png\n \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\n Error Context: reports/documentsCRO-Documents-TMF-b61aa-Categorisation-for-Document-tmf/error-context.md\n\n Retry #1 \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\n Error: locator.waitFor: Error: strict mode violation: getByRole('button', { name: 'Choose' }) resolved to 2 elements:\n 1) <input multiple type=\"file\" tabindex=\"-1\" accept=\"application/pdf,.pdf\"/> aka getByRole('button', { name: 'Choose File' })\n 2) <button data-rac=\"\" tabindex=\"0\" type=\"submit\" data-size=\"normal\" data-layout=\"inline\" data-theme=\"regular\" data-variant=\"primary\" class=\"_button_1acvg_1\" form=\"location-picker-form\" data-react-aria-pressable=\"true\" id=\"react-aria6747416928-_r_105_\" data-journey-label=\"Choose location\" data-journey-action=\"files.location-picker.choose\" data-journey-value=\"01.01.01 Trial Master File Plan\">\u2026</button> aka getByRole('button', { name: 'Choose', exact: true })\n\n Call log:\n - waiting for getByRole('button', { name: 'Choose' }) to be visible\n\n\n at pages/tmf/documentsCRO.page.js:228\n\n 226 |\n 227 | // Wait for and click choose button\n > 228 | await this.chooseButton.waitFor({ state: 'visible', timeout: 5000 });\n | ^\n 229 | await this.chooseButton.click();\n 230 | await logger.info('eTMF Document Location Selected');\n 231 | }\n at DocumentsCROPage.selecteTMFDocumentLocation (/home/jenkins/agent/workspace/ui-tests-master/e2e/pages/tmf/documentsCRO.page.js:228:29)\n at DocumentsCROPage.categorizeDocument (/home/jenkins/agent/workspace/ui-tests-master/e2e/pages/tmf/documentsCRO.page.js:342:5)\n at /home/jenkins/agent/workspace/ui-tests-master/e2e/tests/tmf/documentsCRO.spec.js:66:5\n\n attachment #1: screenshot (image/png) \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n reports/documentsCRO-Documents-TMF-b61aa-Categorisation-for-Document-tmf-retry1/test-failed-1.png\n \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\n Error Context: reports/documentsCRO-Documents-TMF-b61aa-Categorisation-for-Document-tmf-retry1/error-context.md\n\n attachment #4: trace (application/zip) \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n reports/documentsCRO-Documents-TMF-b61aa-Categorisation-for-Document-tmf-retry1/trace.zip\n Usage:\n\n yarn playwright show-trace reports/documentsCRO-Documents-TMF-b61aa-Categorisation-for-Document-tmf-retry1/trace.zip\n\n \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500",
"requests": [
{
"trace_id": "e2e7e5789a5370181a04c9f63a9c230f",
"method": "POST",
"path": "/api/journey",
"status": "204",
"error": "None"
},
{
"trace_id": "e2e7e5789a5370181a04c9f23966c323",
"method": "GET",
"path": "/api/documents/folders/manager/study/ef7d1982-9fd0-46f6-aaed-10958a2fbac6",
"status": "200",
"error": "None"
},
{
"trace_id": "e2e7e5789a5370181a04c9fc97e1a63d",
"method": "POST",
"path": "/api/journey",
"status": "204",
"error": "None"
},
{
"trace_id": "e2e7e5789a5370181a04c9f7a9c777f2",
"method": "POST",
"path": "/api/journey",
"status": "204",
"error": "None"
},
{
"trace_id": "e2e7e5789a5370181a04c9fda52252a2",
"method": "POST",
"path": "/api/journey",
"status": "204",
"error": "None"
}
],
"errors_the_services_logged_for_these_requests": "none: no service logged an error under these requests' trace ids",
"raised_at": "e2e/pages/tmf/documentsCRO.page.js:228",
"code_frame": " at pages/tmf/documentsCRO.page.js:228\n\n 226 |\n 227 | // Wait for and click choose button\n> 228 | await this.chooseButton.waitFor({ state: 'visible', timeout: 5000 });\n | ^\n 229 | await this.chooseButton.click();\n 230 | await logger.info('eTMF Document Location Selected');\n 231 | }",
"playwright_call_log": [
"- waiting for getByRole('button', { name: 'Choose' }) to be visible"
],
"attempts": {
"errors": [
"Error: locator.waitFor: Error: strict mode violation: getByRole('button', { name: 'Choose' }) resolved to 2 elements:",
"Error: locator.waitFor: Error: strict mode violation: getByRole('button', { name: 'Choose' }) resolved to 2 elements:"
],
"note": "every attempt failed the same way: deterministic, not a race"
}
}
Console lines about this test
{
"from": "console.log",
"lines": [
"2423: INFO Waiting for trial master file plan...",
"2424: INFO Trial master file plan is visible",
"2425: INFO Clicked trial master file plan",
"2426: INFO \u2718 224 [tmf] \u203a tests/tmf/documentsCRO.spec.js:64:3 \u203a Documents TMF CRO Page \u203a Update Categorisation for Document (42.9s)",
"2427: INFO - 229 [tmf] \u203a tests/tmf/documentsCRO.spec.js:69:3 \u203a Documents TMF CRO Page \u203a Verify Document Language Detection and Translation",
"2428: INFO - 230 [tmf] \u203a tests/tmf/documentsCRO.spec.js:102:3 \u203a Documents TMF CRO Page \u203a Verify Audit Log Page",
"2429: INFO - 231 [tmf] \u203a tests/tmf/documentsCRO.spec.js:155:3 \u203a Documents TMF CRO Page \u203a Verify the document in the \u201cReady for TMF\u201d review state and then promote the document to TMF.",
"\u2026",
"2738: INFO Starting annotation workflow for /home/jenkins/agent/workspace/ui-tests-master/e2e/pages/common/Test97891.pdf: through major v3 (1.x, 2.x, 3.x)",
"2739: INFO Document dialog already open, closing it first",
"2740: INFO Getting doc id for Test43831.pdf",
"2741: INFO \u2718 259 [tmf] \u203a tests/tmf/documentsCRO.spec.js:64:3 \u203a Documents TMF CRO Page \u203a Update Categorisation for Document (retry #1) (60.0s)",
"2742: INFO Navigated to https://automation.master.tilda.pizza/e2EUi881Cro/studio page (+2 identical, not shipped)",
"2743: INFO Current URL: https://automation.master.tilda.pizza/e2EUi881Cro/studio (+2 identical, not shipped)",
"2744: INFO \u25c7 injected env (14) from env/.env.master // tip: \u2318 override existing { override: true } (+1 identical, not shipped)",
"\u2026",
"14547: INFO Error Context: reports/edlEvents-Events-Page-TC-0-09cdd-th-Template---Complete-Flow-edl-retry1/error-context.md",
"14548: INFO reports/edlEvents-Events-Page-TC-0-09cdd-th-Template---Complete-Flow-edl-retry1/trace.zip",
"14549: INFO yarn playwright show-trace reports/edlEvents-Events-Page-TC-0-09cdd-th-Template---Complete-Flow-edl-retry1/trace.zip",
"14550: INFO 7) [tmf] \u203a tests/tmf/documentsCRO.spec.js:64:3 \u203a Documents TMF CRO Page \u203a Update Categorisation for Document",
"14551: INFO Error: locator.waitFor: Error: strict mode violation: getByRole('button', { name: 'Choose' }) resolved to 2 elements:",
"14552: INFO 1) <input multiple type=\"file\" tabindex=\"-1\" accept=\"application/pdf,.pdf\"/> aka getByRole('button', { name: 'Choose File' })",
"14553: INFO 2) <button data-rac=\"\" tabindex=\"0\" type=\"submit\" data-size=\"normal\" data-layout=\"inline\" data-theme=\"regular\" data-variant=\"primary\" class=\"_button_1acvg_1\" form=\"location-picker-form\" data-react-aria-pressable=\"true\" id=\"react-aria1412458209-_r_mt_\" data-journey-label=\"Choose location",
"\u2026",
"15456: INFO [studio] \u203a tests/studio/section.spec.js:41:3 \u203a Studio 2 - Sections \u203a TC-04: Search for the section",
"15457: INFO [studio] \u203a tests/studio/table.spec.js:43:3 \u203a Studio 2 - Tables \u203a TC-04: Search for a table in the list",
"15458: INFO [edl] \u203a tests/edl/edlEvents.spec.js:72:3 \u203a Events Page \u203a TC-01: Event Creation with Template - Complete Flow",
"15459: INFO [tmf] \u203a tests/tmf/documentsCRO.spec.js:64:3 \u203a Documents TMF CRO Page \u203a Update Categorisation for Document",
"15460: INFO [tmf] \u203a tests/tmf/staging.spec.js:138:3 \u203a Files: Staging, Uncategorized, Templates, TDM and study Files \u203a TC-03: The reviewer categorizes the document and marks it Ready for TMF",
"15461: INFO [workorder] \u203a tests/workorder/workorderLifecycle.spec.js:130:3 \u203a AI Teammates - Work Order Lifecycle \u203a TC-01: Document Reconciliation full E2E lifecycle",
"15462: INFO [workplan] \u203a tests/workplan/feasibilityWorkPlan.spec.js:148:3 \u203a AI Teammates - Feasibility Work Plan \u203a TC-03: Create a work plan from the feasibility template with documents and form attached"
]
}
The test's history
{
"pattern": "intermittent",
"meaning": "3 failures in 22 runs, 1 in a row now",
"newest_first": "F P P P P P P P P P P P P P P F F P P P P P",
"failing_in_a_row": 1,
"this_error_in_a_row": 1,
"this_error_since_build": 881,
"build_before_this_error": 880
}
other_branch
{
"branch": "production",
"job": "e2e-tests-production",
"build": 858,
"these_tests_there": {
"passing": 1,
"absent": 1
},
"reading": "fails on master only: production is unaffected (`e2e-tests-production` build 858). Fix it before master is released to production."
}
The test's source
{
"repo": "tildabio/cleopatra",
"at": "de78c7210",
"path": "e2e/tests/tmf/documentsCRO.spec.js",
"from_line": 64,
"failing_line": 64,
"code": "64> test('Update Categorisation for Document', async ({ documentsPage }) => {\n65 fileName = await documentsPage.eTMFuploadFile(newStudyName, sign);\n66 await documentsPage.categorizeDocument(fileName, newStudyName);\n67 });\n68 \n69 test('Verify Document Language Detection and Translation', async ({\n70 documentsPage\n71 }) => {\n72 await documentsPage.uploadDeutschFile(newStudyName, sign);\n73 await documentsPage.waitForTime(10000);\n74 await documentsPage.selectStudyScope(newStudyName);\n75 await documentsPage.navigateToStagingManualReview();\n76 await documentsPage.waitForTime(3000);\n77 \n78 const fileName = 'Deutsch.pdf';\n79 const documentElement = await documentsPage.getTMFDocumentInTable(fileName);\n80 await documentElement.click();\n81 await documentsPage.waitForTime(3000);\n82 \n83 await expect(async () => {\n84 await documentsPage.refetchLanguageWhileDetecting();\n85 await expect(documentsPage.languageValue).toContainText('German', {\n86 timeout: 10000\n87 });\n88 }).toPass({ timeout: 60000 });\n89 logger.info('Language detected as German');\n90 \n91 await documentsPage.translateDocument('English', fileName);\n92 \n93 const isTranslated = await documentsPage.verifyMachineTranslation();\n94 expect(isTranslated).toBe(true);\n95 \n96 await expect(documentsPage.languageValue).toContainText('German');\n97 logger.info('Language still German after translation');\n98 \n99 await documentsPage.closeDocument();\n100 });\n101 \n102 test('Verify Audit Log Page', async ({ documentsPage }) => {\n103 const uploadedPath = await documentsPage.eTMFuploadFile(newStudyName, sign);\n104 const docName = FunctionHelper.getDocumentName(uploadedPath);\n105 logger.info(`Uploaded document for audit log test: ${docName}`);\n106 \n107 await documentsPage.selectDocTabs('staging');\n108 logger.info('Navigated to Staging tab');\n109 await documentsPage.selectManualReviewTab.click();\n110 logger.info('Selected Manual review tab');\n111 \n112 const documentElement = await documentsPage.getTMFDocumentInTable(docName);\n113 await documentElement.click();\n114 logger.info(`Opened document: ${docName}`);\n115 \n116 await documentsPage.openAuditLogFromDocumentViewer();\n117 logger.info('Opened Audit log from document menu');\n118 \n119 await expect(documentsPage.auditLogDialog).toContainText(\n120 `Audit log for document \"${docName}\"`\n121 );\n122 logger.info('Verified Audit log dialog header');\n123 \n124 await expect(\n125 documentsPage.auditLogDialog.getByRole('columnheader', {\n126 name: /timestamp/i\n127 })\n128 ).toBeVisible();\n129 await expect(\n130 documentsPage.auditLogDialog.getByRole('columnheader', {\n131 name: /event description/i\n132 })\n133 ).toBeVisible();\n134 await expect("
}
The page when it failed
{
"what": "Playwright's accessibility snapshot of the page at the moment the test gave up (error-context.md): what was really on screen",
"snapshot": "# Instructions\n\n- Following Playwright test failed.\n- Explain why, be concise, respect Playwright best practices.\n- Provide a snippet of code with the fix, if possible.\n\n# Test info\n\n- Name: tests/tmf/documentsCRO.spec.js >> Documents TMF CRO Page >> Update Categorisation for Document\n- Location: tests/tmf/documentsCRO.spec.js:64:3\n\n# Error details\n\n```\nError: locator.waitFor: Error: strict mode violation: getByRole('button', { name: 'Choose' }) resolved to 2 elements:\n 1) <input multiple type=\"file\" tabindex=\"-1\" accept=\"application/pdf,.pdf\"/> aka getByRole('button', { name: 'Choose File' })\n 2) <button data-rac=\"\" tabindex=\"0\" type=\"submit\" data-size=\"normal\" data-layout=\"inline\" data-theme=\"regular\" data-variant=\"primary\" class=\"_button_1acvg_1\" form=\"location-picker-form\" data-react-aria-pressable=\"tru\n\nCall log:\n - waiting for getByRole('button', { name: 'Choose' }) to be visible\n\n```\n\n# Page snapshot\n\n```yaml\n- generic [ref=f14e1]:\n - generic [ref=f14e2]:\n - log [ref=f14e3]:\n - generic [ref=f14e4]: 01.01.01 Trial Master File Plan selected.\n - generic [ref=f14e5]: 01.01.01 Trial Master File Plan selected.\n - log\n - main [ref=f14e7]:\n - generic \"Main navigation sidebar\" [ref=f14e8]:\n - generic [ref=f14e9]:\n - link \"Home\" [ref=f14e10] [cursor=pointer]:\n - /url: /\n - button \"Collapse navigation\" [ref=f14e11] [cursor=pointer]\n - generic [ref=f14e16]:\n - button \"E2 E2E UI881 CRO Test Admin\" [ref=f14e18] [cursor=pointer]:\n - generic [ref=f14e19]: E2\n - generic [ref=f14e20]:\n - generic [ref=f14e21]: E2E UI881 CRO\n - generic [ref=f14e22]: Test Admin\n \u2026\n - gridcell [ref=f14e112]:\n - link \"Trainings\" [ref=f14e113] [cursor=pointer]:\n - /url: /e2EUi881Cro/trainings\n - generic [ref=f14e119]:\n - button \"Help\" [ref=f14e121] [cursor=pointer]\n - separator [ref=f14e128]\n - generic [ref=f14e129]:\n - generic [ref=f14e131]:\n - generic [ref=f14e132]: \"FE: main-93e3c65,\"\n - generic [ref=f14e133]: \"BE: master-82fca18\"\n - button \"Feature toggles\" [ref=f14e134] [cursor=pointer]\n - generic \"Main content area\" [ref=f14e144]:\n - generic [ref=f14e145]:\n - generic [ref=f14e146]:\n - generic [ref=f14e147]:\n - generic [ref=f14e148]: Files\n - button \"Ask AI\" [ref=f14e157] [cursor=pointer]\n - navigation [ref=f14e166]:\n - link \"Documents\" [ref=f14e167] [cursor=pointer]:\n - /url: /e2EUi881Cro/documents\n - link \"Staging\" [ref=f14e176] [cursor=pointer]:\n \u2026\n - generic [ref=f14e245]: Drafts\n - generic [ref=f14e246]: \"0\"\n - group [ref=f14e249]:\n - searchbox \"Search...\" [ref=f14e256]\n - button \"Add filter\" [ref=f14e257] [cursor=pointer]\n - button \"Columns\" [ref=f14e262] [cursor=pointer]\n - separator [ref=f14e267]\n - button \"Upload\" [ref=f14e268] [cursor=pointer]\n - table [ref=f14e277]:\n - rowgroup [ref=f14e278]:\n - row [ref=f14e279]:\n - columnheader [ref=f14e280]:\n \u2026\n - heading \"Tes t63957.pdf\" [level=5] [ref=f14e345]:\n \u2026\n - time [ref=f14e370]: 16 Nov 2026\n - cell [ref=f14e371]:\n - time [ref=f14e373]: 16 Nov 2026\n - cell [ref=f14e374]:\n - button \"Actions\" [ref=f14e376]\n - row [ref=f14e381] [cursor=pointer]:\n - cell [ref=f14e382]:\n - generic [ref=f14e384]:\n - checkbox [ref=f14e386]\n \u2026\n - heading \"Te st7223.pdf\" [level=5] [ref=f14e400]:\n \u2026\n - time [ref=f14e425]: 16 Nov 2026\n - cell [ref=f14e426]:\n - time [ref=f14e428]: 16 Nov 2026\n - cell [ref=f14e429]:\n - button \"Actions\" [ref=f14e431]\n - dialog [ref=f14e439]:\n - generic [ref=f14e440]:\n - banner [ref=f14e441]:\n - generic [ref=f14e444]:\n - complementary [ref=f14e445]:\n - button \"Close\" [ref=f14e446] [cursor=pointer]\n - heading \"Tes t63957.pdf Rename PDF 20.3 KB\u22191 page\u2219 Staging \u2219 Manual Previous document 1 of 2 Next document Review Promote to TMF More actions\" [level=3] [ref=f14e452]:\n - generic [ref=f14e453]:\n - generic [ref=f14e454]:\n - complementary [ref=f14e455]\n \u2026\n - heading \"Tes t63957.pdf Rename\" [level=5] [ref=f14e460]:\n - generic [ref=f14e461]:\n - generic [ref=f14e463]:\n - generic [ref=f14e464]: Tes\n - generic [ref=f14e465]: t63957.pdf\n - button \"Rename\" [ref=f14e466] [cursor=pointer]\n - generic [ref=f14e471]:\n - text: PDF 20.3 KB\u22191 page\u2219\n - generic [ref=f14e472]: Staging\n - text: \u2219\n - generic [ref=f14e474]: Manual\n - generic [ref=f14e477]:\n - generic [ref=f14e478]:\n - button \"Previous document\" [disabled]\n - generic [ref=f14e479]: 1 of 2\n - button \"Next document\" [ref=f14e480] [cursor=pointer]\n - generic [ref=f14e486]:\n - button \"Review\" [ref=f14e487] [cursor=pointer]\n - button \"Promote to TMF\" [ref=f14e489] [cursor=pointer]\n - button \"More actions\" [ref=f14e491] [cursor=pointer]\n - generic [ref=f14e497]:\n - generic [ref=f14e499]:\n - generic [ref=f14e500]: Resolve Duplicates\n - generic [ref=f14e505]:\n - button \"Archive\" [ref=f14e506] [cursor=pointer]\n - button \"Ignore\" [ref=f14e508] [cursor=pointer]\n - generic [ref=f14e511]:\n - generic [ref=f14e516]:\n - complementary [ref=f14e517]:\n - grid [ref=f14e520]:\n - row \"1\":\n - gridcell [ref=f14e521]:\n - button \"1\" [ref=f14e524] [cursor=pointer]\n - main [ref=f14e525]:\n - generic [ref=f14e526]:\n - generic [ref=f14e529]:\n - button \"Page thumbnails\" [ref=f14e531] [cursor=pointer]\n - generic [ref=f14e536]:\n - generic [ref=f14e537]:\n - generic [ref=f14e538]:\n - button \"Previous page\" [disabled]\n - group [ref=f14e542]:\n - textbox [ref=f14e544]: \"1\"\n - generic [ref=f14e545]: of 1\n - generic [ref=f14e546]:\n - button \"Next page\" [disabled]\n - generic [ref=f14e548]:\n - button \"Zoom out\" [ref=f14e549] [cursor=pointer]\n - button \"Zoom in\" [ref=f14e554] [cursor=pointer]\n \u2026 (cut)"
}
The code where it failed
{
"path": "e2e/pages/tmf/documentsCRO.page.js",
"failing_line": 228,
"code": "203 await logger.info('Clicked staging location');\n204 \n205 // Wait for trial management to be clickable instead of fixed timeout\n206 await this.trialManagement.waitFor({ state: 'visible', timeout: 5000 });\n207 await this.trialManagement.click();\n208 await logger.info('Clicked trial management');\n209 \n210 // Wait for trial oversight to be ready, then click with force\n211 await this.trialOversight.waitFor({ state: 'visible', timeout: 5000 });\n212 await this.trialOversight.click({ force: true });\n213 await logger.info('Clicked trial oversight');\n214 \n215 // Wait for trial master file plan to be both visible and attached\n216 await logger.info('Waiting for trial master file plan...');\n217 await this.trialMasterFilePlan.waitFor({\n218 state: 'visible',\n219 timeout: 60000\n220 });\n221 await logger.info('Trial master file plan is visible');\n222 \n223 // Skip overlay check - use dispatchEvent to bypass all actionability checks\n224 await this.trialMasterFilePlan.dispatchEvent('click');\n225 await logger.info('Clicked trial master file plan');\n226 \n227 // Wait for and click choose button\n228> await this.chooseButton.waitFor({ state: 'visible', timeout: 5000 });\n229 await this.chooseButton.click();\n230 await logger.info('eTMF Document Location Selected');\n231 }\n232 \n233 async verifyeTMFDocumentLocation(fileName) {\n234 await logger.info('Checking eTMF Document Location');\n235 await this.trialManagementFolder.click();\n236 await this.trialOversightFolder.click();\n237 await this.trialMasterFilePlan.click();\n238 await this.openDocument(fileName);\n239 await this.closeDocument();\n240 await logger.info('eTMF Document Location Verified');"
}
Commits in the window
{
"between": "build 880 (last pass, started 2026-11-16T01:37:29Z) and build 881 (first failure of the streak, started 2026-11-16T08:54:38Z)",
"test_repo": {
"repo": "tildabio/cleopatra",
"range": "c5db9232b..de78c7210",
"href": "https://github.com/tildabio/cleopatra/compare/c5db9232b1268bb11f614e536f963c55d6d5b34d...de78c72100d11ee0de34af537ac1feac367d13bc",
"total": 9,
"commits": [
{
"sha": "de78c7210",
"subject": "[E2E]: Training logs verifications (#16842)",
"login": "sbadiger",
"name": "Santosh Badiger",
"date": "2026-11-16T07:51",
"touches": [
"e2e/AGENTS.md",
"e2e/knowledge",
"e2e/pages",
"e2e/tests",
"e2e/utils"
]
},
{
"sha": "82a536ea2",
"subject": "[E2E] start the longest Visit Execution files first (#16843)",
"login": "Harsh-Tilda",
"name": "Harsh Agarwal",
"date": "2026-11-16T07:38",
"touches": [
"e2e/knowledge",
"e2e/modules.js",
"e2e/playwright.config.js"
]
},
{
"sha": "efc042fd8",
"subject": "EDL page: Keep in sync switch (ENG-8351) (#16838)",
"login": "mvelamatt",
"name": "murali krishna velamati",
"date": "2026-11-16T07:04",
"touches": [
"apps/sense"
]
},
{
"sha": "346e610ba",
"subject": "Add eval-backed layouts to the design system (#16794)",
"login": "TadasValaitiz",
"name": "Tadas Valaitis",
"date": "2026-11-16T07:01",
"touches": [
"apps/sense"
]
},
{
"sha": "d551a5bd0",
"subject": "Show object counts in the Global Form sidebar (ENG-4808) (#16800)",
"login": "poojalodhi",
"name": "Pooja Lodhi",
"date": "2026-11-16T06:23",
"touches": [
"apps/sense",
"e2e/pages",
"e2e/publishResults.js",
"packages/api"
]
},
{
"sha": "32ff063b2",
"subject": "Archived organizations tab with restore and purge in Tenant Management (ENG-7837) (#16811)",
"login": "Shashank-Agrawal12",
"name": "Shashank-Agrawal12",
"date": "2026-11-16T06:12",
"touches": [
"apps/sense",
"packages/api"
]
},
{
"sha": "b7d34528d",
"subject": "fix(execution): save pending edits before removing a form (ENG-8532) (#16596)",
"login": "Shashank-Agrawal12",
"name": "Shashank-Agrawal12",
"date": "2026-11-16T05:48",
"touches": [
"apps/sense"
]
},
{
"sha": "5f5aae50d",
"subject": "Assign only signers on documents with slots, lock signed slots and send DocumentSignoff review tasks (#16805)",
"login": "arzatskis",
"name": "Edvinas Ar\u017eatskis",
"date": "2026-11-16T04:28",
"touches": [
"packages/api",
"packages/doc-management"
]
},
{
"sha": "f40c13b6a",
"subject": "chore(bugbot): cut Cursor Bugbot review cost (#16837)",
"login": "bandarupalli",
"name": "Sambasiva Bandarupalli",
"date": "2026-11-16T01:15",
"touches": [
".cursor/config",
".gitattributes"
]
}
]
},
"product": {
"repo": "tildabio/main",
"range": "a654678..82fca18",
"href": "https://github.com/tildabio/main/compare/a654678...82fca18",
"total": 434,
"commits": [
{
"sha": "cc38bc4a8",
"subject": "docsvc: support 0 as a valid TMF sub-artifact number (ENG-8155) (#16934)",
"login": "vishal23karedla",
"name": "Vishal Karedla",
"date": "2026-10-28T11:31",
"touches": [
"common/doclib",
"docsvc/pkg"
]
},
{
"sha": "10ab8d332",
"subject": "Support sponsor role to site role mapping (#16905)",
"login": "pralim",
"name": "Prasad",
"date": "2026-10-28T08:34",
"touches": [
"e2e/CLAUDE.md",
"e2e/automation",
"execsvc/pkg",
"tildaobj/exec_obj_defs.go",
"tildaobj/model.go",
"tildaobj/schema_owner.go"
]
},
{
"sha": "8a857d045",
"subject": "fix(swaggersvc): copy exportsvc's base-dependencies into the OpenAPI stage (#16924)",
"login": "vishal23karedla",
"name": "Vishal Karedla",
"date": "2026-10-28T08:08",
"touches": [
"swaggersvc/Dockerfile"
]
},
{
"sha": "0aa4e92cd",
"subject": "Study feed: docsvc bulk review actions + EDL agent reasons (ENG-8109, ENG-8108) (#16914)",
"login": "mvelamatt",
"name": "murali krishna velamati",
"date": "2026-10-28T05:21",
"touches": [
"data-science/virtual_assistant",
"docsvc/pkg",
"docsvc/routes"
]
},
{
"sha": "8a2b06094",
"subject": "fix(docsvc): list only existing documents in the Email Upload Log (ENG-7504) (#16922)",
"login": "susheelkumar-cmyk",
"name": "susheelkumar-cmyk",
"date": "2026-10-28T05:16",
"touches": [
"docsvc/pkg"
]
},
{
"sha": "b234eed2c",
"subject": "docproc: 20 slots, page-window memory estimates, docsvc retries and checksum deadlock fix (ENG-8143) (#16899)",
"login": "asatish",
"name": "asatish",
"date": "2026-10-28T04:50",
"touches": [
"common/doclib",
"data-science/docproc",
"data-science/packages",
"docsvc/pkg"
]
},
{
"sha": "840794aea",
"subject": "Keep an unassigned trainee's completed record in trainee reads (ENG-7750) (#16919)",
"login": "mmukkama",
"name": "mmukkama",
"date": "2026-10-28T03:47",
"touches": [
"execsvc/pkg"
]
},
{
"sha": "0c99958c6",
"subject": "Stop checksum tally on uploadComplete. (#16913)",
"login": "vishal23karedla",
"name": "Vishal Karedla",
"date": "2026-10-28T03:44",
"touches": [
"docsvc/pkg"
]
},
{
"sha": "1f289fc4d",
"subject": "feat(execsvc): training assignees expose primary sites and filter by role (ENG-7952) (#16918)",
"login": "danherberttilda",
"name": "Dan Herbert",
"date": "2026-10-27T22:52",
"touches": [
"execsvc/pkg"
]
},
{
"sha": "36c15b8a8",
"subject": "Resolve training certificate site number through the TrainingAssignment (#16857)",
"login": "taylorfutral",
"name": "Taylor",
"date": "2026-10-27T22:37",
"touches": [
"common/hdmlib",
"common/stafflib",
"execsvc/pkg"
]
},
{
"sha": "a3b7177b6",
"subject": "fix(va): show the work-order email the site actually received (ENG-7530) (#16882)",
"login": "mmukkama",
"name": "mmukkama",
"date": "2026-10-27T20:42"
},
{
"sha": "a90e35d5b",
"subject": "neo4j: reject non-identifier sort/search keys and labels spliced into Cypher (ENG-6376) (#16898)",
"login": "vishal23karedla",
"name": "Vishal Karedla",
"date": "2026-10-27T17:14"
},
{
"sha": "4fb1e0e55",
"subject": "fix(execsvc): register DocSeqCounter so CRO site import can create sites (ENG-7517) (#16867)",
"login": "susheelkumar-cmyk",
"name": "susheelkumar-cmyk",
"date": "2026-10-27T16:41"
},
{
"sha": "6a6deb384",
"subject": "chat-agent: WO-config run through tilda-backend-client with a per-call timeout; fix people lookup (ENG-7883, ENG-6312) (#16880)",
"login": "TadasValaitiz",
"name": "Tadas Valaitis",
"date": "2026-10-27T16:07"
},
{
"sha": "a653784ab",
"subject": "chat-agent: choose the model per run, and call OpenAI's newest models through the Responses API (ENG-7882) (#16879)",
"login": "TadasValaitiz",
"name": "Tadas Valaitis",
"date": "2026-10-27T16:01"
},
{
"sha": "a771f1836",
"subject": "feat(feedsvc): To do read API v2 and badge (ENG-8105) (#16893)",
"login": "mvelamatt",
"name": "murali krishna velamati",
"date": "2026-10-27T14:49"
},
{
"sha": "5c261a837",
"subject": "feat(feedsvc): To do and badge API contract (ENG-8105) (#16892)",
"login": "mvelamatt",
"name": "murali krishna velamati",
"date": "2026-10-27T14:30"
},
{
"sha": "936941d15",
"subject": "fix: record the real sender on work-order uploads + backfill existing docs (ENG-7738) (#16770)",
"login": "susheelkumar-cmyk",
"name": "susheelkumar-cmyk",
"date": "2026-10-27T14:28"
},
{
"sha": "e8429eebf",
"subject": "feat(feedsvc): item-level fact store with change detection (ENG-8101) (#16891)",
"login": "mvelamatt",
"name": "murali krishna velamati",
"date": "2026-10-27T14:23"
},
{
"sha": "b33dc392a",
"subject": "feat(va): store a Need Attention reason code on the work order (ENG-8107) (#16894)",
"login": "mvelamatt",
"name": "murali krishna velamati",
"date": "2026-10-27T14:23"
},
{
"sha": "71d88dbd0",
"subject": "add filter values API to fileupload mailbox APIs (#16902)",
"login": "vikrantsharma-tildabio",
"name": "vikrantsharma-tildabio",
"date": "2026-10-27T14:21"
},
{
"sha": "7b016725d",
"subject": "ENG-7888: Studies list no longer leaks details of studies the caller cannot access (#16897)",
"login": "susheelkumar-cmyk",
"name": "susheelkumar-cmyk",
"date": "2026-10-27T14:15"
},
{
"sha": "2b0910d07",
"subject": "Add missing org filter in SiteStudy listing (#16903)",
"login": "pralim",
"name": "Prasad",
"date": "2026-10-27T13:17"
},
{
"sha": "ad1ac1c8d",
"subject": "Fix: Certify waived(skipAttestation=true) documents are stuck in Upload Pending (#16802)",
"login": "vishal23karedla",
"name": "Vishal Karedla",
"date": "2026-10-27T13:13"
},
{
"sha": "8b0ad4bf3",
"subject": "studiosvc, workplansvc: backfill Timer scopeid and WorkPlanInstance scopeId so their NODE KEYs can be created (#16896)",
"login": "sureshboddapati",
"name": "Suresh Boddapati",
"date": "2026-10-27T05:08"
}
]
}
}
The issue as the agent wrote it
**Fix is in:** the automation suite (e2e): the test is wrong.
**What failed:** `locator.waitFor: Error: strict mode violation: getByRole('button', { name: 'Choose' }) resolved to 2 elements:`
**On screen when it failed:** The staging document viewer is open with its Versions panel (showing 'Choose File' and 'Upload new') and the location picker is on top with Cancel and Choose buttons.

**The test is wrong**, confidence medium. Found in `e2e-tests-master` build 881: [run in X-ray](https://xray.tilda.pizza/tests/run/e2e-tests-master/881).
**Root cause in X-ray:** [the verdict, each test's history and the evidence the agent read](https://xray.tilda.pizza/test-triage/fd7b065c53ad8c)
**Branches:** fails on master only: production is unaffected (`e2e-tests-production` build 858). Fix it before master is released to production.
The shared locator `chooseButton = page.getByRole('button', { name: 'Choose' })` (e2e/pages/common/base.page.js:191) is a substring match. At documentsCRO.page.js:228 it resolved to two elements: the location picker's 'Choose' submit button and the `<input multiple type=file>`, which Chromium names 'Choose File'.
The input comes from the 'Upload new' re-upload control in the Versions panel of the document viewer that is open behind the picker. The page snapshot shows 'Choose File' next to 'Upload new', and 'Choose' in the picker footer.
It failed identically on the retry, so it is deterministic once the viewer's Versions panel is rendered. The 3-in-22 history fits that panel appearing late, while the viewer still says 'Detecting Language...'. That timing is my assumption and I did not verify it.
No recent commit explains it. The last commits to base.page.js and documentsCRO.page.js (Nov 10–12) predate the last pass, and the Nov 16 doc-management commits don't change the Versions or reupload UI. 54657bae7 only moves the options logic into `useDocumentModalOptions`.
staging TC-03 almost certainly fails the same way, since it shares the locator. I did not read its code.
Fix: make the locator exact, or scope it to the picker. Production is unaffected.
**Service:** sense
**Proposed fix:**
In e2e/pages/common/base.page.js:191 change the locator to `page.getByRole('button', { name: 'Choose', exact: true })`. Better still, scope it to the picker, for example `page.locator('form#location-picker-form')` or the dialog containing it, with `.getByRole('button', { name: 'Choose' })`. Then `waitFor` and `click` in documentsCRO.page.js:228-229 only see the picker button.
**Failing tests (2):**
- [documentsCRO::Update Categorisation for Document](https://xray.tilda.pizza/tests/case/b0b8584d5a0dc4ee) (new in this run)
- [staging::TC-03: The reviewer categorizes the document and marks it Ready for TMF](https://xray.tilda.pizza/tests/case/1b9aaeccd8555be6) (new in this run)
**Error:**
```
locator.waitFor: Error: strict mode violation: getByRole('button', { name: 'Choose' }) resolved to 2 elements:
```
The test agent picks this ticket up and opens the pull request.
```yaml
suite: ui
feature: fix-documentscro
find: true
fix: true
target_file: e2e/tests/tmf/documentsCRO.spec.js
failing_tests:
- documentsCRO::Update Categorisation for Document
- 'staging::TC-03: The reviewer categorizes the document and marks it Ready for TMF'
acceptance:
- Each test in failing_tests passes on the automation cluster.
- 'No assertion is weakened to make a test pass: the test still checks the behaviour it was written for.'
request: "Fix existing tests that fail on master. Do not write new coverage.\nError: locator.waitFor:\
\ Error: strict mode violation: getByRole('button', { name: 'Choose' }) resolved to 2 elements:\nDiagnosis:\
\ The shared locator `chooseButton = page.getByRole('button', { name: 'Choose' })` (e2e/pages/common/base.page.js:191)\
\ is a substring match. At documentsCRO.page.js:228 it resolved to two elements: the location picker's\
\ 'Choose' submit button and the `<input multiple type=file>`, which Chromium names 'Choose File'.\n\
The input comes from the 'Upload new' re-upload control in the Versions panel of the document viewer\
\ that is open behind the picker. The page snapshot shows 'Choose File' next to 'Upload new', and 'Choose'\
\ in the picker footer.\nIt failed identically on the retry, so it is deterministic once the viewer's\
\ Versions panel is rendered. The 3-in-22 history fits that panel appearing late, while the viewer still\
\ says 'Detecting Language...'. That timing is my assumption and I did not verify it.\nNo recent commit\
\ explains it. The last commits to base.page.js and documentsCRO.page.js (Nov 10\u201312) predate the\
\ last pass, and the Nov 16 doc-management commits don't change the Versions or reupload UI. 54657bae7\
\ only moves the options logic into `useDocumentModalOptions`.\nstaging TC-03 almost certainly fails\
\ the same way, since it shares the locator. I did not read its code.\nFix: make the locator exact,\
\ or scope it to the picker. Production is unaffected.\nProposed change: In e2e/pages/common/base.page.js:191\
\ change the locator to `page.getByRole('button', { name: 'Choose', exact: true })`. Better still, scope\
\ it to the picker, for example `page.locator('form#location-picker-form')` or the dialog containing\
\ it, with `.getByRole('button', { name: 'Choose' })`. Then `waitFor` and `click` in documentsCRO.page.js:228-229\
\ only see the picker button."
```
+++ Agent notes
Filed by X-ray's triage agent. Models asked: claude-sonnet-5-5; settled by deep; 14 lookups in the code and its history.
Group `triage:fd7b065c53ad8c` (one issue per root cause).
A wrong verdict can be corrected on the run page in X-ray.
+++