test(09-02): task runs tab E2E tests#20773
Conversation
…click-to-detail Co-Authored-By: alex.s@prefect.io <ajstreed1@gmail.com>
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: fa23ddb3d0
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| }); | ||
| }).toPass({ timeout: 15000 }); | ||
|
|
||
| await expect(page.getByText("Completed").first()).toBeVisible(); |
There was a problem hiding this comment.
Scope state assertion to the target task-run row
The assertion page.getByText("Completed").first() is global, so it can pass when any unrelated "Completed" label is present on the page (for example from older runs), even if the created taskRunName row is not completed. In that scenario the test gives a false positive and fails to catch regressions in the task-run row state rendering; the check should be tied to the row/link for the specific task run under test.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Good catch. Fixed in 3f74698 — now scoped to the specific listitem containing the task run link:
const taskRunRow = page
.getByRole("listitem")
.filter({ has: page.getByRole("link", { name: taskRunName }) });
await expect(taskRunRow.getByText("Completed")).toBeVisible();Co-Authored-By: alex.s@prefect.io <ajstreed1@gmail.com>
Adds E2E tests for the Task Runs tab on the combined Runs page (
/runs).What's new
New test file
ui-v2/e2e/runs/runs-task-runs.spec.tswith 3 serial tests:/runs?tab=task-runs, verifies the tab is active and URL param is preserved/runs/task-run/:idTest data is created via
runSimpleTask()inbeforeAll, which executes a real Python@flow/@taskvia subprocess.Updates since last revision
page.getByText("Completed").first()(global). Now scoped to the specific task run'slistitemviagetByRole("listitem").filter({ has: getByRole("link", { name: taskRunName }) }), so it won't false-positive from unrelated rows.Notes for review
getByRole("link", { name: flowRunName })) is page-scoped rather than row-scoped. This is lower risk since flow run names are unique, but could be tightened if desired.Checklist
<link to issue>"mint.json.Link to Devin run: https://app.devin.ai/sessions/190c2cfaed5e4903980bc28276ffd539
Requested by: @desertaxle