Most AI features reach users through a chat window, and many of its bugs have nothing to do with the model: a stream that stops halfway and is shown as complete, a Regenerate button that shows the old answer, history that vanishes on reload, a double Enter that sends the question twice. These are browser tests.
ShopLab's help page has a chat widget. Its markup, for your locators:
- The conversation is a list with role
log. Each message is anliwithdata-role="user"ordata-role="assistant". - An assistant message has
data-state:streaming, thendone,stoppedorerror. - Buttons: Send, Stop (while streaming) and Regenerate (after a reply). Errors appear in an element with role
alert. - Rules: replies about shipping state the Rs 500 threshold and end with a full stop; empty input shows "Type a message first."; input over 2,000 characters is refused as too long.
Your task
Test the six states users hit. On submit your tests run against working widgets and widgets with one bug each.