Skip to content

Conversation

@JacquelineLehner
Copy link
Collaborator

@JacquelineLehner JacquelineLehner commented Jan 26, 2026

TaskWPB-19964 [Web/QA] Write the Reactions regression tests in Playwright

https://wearezeta.atlassian.net/browse/WPB-19964

Pull Request

Summary

Add regression tests for reactions on messages and assets


Security Checklist (required)

  • External inputs are validated & sanitized on client and/or server where applicable.
  • API responses are validated; unexpected shapes are handled safely (fallbacks or errors).
  • No unsafe HTML is rendered; if unavoidable, sanitization is applied and documented where it happens.
  • Injection risks (XSS/SQL/command) are prevented via safe APIs and/or escaping.

Accessibility (required)

Standards Acknowledgement (required)

Note for reviewers

Code duplication cannot be reduced any further because it only refers to signing in users.

@codecov
Copy link

codecov bot commented Jan 26, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 45.18%. Comparing base (d17b181) to head (b8c8fc5).
⚠️ Report is 1 commits behind head on dev.

Additional details and impacted files
@@           Coverage Diff           @@
##              dev   #20232   +/-   ##
=======================================
  Coverage   45.18%   45.18%           
=======================================
  Files        1632     1632           
  Lines       40166    40166           
  Branches     8301     8301           
=======================================
  Hits        18150    18150           
  Misses      20090    20090           
  Partials     1926     1926           
Flag Coverage Δ
app_webapp 43.34% <ø> (ø)
lib_api_client 50.27% <ø> (ø)
lib_core 58.90% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions
Copy link
Contributor

github-actions bot commented Jan 26, 2026

🔗 Download Full Report Artifact

🧪 Playwright Test Summary

  • Passed: 142
  • Failed: 2
  • Skipped: 12
  • 🔁 Flaky: 3
  • 📊 Total: 159
  • Total Runtime: 79104.9s (~ 1318 min 25 sec)
specs/AppLock/AppLock.spec.ts (❌ 1 failed, ⚠️ 0 flaky)
  • ❌ AppLock > Web: App should not lock if I switch back to webapp tab in time (during inactivity timeout) (tags: TC-2752, TC-2753, regression)
specs/ArchiveSpecs/archive.spec.ts (❌ 0 failed, ⚠️ 1 flaky)
  • ⚠️ Accessibility > I want to archive the 1on1 conversation from conversation details (tags: TC-105, regression)
specs/Authentication/authentication.spec.ts (❌ 0 failed, ⚠️ 1 flaky)
  • ⚠️ Authentication > Make sure user does not see data of user of previous sessions on same browser (tags: TC-1311, regression)
specs/Reactions/reactions.spec.ts (❌ 0 failed, ⚠️ 1 flaky)
  • ⚠️ Reactions > Verify likes are reset if you edited message (tags: TC-1538, regression)
specs/Reply/reply.spec.ts (❌ 1 failed, ⚠️ 0 flaky)
  • ❌ Reply > I should not be able to reply to a ping (tags: TC-8038, regression)

@JacquelineLehner JacquelineLehner marked this pull request as ready for review January 26, 2026 10:16
@JacquelineLehner JacquelineLehner requested review from a team and otto-the-bot as code owners January 26, 2026 10:16
Copilot AI review requested due to automatic review settings January 26, 2026 10:16
@JacquelineLehner JacquelineLehner marked this pull request as draft January 26, 2026 10:19
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds Playwright E2E regression coverage for message reactions across different message/asset types and interaction modes, plus a small enhancement to the conversation page object to support these tests.

Changes:

  • Introduces Reactions/reactions.spec.ts with regression tests for adding/removing reactions on links, media assets, files, locations, own messages, and system messages.
  • Verifies reaction UX details such as reaction pill counts, aria-pressed state, and reaction tooltips from multiple users’ perspectives.
  • Extends the ConversationPage page object with a dedicated heart-reaction locator and refines reactOnMessage to map reaction types to the appropriate UI controls more precisely.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
apps/webapp/test/e2e_tests/specs/Reactions/reactions.spec.ts Adds a suite of Playwright regression tests covering heart/thumbs-up reactions on various message types, reaction lists, toggling via pills and emoji picker, and ensuring system messages remain non-reactable.
apps/webapp/test/e2e_tests/pageManager/webapp/pages/conversation.page.ts Updates the conversation page object with a reusable heart reaction pill locator and tightens reactOnMessage logic so each reaction type triggers only its intended UI control.

