Repository navigation
Fix flaky HTML tests that depend on the live bot - #6014
Open
Eugene (OEvgeny) wants to merge 2 commits into
Open
Eugene (OEvgeny) wants to merge 2 commits into
Eugene (OEvgeny) wants to merge 2 commits into
Conversation
added 2 commits
November 3, 2026 21:22
Nine tests sent a command to the live mock bot over Direct Line and failed when its replies were late or arrived in a different order. They now use the Direct Line emulator and emulate the same replies, with local copies of the bot's images, so their snapshots are unchanged. `noLocaleIsSent.html` asserts the request that starts the conversation, like `sendEnUs.html`, instead of the bot's echo of it.
Eugene (OEvgeny)
marked this pull request as ready for review
November 4, 2026 07:10
Eugene (OEvgeny)
requested review from
William Wong (compulim),
Chris Whitten (cwhitten) and
Thomas Durnford (tdurnford)
as code owners
November 4, 2026 07:10
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues remain to block approval.
No open issues 🎉
What changed in this PR
This PR reduces flakiness in Web Chat’s HTML tests by replacing live-bot interactions with controlled emulator responses, continuing the test-stabilization work in #5952.
Changes:
- Migrates nine tests to the Direct Line emulator, using local image fixtures where needed.
- Changes the no-locale test to inspect the conversation-start request directly, without waiting for a bot reply.
- Adds an explicit postback assertion and image-loading synchronization while preserving the remaining snapshots.
| File | Description |
|---|---|
.changelog/6014-fix-flaky-live-bot-tests.md |
Records the test-stability fixes. |
__tests__/html2/upload/withoutWebWorker/customThumbnailSize.html |
Emulates upload acknowledgment and reply for thumbnail-size coverage. |
__tests__/html2/upload/withoutWebWorker/customThumbnailQuality.html |
Emulates upload acknowledgment and reply for thumbnail-quality coverage. |
__tests__/html2/updateActivity/sameActivityId.html |
Controls repeated activity IDs and carousel replacements locally. |
__tests__/html2/suggestedActions/layout/postBack.asString.html |
Emulates suggested actions and verifies the outgoing postback payload. |
__tests__/html2/localization/locale.emptyString.html |
Uses emulated replies for empty-locale rendering coverage. |
__tests__/html2/hooks/useSendFiles.html |
Emulates file-send acknowledgment and the upload reply. |
__tests__/html2/hooks/useActiveTyping.html |
Controls message and typing activities through the emulator. |
__tests__/html2/conversationStartProperties/noLocaleIsSent.html |
Asserts that the conversation-start request omits locale. |
__tests__/html2/carousel/layout/stacked/noAvatar/with1Attachment.wideScreen.html |
Uses an emulated attachment reply with a local image. |
__tests__/html2/carousel/flipperButton.html |
Uses local carousel fixtures and waits for images to load. |
Review effort: Balanced
This branch has not been deployed
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.
Changelog Entry
Fixed
Description
Nine now use the Direct Line emulator with the same replies and local copies of the bot's images; snapshots are unchanged.
Design
noLocaleIsSent.htmlchecks a Direct Line JS request that the emulator replaces, so it asserts that request likesendEnUs.html(Fix flaky HTML tests that depend on the live bot, remote files, or anti-aliased pixels #5952); it still connects to Direct Line but no longer waits for the bot.Specific Changes
carousel/flipperButton.htmlcarousel/layout/stacked/noAvatar/with1Attachment.wideScreen.htmlconversationStartProperties/noLocaleIsSent.htmlundefinedhooks/useActiveTyping.htmlhooks/useSendFiles.htmllocalization/locale.emptyString.htmlsuggestedActions/layout/postBack.asString.htmlupdateActivity/sameActivityId.htmlupload/withoutWebWorker/customThumbnail{Quality,Size}.html.changelog/<PR#>-<slug>.mdReview Checklist
z-index)package.jsonandpackage-lock.jsonreviewed