Skip to content

Add integration tests for /events Audit log page#60122

Merged
vatsrahul1001 merged 10 commits intoapache:mainfrom
Prajwal7842:prajwal7842/issue_59931
Feb 25, 2026
Merged

Add integration tests for /events Audit log page#60122
vatsrahul1001 merged 10 commits intoapache:mainfrom
Prajwal7842:prajwal7842/issue_59931

Conversation

@Prajwal7842
Copy link
Contributor

@Prajwal7842 Prajwal7842 commented Jan 5, 2026

This PR adds playwright integration tests for /events Audit log page for Airflow UI.

Covers following things from listed down in the issues:

Audit Logs Display

  1. Navigate to the Audit Logs page (/events)
  2. Verify the logs table is displayed
  3. Verify log entries show: timestamp, event type, DAG ID, user, etc.
  4. Verify pagination works
  5. Verify column sorting works

Search/Filter Logs

  1. Verify search input is visible

closes: #59931
releated: #59028

The integration tests were locally run 5+ times consecutively and all runs passed successfully to avoid any flakiness
Sample run:
Screenshot 2026-01-20 at 7 40 21 PM

@boring-cyborg boring-cyborg bot added the area:UI Related to UI/UX. For Frontend Developers. label Jan 5, 2026
@Prajwal7842 Prajwal7842 changed the title Add integration tests for /events Audit log page Add integration tests for /events Audit log page (Part 1) Jan 5, 2026
@Prajwal7842 Prajwal7842 force-pushed the prajwal7842/issue_59931 branch from 71c92e3 to 8b842f2 Compare January 6, 2026 09:57
@Prajwal7842
Copy link
Contributor Author

@vatsrahul1001 can you take a look. Builds are passing now. Thanks

@vatsrahul1001
Copy link
Contributor

Thanks, I will review it soon!

@vatsrahul1001
Copy link
Contributor

@Prajwal7842 Thanks for the PR! A few things to address:

  1. Test naming - Remove "should" prefix (use "verify ..." instead of "should verify ...")

  2. Remove hardcoded waits - waitForTimeout(5000) is slow and fragile. Use proper Playwright assertions:
    await expect(async () => {
    const indicator = await eventsPage.getColumnSortIndicator(0);
    expect(indicator).not.toBe("none");
    }).toPass({ timeout: 10_000 });

  3. Move DAG trigger to beforeAll - Current "Events with Generated Data" tests depend on first test running. Move triggerDag to beforeAll for proper isolation

  4. Column selectors are fragile - Using .nth(1), .nth(2) breaks if column order changes. Use text/role-based selectors:
    this.eventTypeColumn = page.getByRole("columnheader", { name: /event/i });
    5. Sorting test weak - Only checks indicator, not actual sort order. Capture data before/after and verify it changed

  5. Filter test incomplete - Only opens menu, doesn't apply filter. Add test that applies filter and verifies results

  6. Fix pagination URL - Missing / prefix and limit=1 is too small:
    return "/events?limit=5&offset=0";
    8. Remove waitForTimeout method

Let me know if you have questions!

@Prajwal7842
Copy link
Contributor Author

@Prajwal7842 Thanks for the PR! A few things to address:

  1. Test naming - Remove "should" prefix (use "verify ..." instead of "should verify ...")
  2. Remove hardcoded waits - waitForTimeout(5000) is slow and fragile. Use proper Playwright assertions:
    await expect(async () => {
    const indicator = await eventsPage.getColumnSortIndicator(0);
    expect(indicator).not.toBe("none");
    }).toPass({ timeout: 10_000 });
  3. Move DAG trigger to beforeAll - Current "Events with Generated Data" tests depend on first test running. Move triggerDag to beforeAll for proper isolation
  4. Column selectors are fragile - Using .nth(1), .nth(2) breaks if column order changes. Use text/role-based selectors:
    this.eventTypeColumn = page.getByRole("columnheader", { name: /event/i });
    5. Sorting test weak - Only checks indicator, not actual sort order. Capture data before/after and verify it changed
  5. Filter test incomplete - Only opens menu, doesn't apply filter. Add test that applies filter and verifies results
  6. Fix pagination URL - Missing / prefix and limit=1 is too small:
    return "/events?limit=5&offset=0";
    8. Remove waitForTimeout method

Let me know if you have questions!

Thanks @vatsrahul1001 for the review. I have addressed the comments.
For point (5), regarding integration tests for filter, I am working on it in the follow up diff. Thanks.

@Prajwal7842 Prajwal7842 force-pushed the prajwal7842/issue_59931 branch from 28790a3 to b76c454 Compare January 8, 2026 14:04
@vatsrahul1001
Copy link
Contributor

@Prajwal7842 #59734 is already merged now. Can you rebase. I think you can reuse alot of code

