Skip to content

Conversation

@JacquelineLehner
Copy link
Collaborator

@JacquelineLehner JacquelineLehner commented Oct 24, 2025

TaskWPB-19940 [Web/QA] Write the block regression tests in Playwright

Description

Add regression tests for blocking users in eight cases

Checklist

  • mentions the JIRA issue in the PR name (WPB-19940
  • PR has been self reviewed by the author;
  • Hard-to-understand areas of the code have been commented;
  • If it is a core feature, unit tests have been added;

@JacquelineLehner JacquelineLehner requested review from a team and otto-the-bot as code owners October 24, 2025 14:08
@CLAassistant
Copy link

CLAassistant commented Oct 24, 2025

CLA assistant check
All committers have signed the CLA.

@codecov
Copy link

codecov bot commented Oct 24, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 43.57%. Comparing base (d5d115c) to head (bcde921).
⚠️ Report is 2 commits behind head on dev.

Additional details and impacted files
@@           Coverage Diff           @@
##              dev   #19700   +/-   ##
=======================================
  Coverage   43.57%   43.57%           
=======================================
  Files        1294     1294           
  Lines       32467    32467           
  Branches     7217     7217           
=======================================
  Hits        14147    14147           
  Misses      16615    16615           
  Partials     1705     1705           
🚀 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 Oct 24, 2025

🔗 Download Full Report Artifact

🧪 Playwright Test Summary

  • Passed: 6
  • Failed: 3
  • Skipped: 0
  • 🔁 Flaky: 5
  • 📊 Total: 14
  • Total Runtime: 1054.1s (~ 17 min 34 sec)

Failed Tests:

❌ Channels Management (tags: TC-8752, crit-flow-web)

Location: specs/CriticalFlow/channelsManagement-TC-8752.spec.ts:36
Duration: 80055ms

Errors:

TimeoutError: locator.waitFor: Timeout 20000ms exceeded.
Call log:
  - waiting for locator('[data-uie-name="item-message"] .message-body:not(:has(p.text-foreground)):has(.text)').last() to be visible


   at pageManager/webapp/pages/conversation.page.ts:180

  178 |     if (waitForVisibility) {
  179 |       // Wait for the last message to be visible
> 180 |       await this.messages.last().waitFor({state: 'visible', timeout: 20_000});
      |                                  ^
  181 |     }
  182 |
  183 |     // Then get all matching elements
    at ConversationPage.isMessageVisible (/home/runner/actions-runner/_work/wire-webapp/wire-webapp/test/e2e_tests/pageManager/webapp/pages/conversation.page.ts:180:34)
    at sendTextMessageToConversation (/home/runner/actions-runner/_work/wire-webapp/wire-webapp/test/e2e_tests/utils/userActions.ts:86:37)
    at /home/runner/actions-runner/_work/wire-webapp/wire-webapp/test/e2e_tests/specs/CriticalFlow/channelsManagement-TC-8752.spec.ts:158:5
    at /home/runner/actions-runner/_work/wire-webapp/wire-webapp/test/e2e_tests/specs/CriticalFlow/channelsManagement-TC-8752.spec.ts:157:3
❌ Planning group call with sending various messages during call (tags: TC-8632, crit-flow-web)

Location: specs/CriticalFlow/groupCalls-TC-8632.spec.ts:37
Duration: 26739ms

Errors:

Error: expect(received).toBeTruthy()

Received: false

  106 |
  107 |       await memberCalling.maximizeCell();
> 108 |       expect(await memberCalling.isFullScreenVisible()).toBeTruthy();
      |                                                         ^
  109 |     });
  110 |
  111 |     await test.step('Owner goes full screen', async () => {
    at /home/runner/actions-runner/_work/wire-webapp/wire-webapp/test/e2e_tests/specs/CriticalFlow/groupCalls-TC-8632.spec.ts:108:57
    at /home/runner/actions-runner/_work/wire-webapp/wire-webapp/test/e2e_tests/specs/CriticalFlow/groupCalls-TC-8632.spec.ts:96:5
❌ Group Video call (tags: TC-8637, crit-flow-web)

Location: specs/CriticalFlow/groupVideoCall-TC-8637.spec.ts:39
Duration: 53502ms

Errors:

TimeoutError: locator.click: Timeout 20000ms exceeded.
Call log:
  - waiting for locator('[data-uie-name="item-call"]').locator('[data-uie-name="do-call-controls-call-accept"]')


   at pageManager/webapp/pages/calling.page.ts:66

  64 |
  65 |   async clickAcceptCallButton() {
> 66 |     await this.acceptCallButton.click();
     |                                 ^
  67 |   }
  68 |
  69 |   async clickToggleVideoButton() {
    at CallingPage.clickAcceptCallButton (/home/runner/actions-runner/_work/wire-webapp/wire-webapp/test/e2e_tests/pageManager/webapp/pages/calling.page.ts:66:33)
    at /home/runner/actions-runner/_work/wire-webapp/wire-webapp/test/e2e_tests/specs/CriticalFlow/groupVideoCall-TC-8637.spec.ts:147:34
    at /home/runner/actions-runner/_work/wire-webapp/wire-webapp/test/e2e_tests/specs/CriticalFlow/groupVideoCall-TC-8637.spec.ts:145:16

Flaky Tests:

⚠️ Account Management (tags: TC-8639, crit-flow-web)

Location: specs/CriticalFlow/accountManagement-TC-8639.spec.ts:37

Attempt 1
Result: ❌ Failed
Duration: 84773ms

Errors:

Error: Matching URL not found in the email body

   at backend/inbucketClient.e2e.ts:120

  118 |
  119 |     if (this.isValidURL(matchingUrl) === false) {
> 120 |       throw new Error('Matching URL not found in the email body');
      |             ^
  121 |     }
  122 |
  123 |     return matchingUrl;
    at InbucketClientE2E.getMatchingURLFromEmailBody (/home/runner/actions-runner/_work/wire-webapp/wire-webapp/test/e2e_tests/backend/inbucketClient.e2e.ts:120:13)
    at /home/runner/actions-runner/_work/wire-webapp/wire-webapp/test/e2e_tests/specs/CriticalFlow/accountManagement-TC-8639.spec.ts:135:30
    at /home/runner/actions-runner/_work/wire-webapp/wire-webapp/test/e2e_tests/specs/CriticalFlow/accountManagement-TC-8639.spec.ts:126:3

Attempt 2
Result: ✅ Passed
Duration: 30124ms

⚠️ Team owner adds whole team to an all team chat (tags: TC-8631, crit-flow-web)

Location: specs/CriticalFlow/addMembersToChat-TC-8631.spec.ts:34

Attempt 1
Result: ❌ Failed
Duration: 852ms

Errors:

AxiosError: Request failed with status code 409

   at backend/userRepository.e2e.ts:35

  33 |
  34 |   public async setUniqueUsername(username: string, token: string) {
> 35 |     await this.axiosInstance.put(
     |     ^
  36 |       'self/handle',
  37 |       {handle: username},
  38 |       {
    at settle (/home/runner/actions-runner/_work/wire-webapp/wire-webapp/node_modules/axios/lib/core/settle.js:19:12)
    at Unzip.handleStreamEnd (/home/runner/actions-runner/_work/wire-webapp/wire-webapp/node_modules/axios/lib/adapters/http.js:599:11)
    at Axios.request (/home/runner/actions-runner/_work/wire-webapp/wire-webapp/node_modules/axios/lib/core/Axios.js:45:41)
    at UserRepositoryE2E.setUniqueUsername (/home/runner/actions-runner/_work/wire-webapp/wire-webapp/test/e2e_tests/backend/userRepository.e2e.ts:35:5)
    at ApiManagerE2E.createTeamOwner (/home/runner/actions-runner/_work/wire-webapp/wire-webapp/test/e2e_tests/backend/apiManager.e2e.ts:142:5)
    at /home/runner/actions-runner/_work/wire-webapp/wire-webapp/test/e2e_tests/specs/CriticalFlow/addMembersToChat-TC-8631.spec.ts:43:20
    at /home/runner/actions-runner/_work/wire-webapp/wire-webapp/test/e2e_tests/specs/CriticalFlow/addMembersToChat-TC-8631.spec.ts:42:5
Error: User must have an ID to be removed from createdTeams

   at utils/tearDown.util.ts:45

  43 | export const removeCreatedTeam = async (api: ApiManagerE2E, user: User) => {
  44 |   if (!user.id) {
> 45 |     throw new Error('User must have an ID to be removed from createdTeams');
     |           ^
  46 |   }
  47 |   const teamId = createdTeams.get(user);
  48 |   if (!teamId) {
    at removeCreatedTeam (/home/runner/actions-runner/_work/wire-webapp/wire-webapp/test/e2e_tests/utils/tearDown.util.ts:45:11)
    at /home/runner/actions-runner/_work/wire-webapp/wire-webapp/test/e2e_tests/specs/CriticalFlow/addMembersToChat-TC-8631.spec.ts:95:26

Attempt 2
Result: ✅ Passed
Duration: 14644ms

⚠️ Setting up new device with a backup (tags: TC-8634, crit-flow-web)

Location: specs/CriticalFlow/backupRestoration-TC-8634.spec.ts:35

Attempt 1
Result: ❌ Failed
Duration: 40244ms

Errors:

Error: locator.waitFor: Test ended.
Call log:
  - waiting for locator('[data-uie-name="item-message"] .message-body:not(:has(p.text-foreground)):has(.text)').last() to be visible


   at pageManager/webapp/pages/conversation.page.ts:180

  178 |     if (waitForVisibility) {
  179 |       // Wait for the last message to be visible
> 180 |       await this.messages.last().waitFor({state: 'visible', timeout: 20_000});
      |                                  ^
  181 |     }
  182 |
  183 |     // Then get all matching elements
    at ConversationPage.isMessageVisible (/home/runner/actions-runner/_work/wire-webapp/wire-webapp/test/e2e_tests/pageManager/webapp/pages/conversation.page.ts:180:34)
    at /home/runner/actions-runner/_work/wire-webapp/wire-webapp/test/e2e_tests/specs/CriticalFlow/backupRestoration-TC-8634.spec.ts:87:33
    at /home/runner/actions-runner/_work/wire-webapp/wire-webapp/test/e2e_tests/specs/CriticalFlow/backupRestoration-TC-8634.spec.ts:72:3

Attempt 2
Result: ✅ Passed
Duration: 45254ms

⚠️ New person joins team and setups up device (tags: TC-8635, crit-flow-web)

Location: specs/CriticalFlow/joinTeam-TC-8635.spec.ts:37

Attempt 1
Result: ❌ Failed
Duration: 47501ms

Errors:

Error: expect(locator).toBeVisible() failed

Locator: getByText('@Rhianna Runte')
Expected: visible
Error: strict mode violation: getByText('@Rhianna Runte') resolved to 2 elements:
    1) <span data-uie-name="secondary-line" class="conversation-list-cell-description conversation-list-cell-description--active">Jarred Reichel: @Rhianna Runte</span> aka getByRole('button', { name: 'Open profile of Crits' })
    2) <span role="button" data-uie-name="label-self-mention" class="message-mention self-mention">…</span> aka getByTestId('label-self-mention')

Call log:
  - Expect "toBeVisible" with timeout 10000ms
  - waiting for getByText('@Rhianna Runte')


  151 |
  152 |     await test.step('A sees the mention in the chat', async () => {
> 153 |       await expect(pages.conversation().page.getByText(`@${memberA.fullName}`)).toBeVisible();
      |                                                                                 ^
  154 |     });
  155 |   },
  156 | );
    at /home/runner/actions-runner/_work/wire-webapp/wire-webapp/test/e2e_tests/specs/CriticalFlow/joinTeam-TC-8635.spec.ts:153:81
    at /home/runner/actions-runner/_work/wire-webapp/wire-webapp/test/e2e_tests/specs/CriticalFlow/joinTeam-TC-8635.spec.ts:152:16

Attempt 2
Result: ✅ Passed
Duration: 53752ms

⚠️ Messages in 1:1 (tags: TC-8750, crit-flow-web)

Location: specs/CriticalFlow/messagesIn1On1-TC-8750.spec.ts:47

Attempt 1
Result: ❌ Failed
Duration: 930ms

Errors:

AxiosError: Request failed with status code 409

   at backend/userRepository.e2e.ts:35

  33 |
  34 |   public async setUniqueUsername(username: string, token: string) {
> 35 |     await this.axiosInstance.put(
     |     ^
  36 |       'self/handle',
  37 |       {handle: username},
  38 |       {
    at settle (/home/runner/actions-runner/_work/wire-webapp/wire-webapp/node_modules/axios/lib/core/settle.js:19:12)
    at Unzip.handleStreamEnd (/home/runner/actions-runner/_work/wire-webapp/wire-webapp/node_modules/axios/lib/adapters/http.js:599:11)
    at Axios.request (/home/runner/actions-runner/_work/wire-webapp/wire-webapp/node_modules/axios/lib/core/Axios.js:45:41)
    at UserRepositoryE2E.setUniqueUsername (/home/runner/actions-runner/_work/wire-webapp/wire-webapp/test/e2e_tests/backend/userRepository.e2e.ts:35:5)
    at ApiManagerE2E.createTeamOwner (/home/runner/actions-runner/_work/wire-webapp/wire-webapp/test/e2e_tests/backend/apiManager.e2e.ts:142:5)
    at /home/runner/actions-runner/_work/wire-webapp/wire-webapp/test/e2e_tests/specs/CriticalFlow/messagesIn1On1-TC-8750.spec.ts:55:19
    at /home/runner/actions-runner/_work/wire-webapp/wire-webapp/test/e2e_tests/specs/CriticalFlow/messagesIn1On1-TC-8750.spec.ts:53:3
Error: User must have an ID to be removed from createdTeams

   at utils/tearDown.util.ts:45

  43 | export const removeCreatedTeam = async (api: ApiManagerE2E, user: User) => {
  44 |   if (!user.id) {
> 45 |     throw new Error('User must have an ID to be removed from createdTeams');
     |           ^
  46 |   }
  47 |   const teamId = createdTeams.get(user);
  48 |   if (!teamId) {
    at removeCreatedTeam (/home/runner/actions-runner/_work/wire-webapp/wire-webapp/test/e2e_tests/utils/tearDown.util.ts:45:11)
    at /home/runner/actions-runner/_work/wire-webapp/wire-webapp/test/e2e_tests/specs/CriticalFlow/messagesIn1On1-TC-8750.spec.ts:211:26

Attempt 2
Result: ✅ Passed
Duration: 70788ms

@thisisamir98 thisisamir98 requested a review from Copilot October 24, 2025 14:42
Copy link

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

This PR implements end-to-end regression tests for user blocking functionality in Playwright, covering various scenarios such as blocking/unblocking users in 1-on-1 conversations, group chats, and connection requests.

Key changes:

  • Added comprehensive block regression test suite with 7 test cases
  • Created new modal classes to support blocking workflow tests
  • Extended existing page objects with unblock button functionality

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 8 comments.

File Description
test/e2e_tests/specs/Block/block.spec.ts New test file containing 7 block/unblock test scenarios covering conversation lists, profile views, group chats, and connection requests
test/e2e_tests/pageManager/webapp/modals/userProfile.modal.ts Added unblockButton locator to support unblocking operations in tests
test/e2e_tests/pageManager/webapp/modals/conversationNotConnected.modal.ts New modal class for handling conversation not connected scenarios
test/e2e_tests/pageManager/index.ts Registered conversationNotConnected modal in PageManager

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@JacquelineLehner JacquelineLehner force-pushed the WPB-19940-web-qa-write-the-block-regression-tests-in-playwright branch from ca7c9ca to fd339f1 Compare October 27, 2025 11:16
@JacquelineLehner JacquelineLehner changed the title [WPB-19940] [web/qa] Write the block regression tests in Playwright test: Write regression tests for blocking users in Playwright [WPB-19940] Oct 27, 2025
xdubx and others added 7 commits November 4, 2025 09:42
This commit migrates the regression tests for the 'Block' functionality
from Testiny to the new Playwright framework, as described in WPB-19940.

Tests related to known bugs (WPB-21052, WPB-18226) are marked
as `test.fixme` and will be enabled once the underlying issues are resolved.

Refs: WPB-19940
…lity

Extracts duplicated login logic from `beforeEach` and `no-setup` tests
into a new `loginAndSetup` helper function.

Also extracts the manual user connection flow into a
`connectUsersManually` helper function to reduce duplication in
@TC-142 and @TC-144.

These changes resolve the "Duplication on New Code" error
reported by SonarQube.

Additionally, the `api` fixture initialization is simplified to
resolve the "Reliability Rating" issue.

Refs: WPB-19940
SonarQube was still reporting significant code duplication in
`block.spec.ts`.

This commit resolves this by extracting the common user-blocking
workflows into three dedicated helper functions in
`utils/userActions.ts`:

* `blockUserFromConversationList`
* `blockUserFromProfileView`
* `blockUserFromOpenGroupProfileView`

The `block.spec.ts` file is updated to use these new helpers,
resolving the duplication issue.

Refs: WPB-19940
@JacquelineLehner JacquelineLehner force-pushed the WPB-19940-web-qa-write-the-block-regression-tests-in-playwright branch from 0229d16 to bcde921 Compare November 4, 2025 08:49
@sonarqubecloud
Copy link

sonarqubecloud bot commented Nov 4, 2025

Quality Gate Failed Quality Gate failed

Failed conditions
7.0% Duplication on New Code (required ≤ 3%)

See analysis details on SonarQube Cloud

Copy link
Contributor

@zskhan zskhan left a comment

Choose a reason for hiding this comment

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

LGTM 🚀

@JacquelineLehner JacquelineLehner merged commit b17d304 into dev Nov 4, 2025
14 of 16 checks passed
@JacquelineLehner JacquelineLehner deleted the WPB-19940-web-qa-write-the-block-regression-tests-in-playwright branch November 4, 2025 14:14
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.

7 participants