Skip to content

Fix flaky HTML tests that depend on the live bot - #6014

Open
Eugene (OEvgeny) wants to merge 2 commits into
mainfrom
OEvgeny/fix-flaky-live-bot-tests
Open

Eugene (OEvgeny) wants to merge 2 commits into
mainfrom
OEvgeny/fix-flaky-live-bot-tests

Conversation

@OEvgeny

@OEvgeny Eugene (OEvgeny) commented Nov 4, 2026 •

Copy link
Copy Markdown
Collaborator

Ten HTML tests flaked in CI on the live Direct Line and mock bot (5 in run 40766263763).

Changelog Entry

Fixed

  • 👷🏻 Fixed more flaky HTML tests that depend on the live bot, in PR #6014, by @OEvgeny

Description

Nine now use the Direct Line emulator with the same replies and local copies of the bot's images; snapshots are unchanged.

Design

Specific Changes

Test Flaked Change
carousel/flipperButton.html no send ack in 15 s emulator, local images
carousel/layout/stacked/noAvatar/with1Attachment.wideScreen.html reply above the message emulator, local image
conversationStartProperties/noLocaleIsSent.html bot echoed undefined assert the request, no snapshot
hooks/useActiveTyping.html wrong typing state after send emulator
hooks/useSendFiles.html no reply in 15 s emulator
localization/locale.emptyString.html replies above the message emulator
suggestedActions/layout/postBack.asString.html no send ack in 15 s emulator, assert the post back
updateActivity/sameActivityId.html first reply shown again emulator sends the same ID
upload/withoutWebWorker/customThumbnail{Quality,Size}.html no send ack in 15 s emulator
  • I have added tests and executed them locally
  • I have added .changelog/<PR#>-<slug>.md
  • I have updated documentation

Review Checklist

This section is for contributors to review your work.

  • Accessibility reviewed (tab order, content readability, alt text, color contrast)
  • Browser and platform compatibilities reviewed
  • CSS styles reviewed (minimal rules, no z-index)
  • Documents reviewed (docs, samples, live demo)
  • Internationalization reviewed (strings, unit formatting)
  • package.json and package-lock.json reviewed
  • Security reviewed (no data URIs, check for nonce leak)
  • Tests reviewed (coverage, legitimacy)

Eugene Olonov 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.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 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

No deployments
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.

2 participants