Skip to content

test: assert recruiting locators are visible instead of defined#10922

Open
voidmatcha wants to merge 1 commit into
hcengineering:developfrom
voidmatcha:test/recruiting-locator-visibility
Open

test: assert recruiting locators are visible instead of defined#10922
voidmatcha wants to merge 1 commit into
hcengineering:developfrom
voidmatcha:test/recruiting-locator-visibility

Conversation

@voidmatcha

@voidmatcha voidmatcha commented Jun 22, 2026

Copy link
Copy Markdown

What

tests/sanity/tests/model/recruiting/recruiting-page.ts asserted recruiting text with expect(locator).toBeDefined() in two page-object methods. A Playwright Locator is always defined, so all three checks passed regardless of what the page rendered. This switches them to web-first toBeVisible(), which auto-waits for and verifies the element each method name claims to check.

Why

navigateToVacanciesAndCheckSoftwareEngineer had no other assertion, so its two toBeDefined() calls were the method's entire verification. The navigator sanity test in tests/sanity/tests/workbench.spec.ts calls it, so a missing "Software Engineer" vacancy or "APP-1" applicant would still pass green. A toBeDefined() on a Locator can never fail, so the check was dead weight.

checkApplicationsVisibility already had a real await expect(...).toBeVisible() above its toBeDefined() line, so only the always-true line changed there.

Tests

I could not run the sanity Playwright suite locally: it needs GitHub Packages auth and a deployed Huly stack. Disclosing that rather than claiming a green run. The change is a three-line assertion swap with no new imports, selectors, or test-title changes, and git diff --check is clean.

Out of scope

No other assertions or methods were touched. The selectors are unchanged; only the matcher and the missing await were corrected.


Found while reviewing the test suite with e2e-skills/e2e-reviewer.

The navigator flow checked vacancy and applicant text with
expect(locator).toBeDefined(). A Playwright Locator is always defined, so
those assertions passed whether or not the text rendered.
navigateToVacanciesAndCheckSoftwareEngineer had no other assertion, so a
missing "Software Engineer" vacancy or "APP-1" applicant would still pass.
Switch the three checks to web-first toBeVisible() so they wait for and
verify the text the method name promises to check.
@huly-github-staging

Copy link
Copy Markdown

Connected to Huly®: UBERF-16525

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.

1 participant