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

e2e tests for temporal data - RISDEV-3848 #319

Merged
merged 8 commits into from May 13, 2024
Merged

e2e tests for temporal data - RISDEV-3848 #319

merged 8 commits into from May 13, 2024

Conversation

hamo225
Copy link
Member

@hamo225 hamo225 commented May 6, 2024

No description provided.

Adds test for editing
Joins tests for adding, editing, deleting together (for now)

RISDEV-3848
RISDEV-3848
@reckseba reckseba self-requested a review May 6, 2024 14:26
@VictorDelCampo
Copy link
Member

Hey @hamo225, this is my review:

  1. I think we need a new e2e test for the side navigation where we test it separate? Or we just keep also the navigation within this test but then I would expect to be two describe-layers:
    • test navigation to time boundaries using navigation starting on /amending-laws/eli/bund/bgbl-1/2017/s419/2017-03-15/1/deu/regelungstext-1 and just check if you arrived at .../temporal-data
    • test the actual page including:
      • heading
      • Artikel 3Inkraftrete
      • the managing of the data itself meaning add/update/delete
  2. For testing the heading I would use if possible something more readable like:
   await expect(
      page.getByRole("heading", { level: 1, name: "Artikel 1" }),
    ).toBeVisible()
  1. Why do you need to do
    await page.waitForResponse(
      (response) =>
        response.url().includes("timeBoundaries") && response.status() === 200,
    )

Is the await saveButton.click() not enough for waiting? But this could be related to the next point

  1. Why do you do the API calls to test the response JSON? In my opinion the E2E tests are done user-facing meaning what the user would se. I would just add/update/delete data, save, reload page and see if the data is there

const isDisabled = await deleteButton.isDisabled()
expect(isDisabled).toBe(true)

await page.request.put(
Copy link
Contributor

Choose a reason for hiding this comment

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

What about this PUT request? You are not expecting anything from it. And it does not change anything on the state.

Copy link
Member Author

Choose a reason for hiding this comment

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

The PUT is not part of the user interaction. Its for the test, to set up and reset the environment. I have moved this into a function that will be called at the start and end of the test. This whole setup for the tests will change soon i hope.

- removes await with toBe assertion as does not return a promise

- removed the waitForResponse as not needed

- created a setup function that to be used at the start and finish of the test

RISDEV-3848
@reckseba reckseba merged commit 246e304 into main May 13, 2024
21 checks passed
@reckseba reckseba deleted the risdev-3848 branch May 13, 2024 16:43
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.

None yet

3 participants