@JacquelineLehner JacquelineLehner force-pushed the 19964-reactions-regression-tests branch from 471e4a5 to f18ad32 Compare January 26, 2026 10:21
@JacquelineLehner JacquelineLehner force-pushed the 19964-reactions-regression-tests branch from f18ad32 to 946782b Compare January 26, 2026 16:33
@JacquelineLehner JacquelineLehner force-pushed the 19964-reactions-regression-tests branch from 946782b to 839c8af Compare January 27, 2026 08:48
@JacquelineLehner JacquelineLehner marked this pull request as ready for review January 27, 2026 09:27
Copilot AI review requested due to automatic review settings January 27, 2026 09:27
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.

const tooltip = userAPages
.conversation()
.page.getByRole('tooltip')
.filter({hasText: `${userA.fullName} reacted with`});
Copy link
Contributor

Choose a reason for hiding this comment

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

filters tooltips using the full English text ${userA.fullName} reacted with which can be localized or have different punctuation/format, this makes the assertion brittle.

Can we assert presence of the username inside the tooltip, not an exact English phrase.

Copy link
Collaborator

Choose a reason for hiding this comment

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

IMHO it's totally fine to use english text within locators, it's done all the time. We're not going to re-test the whole application for each supported language, so english is the default language set for all tests. (Except e.g. a test which might test switching the locale but that's an edge case)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I agree with Mark. What do you think, Arjita?

const editedMessage = userAPages.conversation().getMessage({content: 'Edited Message'});
await expect(editedMessage).toBeVisible();

await expect(reaction).not.toBeVisible();
Copy link
Contributor

Choose a reason for hiding this comment

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

Storing an element handle for the reaction before the message is edited and later checking that same handle is not visible can be causing stale element problems. The DOM containing that element may be replaced during edit.

// Re-query the reaction on the edited message to avoid stale element handle
await expect(userAPages.conversation().getReactionOnMessage(editedMessage, 'heart')).not.toBeVisible();

Copy link
Collaborator

Choose a reason for hiding this comment

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

This is not an element handle, it's a playwright locator. Locators in playwright are re-querried every time an assertion or action is triggered on them. (See: https://playwright.dev/docs/locators#locating-elements)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I agree

this.systemMessages = page.locator(
`${selectByDataAttribute('item-message')}${selectByClass('system-message')} ${selectByClass('message-header')}`,
);
this.systemMessages = page.locator(`${selectByDataAttribute('item-message')}${selectByClass('system-message')}`);
Copy link
Contributor

Choose a reason for hiding this comment

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

why are you removing ${selectByClass('message-header')}? Now you’re targeting the whole system message container (item-message.system-message) any reason to do that?

Copy link
Collaborator Author

@JacquelineLehner JacquelineLehner Jan 27, 2026

Choose a reason for hiding this comment

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

To align this locator with the other message-locators. I added now the selector via the attribute send status to make it clearer.

@JacquelineLehner JacquelineLehner force-pushed the 19964-reactions-regression-tests branch from 839c8af to 621fbf8 Compare January 27, 2026 15:07
Copilot AI review requested due to automatic review settings January 27, 2026 15:09
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.

This commit introduces a new test suite `reactions.spec.ts` to
verify message reaction functionality.

Implemented scenarios include:
- Reacting to various content types: link previews, pictures, audio,
  video, shared files, and locations (@TC-1527 - @TC-1533).
- Reacting to own messages and partner messages in 1:1 chats.
- Verifying that system messages cannot be reacted to (@TC-1535).
- Verifying reactions are reset when a message is edited (@TC-1538).
- Validating reaction tooltips (@TC-1540).
- Adding/removing reactions via pills and the emoji picker
  (@TC-1548, @TC-1549).

The `ConversationPage` page object has been updated to support
these interactions, specifically:
- Added `reactionWithHeartEmoji` locator.
- Refactored `reactOnMessage`.

Refs: WPB-19964
This commit reactors the reactions regression tests according to review comments.

Refs: WPB-19964
This commit reactors the reactions regression tests according to review comments.

Refs: WPB-19964
This commit reactors the reactions regression tests according to review comments.

Refs: WPB-19964
Copilot AI review requested due to automatic review settings January 28, 2026 12:16
@JacquelineLehner JacquelineLehner force-pushed the 19964-reactions-regression-tests branch from 1a57c82 to b8c8fc5 Compare January 28, 2026 12:16
@sonarqubecloud
Copy link

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.

@JacquelineLehner JacquelineLehner merged commit 9de7772 into dev Jan 28, 2026
55 of 59 checks passed
@JacquelineLehner JacquelineLehner deleted the 19964-reactions-regression-tests branch January 28, 2026 12:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants