Skip to content

Commit

Permalink
fix merge
Browse files Browse the repository at this point in the history
  • Loading branch information
standeren committed Jan 17, 2025
1 parent a022fd4 commit e446316
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ describe('CodeListPage', () => {

it('renders the code list accordion', () => {
renderCodeListPage();
const codeListAccordion = getCodeListAccordion(codeListName);
const codeListAccordion = getCodeListAccordion(codeListTitle);
expect(codeListAccordion).toBeInTheDocument();
});

Expand All @@ -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();
});
});

Expand All @@ -85,7 +85,7 @@ describe('CodeListPage', () => {
expect(
screen.queryByTitle(
textMock('app_content_library.code_lists.code_list_accordion_title', {
codeListTitle: codeListName,
codeListTitle,
}),
),
).not.toBeInTheDocument();
Expand Down Expand Up @@ -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,
}),
);
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,9 @@ export class CustomReceiptConfig extends BasePage {
.click();
}

public async waitForEditLayoutSetIdButtonToBeVisible(layoutSetId: string): Promise<void> {
public async waitForEditLayoutSetIdButtonToBeVisible(): Promise<void> {
const button = this.page.getByRole('button', {
name: layoutSetId,
name: this.textMock('process_editor.configuration_panel_custom_receipt_textfield_label'),
});
await expect(button).toBeVisible();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,13 +73,19 @@ export class ProcessEditorPage extends BasePage {
}

public async getTaskIdFromOpenNewlyAddedTask(): Promise<string> {
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<void> {
await this.page.getByRole('button', { name: id }).click();
public async clickOnTaskIdEditButton(): Promise<void> {
await this.page
.getByRole('button', {
name: this.textMock('process_editor.configuration_panel_change_task_id_label'),
})
.click();
}

public async waitForEditIdInputFieldToBeVisible(): Promise<void> {
Expand Down Expand Up @@ -120,8 +126,10 @@ export class ProcessEditorPage extends BasePage {
.blur();
}

public async waitForNewTaskIdButtonToBeVisible(id: string): Promise<void> {
const button = this.page.getByRole('button', { name: id });
public async waitForNewTaskIdButtonToBeVisible(): Promise<void> {
const button = this.page.getByRole('button', {
name: this.textMock('process_editor.configuration_panel_change_task_id_label'),
});
await expect(button).toBeVisible();
}

Expand Down
4 changes: 3 additions & 1 deletion frontend/testing/playwright/pages/UiEditorPage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,9 @@ export class UiEditorPage extends BasePage {
}

public async deleteOldComponentId(): Promise<void> {
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'))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -225,16 +221,15 @@ const addNewSigningTaskToProcessEditor = async (page: Page): Promise<string> =>

const editRandomGeneratedId = async (
processEditorPage: ProcessEditorPage,
randomGeneratedId: string,
newId: string,
): Promise<void> => {
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 (
Expand Down

0 comments on commit e446316

Please sign in to comment.