Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Report Builder Tests #6

Open
wants to merge 14 commits into
base: main
Choose a base branch
from
Open

Report Builder Tests #6

wants to merge 14 commits into from

Conversation

nk2136
Copy link
Contributor

@nk2136 nk2136 commented Oct 16, 2024

This includes several new tests for the Report Builder.

  1. The report builder table displays selected data columns.
  2. The user is redirected to the search filter page on the modify filter click.
  3. Connected forms open on UID link click.
  4. Pop-up modal opens and updates the title on the title column value click.
  5. Take action allows users to perform necessary form actions.
  6. Connected forms open on the Share Report button click.
  7. Click on the edit labels button and also on the JSON button.
  8. The user can share the report.
  9. Validate Edit Labels/ Json button is working.

@nk2136
Copy link
Contributor Author

nk2136 commented Oct 17, 2024

reportbuilder

@@ -33,6 +35,7 @@ export default defineConfig({
/* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */
trace: 'on-first-retry',
ignoreHTTPSErrors: true,
bypassCSP: true
Copy link
Collaborator

@mgaoVA mgaoVA Oct 25, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Must explain changes in the PR

});

test("Report Builder table displays selected data column", async ({ page }) => {
await page.waitForTimeout(3000);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

await page.locator('#indicatorList').getByText('Service', { exact: true }).click();
await page.locator('#indicatorList').getByText('Current Status').click();
await page.getByText('Type of Request').click();
await expect(page.getByLabel('Type of Request')).toBeChecked();
Copy link
Collaborator

@mgaoVA mgaoVA Oct 25, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is probably redundant in the context of this test. This test checks if data columns are displayed, and line 46 contains an appropriate assertion.

Some of the other new tests here have similar redundancies.

await expect(page.getByLabel('Sort by Type')).toBeVisible();
});

test("User Redirect to SearchFilter Page on Modify Filter", async ({ page }) => {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this test checks if the redirection works, there should be an assertion for this.

E.g. after clicking on "Modify Search", we know the redirection works if we can see "Step 1: Develop search filter"

await page.getByLabel('Report Title').fill('Available for TEST CHANGE TITLE');
await page.getByLabel('Report Title').press('Enter');
await page.getByRole('button', { name: 'Save Change' }).click();
await page.getByRole('cell', { name: 'Available for TEST CHANGE TITLE' }).first().click();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There should be an assertion right after clicking "Save Change".

In the event of a failure, the lack of an explicit assertion incurs a potential 30s delay, whereas the expect() would only cause a 5s delay. This time adds up quickly, as it means the difference between 90s vs 15s between iterations for a single failing test.

await page.getByRole('button', { name: 'Save Change' }).click();
});

test("Select multiple filter using AND/OR,", async ({ page }) => {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as the other AND test -- must test that the logical filter works as expected.

await page.getByRole('button', { name: 'Generate Report' }).click();
});

test("Edit Report Title", async ({ page }) => {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Error: locator.click: Test timeout of 30000ms exceeded.
Call log:
  - waiting for getByRole('cell', { name: 'TestForm_NonadminCannotCancelOwnSubmittedRecord_new' })

Your database probably includes content that doesn't exist in the standardized version. Run the API tester to restore your local database back to the standard.

test("Edit Report Title", async ({ page }) => {
await page.goto("https://host.docker.internal/Test_Request_Portal/?a=reports&v=3&query=N4IgLgpgTgtgziAXAbVASwCZJHSAHASQBEQAaEAez2gEMwKpsBeMkGOgYwAtsoI4KAGwBuELOQDmdCNgCCAORIBfUuiyIQHaRIYBPYqyq16jDS3Lsw3bADMGMAPoBWCDQAMAdlZTIcxSBU1bAwIQQhIcUpqKDoGZlZLa0Q3SWk%2FZQBdcgArCjQAOwQUEAK0MDRYqHkaGBksnAYwJGAVEAlwojoaJGQQABZWL3IAZhB6wTQYMqQARjd58gmpsAB5Gxs4cKQ3JSA%3D%3D&indicators=NobwRAlgdgJhDGBDALgewE4EkAiYBcYyEyANgKZgA0YUiAthQVWAM4bL4AMAvpeNHCRosuAtGIQUGZrQb4wzNug54efSLARSR8xPCKooAIQCuyNFBn1GC6kpVr%2BmoRhzyALFbkEAsiZJEAAQk0GSByGQAHhx27Fy8ToLabgQA7F42AEqIcKiKcaoJGknCKWAAzBnyAMrQAObkwaHhUTGsBTwAukA");
await page.getByRole('cell', { name: 'TestForm_NonadminCannotCancelOwnSubmittedRecord_new' }).click();
await page.getByLabel('Report Title').dblclick();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Too many clicks are redundant, and there should be an assertion to verify that the title was successfully changed.

await page.getByRole("cell", { name: "test this is a test" }).click();
await page.getByLabel("Multi line text", { exact: true }).click();
await page.getByLabel('Multi line text', { exact: true }).fill('test');
await page.getByRole('button', { name: 'Save Change' }).click();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs assertion to verify that the save operation works -- it would be redundant to change the contents twice if we don't verify the second one.

await page.getByRole('button', { name: 'Save Change' }).click();
});

test("Check Single Line Text", async ({ page }) => {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Error: locator.click: Test timeout of 30000ms exceeded.
Call log:
  - waiting for getByRole('cell', { name: 'test1' })

Run the API tester to ensure we have reproducible tests.

This test also needs assertions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants