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

Closed
wants to merge 35 commits into from
Closed

Report Builder Tests #6

wants to merge 35 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.
  10. Validate create row button is functional.
  11. Fill Single text.
  12. Fill Multi-Line text.
  13. Modify the Search with a logical filter.
  14. Assigned group from check
  15. Edit Report title

@nk2136
Copy link
Contributor Author

nk2136 commented Oct 17, 2024

reportbuilder

@Pelentan Pelentan marked this pull request as ready for review October 24, 2024 13:32
end2end/playwright.config.ts Outdated Show resolved Hide resolved
end2end/tests/reportBuilder.spec.ts Outdated Show resolved Hide resolved
end2end/tests/reportBuilder.spec.ts Outdated Show resolved Hide resolved
end2end/tests/reportBuilder.spec.ts Outdated Show resolved Hide resolved
end2end/tests/reportBuilder.spec.ts Outdated Show resolved Hide resolved
end2end/tests/reportBuilder.spec.ts Outdated Show resolved Hide resolved
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.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed

end2end/tests/reportBuilder.spec.ts Outdated Show resolved Hide resolved
end2end/tests/reportBuilder.spec.ts Outdated Show resolved Hide resolved
end2end/tests/reportBuilder.spec.ts Outdated Show resolved Hide resolved
@nk2136
Copy link
Contributor Author

nk2136 commented Oct 29, 2024

testrun

@@ -2,19 +2,111 @@

TODO: Add overview

# LEAF Automated Tests
Copy link
Collaborator

@mgaoVA mgaoVA Oct 31, 2024

Choose a reason for hiding this comment

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

Note instructions have been updated in: #9 , Please start from this version.

Maybe a step needs to be added to explain that the API tester must be run first before doing any work on e2e tests.

@mgaoVA mgaoVA marked this pull request as draft October 31, 2024 19:52
@mgaoVA
Copy link
Collaborator

mgaoVA commented Oct 31, 2024

Changing back to draft.

Tests still include steps that are not related to the description -- the excess steps should either be removed, or the test description should be updated to reflect its behavior.

Please remove all references to { timeout: 5000 }, there's no need to define this manually.

As previously mentioned, the API tester must be run before running the e2e tests, otherwise there will be inconsistent results:
image

