-
Notifications
You must be signed in to change notification settings - Fork 236
chore: skip flaky VRTs #5823
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
chore: skip flaky VRTs #5823
Conversation
|
📚 Branch Preview🔍 Visual Regression Test ResultsWhen a visual regression test fails (or has previously failed while working on this branch), its results can be found in the following URLs:
Deployed to Azure Blob Storage: If the changes are expected, update the |
Tachometer resultsCurrently, no packages are changed by this PR... |
Pull Request Test Coverage Report for Build 18789721554Details
💛 - Coveralls |
caseyisonit
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM - just needs the golden hash updated before merge
Rajdeepc
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Most of the tests are logically correct. Thanks for doing this.
A few suggestions and feedback and if you can add the below check that would be great:
"updates icon visibility"test can you add non-null checks foriconSpan/labelSpanbefore reading.hiddenor.classListto avoid confusing runtime errors and make failures easier to diagnose.
| '#icon' | ||
| ) as HTMLElement; | ||
| expect(iconSpan).to.not.be.null; | ||
| expect(iconSpan.hidden, 'icon span should be hidden').to.be.true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This assertion is not required since you are already checking iconSpan for non-null
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the #icon span in the Picker, there is this:
<span id="icon" ?hidden=${this.icons === 'none'}>
${this.selectedItemContent.icon}
</span>There are 2 things I am asserting here: 1) that the icon span exists in the DOM (sanity check, if you will) and 2) that it is set to "hidden" because of the property icons="none" being set. Without the second assertion, we wouldn't catch if the ?hidden binding was broken.
LMK what you think!
| '.label' | ||
| ) as HTMLElement; | ||
| expect(labelSpan).to.not.be.null; | ||
| expect( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This assertion is not required since you are already checking labelSpan for non-null
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In this case, we're checking if icons="none" (not "only"), the label does not get the "visually-hidden" class applied (https://github.com/adobe/spectrum-web-components/blob/ruben/skip-flaky-vrts/packages/picker/src/Picker.ts#L471-L472).
Maybe this is testing more of the implementation details as I would like, but that's the most-straightforward way I found to test the elements' visibility to cover what the VRTs were checking. What do you thinkg?
| const menuItems = el.querySelectorAll('sp-menu-item'); | ||
| menuItems.forEach((item) => { | ||
| const icon = item.querySelector('[slot="icon"]'); | ||
| expect(icon, `menu item ${item.value} should have icon`).to.not |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add an assertion that you actually found menu items, e.g. expect(menuItems.length).to.be.greaterThan(0) — otherwise the loop would be vacuously passing if no items found.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a suggestion - How do you feel doing a check if the icon element is the expected tag sp-icon-edit or sp-icon-copy to make the test more tighter?
| '.label' | ||
| ) as HTMLElement; | ||
| expect(labelSpan).to.not.be.null; | ||
| expect( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you think this is required? You are already checking for its existence in the above assertion
| '#icon' | ||
| ) as HTMLElement; | ||
| expect(iconSpan).to.not.be.null; | ||
| expect(iconSpan.hidden, 'icon should be visible').to.be.false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Give this a thought too if you need it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we want it. Ultimately we're testing the icons functionality which specifically includes checking for the icon's visibility state depending on the icons prop (https://opensource.adobe.com/spectrum-web-components/components/picker/#icons).
An element can exist in the DOM but still be hidden (via the hidden attribute). The component's behavior is:
icons="none" - icon span exists but is hidden
icons="only" - icon span exists and is visible
default - icon span exists and is visible
LMK what you think
| '.label' | ||
| ) as HTMLElement; | ||
| expect(labelSpan).to.not.be.null; | ||
| expect( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same like above
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I replied above, LMK what you think!
graynorton
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Dismissing review to unblock merging
Description
Skipped three consistently flaky visual regression tests (VRTs) by adding
swc_vrt: { skip: true }configuration:selectsstoryiconsNonestoryiconsOnlystoryAdded unit test coverage for the Picker
iconsattribute functionality (to cover what VRTs skipped above)icons="none"hides icon in button while preserving it in menu itemsicons="only"hides label text when value is selectedicons="only"shows label text when no value is selectedMotivation and context
I looked into CircleCI insights and cross-checked with our notes to confirm these 3 VRT tests have been consistently failing with flaky behavior.
I confirmed that for the Action Menu
selects, it already was covered by existing unit tests in inpackages/action-menu/test/index.ts(lines 330-416 and 734-843) - covering change events, selection behavior, and submenu interactions.For the Picker
iconsNoneandiconsOnly, there previously was NO unit test coverage. I added new unit tests inpackages/picker/test/index.tsthat verify all functional behavior of theiconsattribute as per our documentation.With the added tests in place, I feel better about skipping these flaky VRTs.
Author's checklist
Reviewer's checklist
patch,minor, ormajorfeatures