Deflake Section Management UI Step#65020
Merged
Merged
Conversation
One of the UI test steps we use for a few different tests (most significantly, [`teacher_homepage.feature`](https://github.com/code-dot-org/code-dot-org/blob/staging/dashboard/test/ui/features/teacher_tools/teacher_homepage.feature)) has a subtle bug which is causing some flakiness. Specifically, it is attempting to use the `wait_until` helper to grab a `href` value from an asyncronously-populated UI element, but the check its using will always return true, so we will always immediately proceed with the rest of the test. This does not, however, result in a consistent failure; we have other scenarios within that UI test which will load the relevant data and which [are already using a bug-free step](https://github.com/code-dot-org/code-dot-org/blob/0ee07a79125036a45de281affd4455c985387b88/dashboard/test/ui/features/step_definitions/section_management_steps.rb#L273) to check their own correctness. If any of those scenarios run before the scenario using this step, this step will work fine. Otherwise, [it will fail](https://cucumber-logs.s3.amazonaws.com/circle/28036/Chrome_teacher_tools_teacher_homepage_output.html?versionId=squ0Qr6sp1xIrWEtB99GABiImDA3YXHD) The simple fix is to use the same check for both steps.
This was referenced Apr 3, 2025
kobryan0619
approved these changes
Apr 4, 2025
kobryan0619
left a comment
Contributor
There was a problem hiding this comment.
Another win - thanks!
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.
One of the UI test steps we use for a few different tests (most significantly,
teacher_homepage.feature) has a subtle bug which is causing some flakiness.Specifically, it is attempting to use the
wait_untilhelper to grab ahrefvalue from an asyncronously-populated UI element, but the check its using will always return true, so we will always immediately proceed with the rest of the test. This does not, however, result in a consistent failure; we have other scenarios within that UI test which will also load the relevant data and which are already using a bug-free step to check their own correctness. If any of those scenarios run before the scenario using this step, this step will work fine. Otherwise, it will failThe simple fix is to use the same check for both steps.
Testing story
Tested extensively locally and in this draft PR. Relying on Drone to test the correctness of my fix, and relying on the repeated reruns and increased overall flakiness of this WIP PR to confirm that it improves test stability.
Links