@@ -12,33 +12,29 @@ LEAF uses Playwright for end-to-end testing. The test database is populated and
3. On the command line: Navigate to the location where the development environment is installed
4. Change directory into `LEAF-Automated-Tests/end2end`
5. Install Playwright development tools:
```
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please preview the output before committing changes like this:

image

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed


test("Take Action allow user to perform necessary form Action", async ({ page }) => {
await page.goto("https://host.docker.internal/Test_Request_Portal/?a=reports&v=3&query=N4IgLgpgTgtgziAXAbVASwCZJHSAHASQBEQAaEAez2gEMwKpsBCAXjJBjoGMALbKCHAoAbAG4Qs5AOZ0I2AIIA5EgF9S6LIhAYIwiJEmVqUOg2xtynMLyQAGabIXKQKgLrkAVhTQA7BChwwOgBXBHccBjAkYDUQYTQYNCjEAEZbdPJ4xLAAeQAzPLh9OxUgA&indicators=NobwRAlgdgJhDGBDALgewE4EkAiYBcYyEyANgKZgA0YUiAthQVWAM4bL4AMAvpeNHCRosuAi2QoAri2a0G%2BMMzboOeHn0iwEKDDgWJ4RVFABCk5Giiz6jRdWWqeAXSA%3D");
const actionRow = page.getByRole('row', { name: '951 Take Action Available for' });
Copy link
Collaborator

Choose a reason for hiding this comment

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

This test fails on subsequent runs, because no more actions are available for record 951.

I'd recommend using a selector such as "first button", recording the record ID, and then navigating to the record to validate that the "testing purpose" comment exists.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed and implemented the suggested changes

await page.goto("https://host.docker.internal/Test_Request_Portal/?a=reports&v=3&query=N4IgLgpgTgtgziAXAbVASwCZJHSAHASQBEQAaEAez2gEMwKpsBCAXjJBjoGMALbKCHAoAbAG4Qs5AOZ0I2AIIA5EgF9S6LIhAYIwiJEmVqUOg2xtynMLyQAGabIXKQKgLrkAVhTQA7BChwwOgBXBHccBjAkYDUQYTQYNCjEAEZbdPJ4xLAAeQAzPLh9OxUgA&indicators=NobwRAlgdgJhDGBDALgewE4EkAiYBcYyEyANgKZgA0YUiAthQVWAM4bL4AMAvpeNHCRosuAi2QoAri2a0G%2BMMzboOeHn0iwEKDDgWJ4RVFABCk5Giiz6jRdWWqeAXSA%3D");
await page.getByRole('button', { name: 'Share Report' }).click();
await page.getByText('https://host.docker.internal/').click();
const emailReport = page.getByRole('button', { name: 'Email Report' });
Copy link
Collaborator

Choose a reason for hiding this comment

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

Because the scope of this test is to validate that the Share Report button works, this test should navigate to the link and verify that the link works.

await emailReport.click();
});

test("Validate JSON button", 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.

Similar to my comment above, this feature is only useful if the generated link is functional. Therefore the test should ensure that the link works.

await page.getByText('Assigned Person 2').click();
await page.getByRole('button', { name: 'Generate Report' }).click();
const createButton = page.getByRole('button', { name: 'Create Row' });
await expect(createButton).toBeVisible();
Copy link
Collaborator

Choose a reason for hiding this comment

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

Observe what happens when you click "Create Row".

We should expect that a new record is created, and shows up on the top. Note that the newly created row has "untitled" in its Title column.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

new row button functionality is checked and new row is created with 'untitled' in its Title column.

Comment on lines 164 to 165
await page.getByRole('button', { name: "Edit Labels" }).click();
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.

??

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed

await expect(createButton).toBeFocused();
});

test('Modify search with AND logical 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.

Suggested change
test('Modify search with AND logical filter', async ({ page }) => {
test('Modify search with AND logical filter (UI only, does not validate filter results)', async ({ page }) => {

Clarify that this test does not actually test the logical component, only the UI,

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed

});

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.

Suggested change
test("Select multiple filter using AND/OR,", async ({ page }) => {
test('Select multiple filter using AND/OR (UI only, does not validate filter results)', async ({ page }) => {

As before: if these tests are not going to check the accuracy of resulting data, we don't want to give a false impression. Therefore, clarification is needed to explain this only tests UI components.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed

await page.goto("https://host.docker.internal/Test_Request_Portal/?a=reports&v=3&query=N4IgLgpgTgtgziAXAbVASwCZJAVztASQBEQAaEAewAdoBDMCqbAXjJBnoGMALbNgc3oRsAQQByJAL6l0WRCE5D%2BjAJ7E21OgybzW5DmB7YAZoxgB9AKwRaABgDsAodgDyAJRDTZ2DBAA2EJBY5JpQ9IwsbAZGiLbkgpCiEp4AuuQAVhRoAHYIKCD4UABuaJzC5DloYGjhUGK0MMJpBYxgSMDSIPyBRPS0SMggAJxsACxsjuQAzCDNfmgwVUgAjLZr5POLYC7GxvhtsZJAA%3D%3D&indicators=NobwRAlgdgJhDGBDALgewE4EkAiYBcYyEyANgKZgA0YUiAthQVWAM4bL4AMAvpeNHCRosuAizLoAbggrVaDfGGZt0HPDz6RYCFBhyLoxCLvTN5jJdRVqN%2FbUL2iwieEVRQAQgFdkaKGfoLZXYuXjtBE30CAE4AhQIAQRYWCABzKDIYAAIAcXRULwAHYNVQzQEdYSiwABY4iwBZLxIiLJJoMizkMgAPDisQ9TCtCKqnAHZ6xQAlRDhUEpthiocRRQBmKYIAZWhU8jaOrt7%2B1kGeAF0gA%3D");
const firstText = page.getByRole("cell", { name: "4331" });
await firstText.click();
await page.getByLabel('Single line text', { exact: true }).click();
Copy link
Collaborator

Choose a reason for hiding this comment

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

image

Please run the entire test suite in order to identify conflicting tests. This is conflicting with adminPanelFormEditor.spec.ts -> change field heading.

We can either:

  1. Update the older test to restore the original fieldname (this would be preferred, because it resolves a problem in that test)
  2. OR update this test to remove exact: true

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed

@nk2136 nk2136 force-pushed the report-builder-testscenarios branch from 8aaca9a to 2c09773 Compare November 20, 2024 16:37
@nk2136 nk2136 force-pushed the report-builder-testscenarios branch from 2c09773 to e141f5d Compare November 20, 2024 16:47
@nk2136 nk2136 marked this pull request as ready for review November 26, 2024 00:00
@nk2136 nk2136 force-pushed the report-builder-testscenarios branch from 3482ccd to 22ec038 Compare November 26, 2024 15:38
@aerinkayne
Copy link
Contributor

These two fail for me if I re-run the test
Validate comment approval functionality and comment visibility on record page
Validate AND Logical Filter operators to generate report

@nk2136
Copy link
Contributor Author

nk2136 commented Nov 26, 2024

image

@nk2136
Copy link
Contributor Author

nk2136 commented Dec 12, 2024

The tests have been fixed and the test names are updated. Tests are working as expected. Test #1 will still fail on the screenshot. But the remaining 14 which I worked is passing on every run. @mgaoVA @aerinkayne.

@nk2136 nk2136 closed this Dec 18, 2024
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.

3 participants