@vatsrahul1001
Copy link
Contributor

@Prajwal7842 How are we progressing on this?

@Prajwal7842
Copy link
Contributor Author

@Prajwal7842 How are we progressing on this?

#59931 (comment)

@Prajwal7842 Prajwal7842 force-pushed the prajwal7842/issue_59931 branch from b76c454 to eab74e8 Compare January 20, 2026 14:19
@Prajwal7842 Prajwal7842 changed the title Add integration tests for /events Audit log page (Part 1) Add integration tests for /events Audit log page Jan 20, 2026
@Prajwal7842
Copy link
Contributor Author

@vatsrahul1001 updated the tests as per suggestions. PTAL. Thanks

@vatsrahul1001
Copy link
Contributor

Thanks @Prajwal7842 I will review soon

@Prajwal7842 Prajwal7842 force-pushed the prajwal7842/issue_59931 branch 2 times, most recently from 8d66c9a to a01107f Compare January 27, 2026 13:18
@vatsrahul1001
Copy link
Contributor

@Prajwal7842 I see tests are failing. can you check?

@Prajwal7842 Prajwal7842 force-pushed the prajwal7842/issue_59931 branch from a01107f to 343ad0a Compare January 28, 2026 06:01
@Prajwal7842
Copy link
Contributor Author

@Prajwal7842 I see tests are failing. can you check?

Just updating: These tests are passing for me locally without any flakiness for some reason (passing on repeated tries), hence taking more time to debug this.

@vatsrahul1001
Copy link
Contributor

@Prajwal7842 I see tests are failing. can you check?

Just updating: These tests are passing for me locally without any flakiness for some reason (passing on repeated tries), hence taking more time to debug this.

I suggest to check failure report and look where it is failing

@vatsrahul1001
Copy link
Contributor

@Prajwal7842 any progress on this?

@Prajwal7842
Copy link
Contributor Author

@Prajwal7842 any progress on this?

Hi, I missed this, I will get back by tomorrow on this and update here.

@Prajwal7842 Prajwal7842 force-pushed the prajwal7842/issue_59931 branch from 343ad0a to 885529b Compare February 17, 2026 14:37
@Prajwal7842 Prajwal7842 force-pushed the prajwal7842/issue_59931 branch from 885529b to fcd9f53 Compare February 19, 2026 14:14
@Prajwal7842
Copy link
Contributor Author

Hi @vatsrahul1001 can you check the PR. The tests are passing now.
What I did to fix was :
Previouly, the code was trying to compare the before and after arrays when the sorting button was clicked.
Now, the code just takes the final array and checks that the array is sorted.

@vatsrahul1001
Copy link
Contributor

Hi @vatsrahul1001 can you check the PR. The tests are passing now. What I did to fix was : Previouly, the code was trying to compare the before and after arrays when the sorting button was clicked. Now, the code just takes the final array and checks that the array is sorted.

Thanks for all your efforts @Prajwal7842 , however, as discussed here we are planning not to include sort and pgaination tests in E2E. Can you remove them

@Prajwal7842 Prajwal7842 force-pushed the prajwal7842/issue_59931 branch 2 times, most recently from 22b934f to a7f07f0 Compare February 21, 2026 16:21
@Prajwal7842 Prajwal7842 force-pushed the prajwal7842/issue_59931 branch from a7f07f0 to afbbb84 Compare February 21, 2026 16:26
@Prajwal7842
Copy link
Contributor Author

Hi @vatsrahul1001 can you check the PR. The tests are passing now. What I did to fix was : Previouly, the code was trying to compare the before and after arrays when the sorting button was clicked. Now, the code just takes the final array and checks that the array is sorted.

Thanks for all your efforts @Prajwal7842 , however, as discussed here we are planning not to include sort and pgaination tests in E2E. Can you remove them

Hi @vatsrahul1001 I have updated the file and removed pagination/sorting tests. Tests are passing as well. Requesting a review. Thanks

@vatsrahul1001
Copy link
Contributor

Hi @vatsrahul1001 can you check the PR. The tests are passing now. What I did to fix was : Previouly, the code was trying to compare the before and after arrays when the sorting button was clicked. Now, the code just takes the final array and checks that the array is sorted.

Thanks for all your efforts @Prajwal7842 , however, as discussed here we are planning not to include sort and pgaination tests in E2E. Can you remove them

Hi @vatsrahul1001 I have updated the file and removed pagination/sorting tests. Tests are passing as well. Requesting a review. Thanks

Nice!

@vatsrahul1001 vatsrahul1001 merged commit 2141659 into apache:main Feb 25, 2026
78 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:UI Related to UI/UX. For Frontend Developers.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

UI E2E Test || BROWSE-001: Verify Audit Logs Page

2 participants