Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
nk2136 committed Dec 9, 2024
1 parent a5e4beb commit c4f0c63
Showing 1 changed file with 18 additions and 3 deletions.
21 changes: 18 additions & 3 deletions end2end/tests/reportBuilder.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down Expand Up @@ -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 }) => {
Expand Down Expand Up @@ -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 }) => {
Expand Down

0 comments on commit c4f0c63

Please sign in to comment.