fix: job alert toggle selector broken (#565)#577
Merged
Conversation
LinkedIn uses inputs with width=0 and height=0 inside .artdeco-toggle components. The original fix in #534 targeted the input but failed to consider Playwright's visibility requirements and the DOM's getBoundingClientRect(). - Modifies isVisible to check parent visibility for visually hidden inputs - Adds label.artdeco-toggle__text and .artdeco-toggle to fallback selector - Primary path returns the toggle container so Playwright can click it - readJobsToggleState updated to recursively check for an inner input if a wrapper was passed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #565. The
jobs alerts createcommand failed withUI_CHANGED_SELECTOR_FAILEDbecause visually hidden<input role="switch">elements inside LinkedIn's.artdeco-togglecomponents failed theisVisible()check.Changes
<input>is a checkbox/switch inside an.artdeco-toggle. This prevents visually hidden inputs (width: 0) from being erroneously filtered out..artdeco-togglecontainer instead of the nested<input>, preventing Playwright from complaining when it tries to call.click()on an invisible input..artdeco-toggle,label.artdeco-toggle__text, andlabel[for]to the fallbackquerySelectorAllstring since they are fully clickable elements when<input>is hidden.readJobsToggleStatecan reliably readcheckedoraria-checkedstates even when themarkJobsButtonreturns the.artdeco-toggleparent, by recursively grabbing the inner<input>.Closes #565