diff --git a/frontend/libs/studio-content-library/src/ContentLibrary/LibraryBody/pages/CodeListPage/CodeListPage.test.tsx b/frontend/libs/studio-content-library/src/ContentLibrary/LibraryBody/pages/CodeListPage/CodeListPage.test.tsx index 2b0e67cc799..deb146a4298 100644 --- a/frontend/libs/studio-content-library/src/ContentLibrary/LibraryBody/pages/CodeListPage/CodeListPage.test.tsx +++ b/frontend/libs/studio-content-library/src/ContentLibrary/LibraryBody/pages/CodeListPage/CodeListPage.test.tsx @@ -54,7 +54,7 @@ describe('CodeListPage', () => { it('renders the code list accordion', () => { renderCodeListPage(); - const codeListAccordion = getCodeListAccordion(codeListName); + const codeListAccordion = getCodeListAccordion(codeListTitle); expect(codeListAccordion).toBeInTheDocument(); }); @@ -67,8 +67,8 @@ describe('CodeListPage', () => { }); const searchInput = screen.getByRole('searchbox'); await user.type(searchInput, codeListsSearchParam); - [codeListName, codeList2].forEach((codeListTitle) => { - expect(getCodeListAccordion(codeListTitle)).toBeInTheDocument(); + [codeListTitle, codeList2].forEach((title) => { + expect(getCodeListAccordion(title)).toBeInTheDocument(); }); }); @@ -85,7 +85,7 @@ describe('CodeListPage', () => { expect( screen.queryByTitle( textMock('app_content_library.code_lists.code_list_accordion_title', { - codeListTitle: codeListName, + codeListTitle, }), ), ).not.toBeInTheDocument(); @@ -173,10 +173,10 @@ const uploadCodeList = async (user: UserEvent, fileName: string = uploadedCodeLi await user.upload(fileUploaderButton, file); }; -const getCodeListAccordion = (codeListTitle: string) => { +const getCodeListAccordion = (title: string) => { return screen.getByTitle( textMock('app_content_library.code_lists.code_list_accordion_title', { - codeListTitle, + codeListTitle: title, }), ); }; diff --git a/frontend/testing/playwright/pages/ProcessEditorPage/CustomReceiptConfig.ts b/frontend/testing/playwright/pages/ProcessEditorPage/CustomReceiptConfig.ts index 2580ca8361c..81bb80b41b1 100644 --- a/frontend/testing/playwright/pages/ProcessEditorPage/CustomReceiptConfig.ts +++ b/frontend/testing/playwright/pages/ProcessEditorPage/CustomReceiptConfig.ts @@ -55,9 +55,9 @@ export class CustomReceiptConfig extends BasePage { .click(); } - public async waitForEditLayoutSetIdButtonToBeVisible(layoutSetId: string): Promise { + public async waitForEditLayoutSetIdButtonToBeVisible(): Promise { const button = this.page.getByRole('button', { - name: layoutSetId, + name: this.textMock('process_editor.configuration_panel_custom_receipt_textfield_label'), }); await expect(button).toBeVisible(); } diff --git a/frontend/testing/playwright/pages/ProcessEditorPage/ProcessEditorPage.ts b/frontend/testing/playwright/pages/ProcessEditorPage/ProcessEditorPage.ts index 85215226d68..fbf18ad8d88 100644 --- a/frontend/testing/playwright/pages/ProcessEditorPage/ProcessEditorPage.ts +++ b/frontend/testing/playwright/pages/ProcessEditorPage/ProcessEditorPage.ts @@ -73,13 +73,19 @@ export class ProcessEditorPage extends BasePage { } public async getTaskIdFromOpenNewlyAddedTask(): Promise { - const button = this.page.getByRole('button', { name: /^Activity_/ }); + const button = this.page.getByRole('button', { + name: this.textMock('process_editor.configuration_panel_change_task_id_label'), + }); await button.waitFor(); return await this.getFullIdFromButtonSelector(button); } - public async clickOnTaskIdEditButton(id: string): Promise { - await this.page.getByRole('button', { name: id }).click(); + public async clickOnTaskIdEditButton(): Promise { + await this.page + .getByRole('button', { + name: this.textMock('process_editor.configuration_panel_change_task_id_label'), + }) + .click(); } public async waitForEditIdInputFieldToBeVisible(): Promise { @@ -120,8 +126,10 @@ export class ProcessEditorPage extends BasePage { .blur(); } - public async waitForNewTaskIdButtonToBeVisible(id: string): Promise { - const button = this.page.getByRole('button', { name: id }); + public async waitForNewTaskIdButtonToBeVisible(): Promise { + const button = this.page.getByRole('button', { + name: this.textMock('process_editor.configuration_panel_change_task_id_label'), + }); await expect(button).toBeVisible(); } diff --git a/frontend/testing/playwright/pages/UiEditorPage.ts b/frontend/testing/playwright/pages/UiEditorPage.ts index 7294542f91f..eec817039b5 100644 --- a/frontend/testing/playwright/pages/UiEditorPage.ts +++ b/frontend/testing/playwright/pages/UiEditorPage.ts @@ -232,7 +232,9 @@ export class UiEditorPage extends BasePage { } public async deleteOldComponentId(): Promise { - const button = this.page.getByRole('button', { name: /^Input-/ }); + const button = this.page.getByRole('button', { + name: this.textMock('ux_editor.modal_properties_component_change_id'), + }); await button.click(); await this.page .getByLabel(this.textMock('ux_editor.modal_properties_component_change_id')) diff --git a/frontend/testing/playwright/tests/process-editor/process-editor.spec.ts b/frontend/testing/playwright/tests/process-editor/process-editor.spec.ts index 614b75e4656..f1c2ed91bae 100644 --- a/frontend/testing/playwright/tests/process-editor/process-editor.spec.ts +++ b/frontend/testing/playwright/tests/process-editor/process-editor.spec.ts @@ -133,10 +133,8 @@ test('that the user can edit the id of a task and add data-types to sign', async const signingTask = await addNewSigningTaskToProcessEditor(page); - const randomGeneratedId = await processEditorPage.getTaskIdFromOpenNewlyAddedTask(); - const newId: string = 'signing_id'; - await editRandomGeneratedId(processEditorPage, randomGeneratedId, newId); + await editRandomGeneratedId(processEditorPage, newId); await processEditorPage.signingTaskConfig.clickDataTypesToSignCombobox(); const dataTypeToSign: string = 'ref-data-as-pdf'; @@ -184,9 +182,7 @@ test('That it is possible to create a custom receipt', async ({ page, testAppNam await processEditorPage.customReceiptConfig.waitForSaveNewCustomReceiptButtonToBeVisible(); await processEditorPage.customReceiptConfig.clickOnSaveNewCustomReceiptButton(); - await processEditorPage.customReceiptConfig.waitForEditLayoutSetIdButtonToBeVisible( - newLayoutSetId, - ); + await processEditorPage.customReceiptConfig.waitForEditLayoutSetIdButtonToBeVisible(); // --------------------- Check that files are uploaded to Gitea --------------------- await goToGiteaAndNavigateToApplicationMetadataFile(header, giteaPage); @@ -225,16 +221,15 @@ const addNewSigningTaskToProcessEditor = async (page: Page): Promise => const editRandomGeneratedId = async ( processEditorPage: ProcessEditorPage, - randomGeneratedId: string, newId: string, ): Promise => { - await processEditorPage.clickOnTaskIdEditButton(randomGeneratedId); + await processEditorPage.clickOnTaskIdEditButton(); await processEditorPage.waitForEditIdInputFieldToBeVisible(); await processEditorPage.emptyIdTextfield(); await processEditorPage.writeNewId(newId); await processEditorPage.waitForTextBoxToHaveValue(newId); await processEditorPage.saveNewId(); - await processEditorPage.waitForNewTaskIdButtonToBeVisible(newId); + await processEditorPage.waitForNewTaskIdButtonToBeVisible(); }; const goToGiteaAndNavigateToProcessBpmnFile = async (