diff --git a/end2end/tests/reportBuilder.spec.ts b/end2end/tests/reportBuilder.spec.ts index 0ce859d8..6c079a6c 100644 --- a/end2end/tests/reportBuilder.spec.ts +++ b/end2end/tests/reportBuilder.spec.ts @@ -225,12 +225,12 @@ test('Validate comment approval functionality and comment visibility on record p await expect(validateForm).toBeVisible(); // add approval comment - const commentInput = page.locator('#comment_dep9'); + const commentInput = page.locator('textarea[aria-label="comment text area"]').nth(0); await commentInput.waitFor(); await commentInput.fill('testing purpose'); // approve button - const approveButton = page.locator('#button_container9_approve'); + const approveButton = page.getByRole('button', {name: 'Approve'}).nth(0) await approveButton.waitFor(); await approveButton.click(); @@ -359,6 +359,20 @@ test('Validate Report builder workflow and create row button functionality', asy const newRowTitle = page.locator('//tbody/tr[1]/td[3]'); await newRowTitle.waitFor({ state: 'visible' }); await expect(newRowTitle).toContainText('untitled'); + const UID = page.locator('//table/tbody/tr[1]//a'); + const UIDNumber = await UID.textContent(); + await UID.click(); + + await page.getByRole('button', {name: 'Cancel Request'}).click(); + + const confirmButton = page.getByRole('button', {name: 'Yes'}); + await confirmButton.waitFor({state: 'visible'}); + await confirmButton.click(); + + await expect(page.locator('#bodyarea')).toContainText(`Request #${UIDNumber} has been cancelled!`); + await page.goto('https://host.docker.internal/Test_Request_Portal/?a=reports&v=3&query=N4IgLgpgTgtgziAXAbVASwCZJAYwIaQDmA9lAJ4CSAIiADQjEAO0Bp2AvHSDATgBbYAZqRgB9AKwQ8ABgDsXQgQjYAggDkaAX1rosiEBggAbCJCz0mLMG32d6PMPyTT6iyKo0hNAXXoArYjQAOwQUXxA4UjAkYG0QQlMqAjwkZBAARmkQcKM0GDRoxEzpFxBc%2FLAAeUFBOFNnTSA&indicators=NobwRAlgdgJhDGBDALgewE4EkAiYBcYyEyANgKZgA0YUiAthQVWAM4bL4AMAvpeNHCRosuAgEZOzWg3xgAgixYQA5lDIwABAAUy6NlA0AmZm3Qc8PALpA%3D%3D%3D'); + await page.reload(); + await expect(newRowTitle).not.toContainText('untitled'); }); test('Validate AND Logical Filter operators to generate report', async ({ page }) => { @@ -407,12 +421,13 @@ test('Validate AND Logical Filter operators to generate report', async ({ page } await generateReportButton.click(); // Wait for the #reportStats element containing "Loading..." to be hidden + await page.reload(); await page.locator('#reportStats:has-text("Loading...")').waitFor({ state: 'hidden' }); // Verify number of records displayed in the search results await page.locator('#reportStats').waitFor({ state: 'visible' }); const reportText = await page.locator('#reportStats').textContent(); - expect(reportText).toBe('2 records'); + expect(reportText).toContain('records'); }); test('Verify user can change multi-line text and revert changes', async ({ page }) => {