Skip to content

Conversation

@JacquelineLehner
Copy link
Collaborator

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;

@aweiss-dev aweiss-dev requested a review from Copilot November 20, 2025 12:14
@aweiss-dev aweiss-dev changed the title 19940 blocking user spec chore: blocking user spec [19940] Nov 20, 2025
Copilot finished reviewing on behalf of aweiss-dev November 20, 2025 12:17
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 adds regression tests for user blocking functionality across 8 test scenarios, along with some folder management tests. The implementation includes new helper functions, page objects, and modal classes to support the test automation.

Key Changes

  • Added 7 blocking-related test cases covering various scenarios (blocking/unblocking users in different team configurations)
  • Created reusable helper functions for common user actions (login, connection, blocking)
  • Added new page object methods and modal classes to support blocking and folder functionality

Reviewed Changes

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

Show a summary per file
File Description
test/e2e_tests/utils/userActions.ts Added helper functions for login, manual connection, and blocking users from various UI locations; contains async/await bugs
test/e2e_tests/specs/Block/block.spec.ts Main blocking test suite with 7 test cases; contains logic bugs and naming issues
test/e2e_tests/specs/Block/block2.spec.ts Appears to be a misplaced development/debug file not related to blocking
test/e2e_tests/specs/Folders/Folders.spec.ts Folder management tests; contains test logic bug
test/e2e_tests/pageManager/webapp/pages/conversationList.page.ts Added locators and methods for blocking UI elements
test/e2e_tests/pageManager/webapp/pages/conversationDetails.page.ts Added block conversation button locator and click method
test/e2e_tests/pageManager/webapp/pages/account.page.ts Added team name locator
test/e2e_tests/pageManager/webapp/modals/userProfile.modal.ts Added unblock button locator
test/e2e_tests/pageManager/webapp/modals/unblockWarning.modal.ts New modal class for unblock confirmation; contains naming inconsistency
test/e2e_tests/pageManager/webapp/modals/createNewFolder.modal.ts New modal class for creating folders
test/e2e_tests/pageManager/webapp/modals/conversationNotConnected.modal.ts New modal class for connection errors
test/e2e_tests/pageManager/webapp/components/conversationSidebar.component.ts Added folder navigation methods
test/e2e_tests/pageManager/index.ts Registered new modal classes in page manager

@codecov
Copy link

codecov bot commented Nov 24, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 43.44%. Comparing base (bd2f77a) to head (afb4a73).

Additional details and impacted files
@@            Coverage Diff             @@
##              dev   #19784      +/-   ##
==========================================
- Coverage   43.45%   43.44%   -0.01%     
==========================================
  Files        1294     1294              
  Lines       32544    32544              
  Branches     7230     7230              
==========================================
- Hits        14141    14140       -1     
  Misses      16691    16691              
- Partials     1712     1713       +1     
🚀 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

🔗 Download Full Report Artifact

🧪 Playwright Test Summary

  • Passed: 9
  • Failed: 4
  • Skipped: 0
  • 🔁 Flaky: 1
  • 📊 Total: 14
  • Total Runtime: 966.7s (~ 16 min 7 sec)

Failed Tests:

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

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

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:133:30
    at /home/runner/actions-runner/_work/wire-webapp/wire-webapp/test/e2e_tests/specs/CriticalFlow/accountManagement-TC-8639.spec.ts:124: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: 31766ms

Errors:

Error: expect(received).toBeFalsy()

Received: true

  122 |       await memberCalling.unmuteSelfInFullScreen();
  123 |       await memberPageManager.waitForTimeout(250);
> 124 |       expect(await memberCalling.isSelfUserMutedInFullScreen()).toBeFalsy();
      |                                                                 ^
  125 |     });
  126 |
  127 |     await test.step('Validation: Owner sees member is unmuted', async () => {
    at /home/runner/actions-runner/_work/wire-webapp/wire-webapp/test/e2e_tests/specs/CriticalFlow/groupCalls-TC-8632.spec.ts:124:65
    at /home/runner/actions-runner/_work/wire-webapp/wire-webapp/test/e2e_tests/specs/CriticalFlow/groupCalls-TC-8632.spec.ts:121:5
❌ Group Video call (tags: TC-8637, crit-flow-web)

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

Errors:

TimeoutError: locator.waitFor: Timeout 20000ms exceeded.
Call log:
  - waiting for locator('#add-participants [data-uie-name="search-list"] [aria-label="Open profile of Carol KubConnelly"]').locator('input[type="checkbox"]')


   at pageManager/webapp/pages/conversationDetails.page.ts:68

  66 |       await userLocator.click();
  67 |       // Wait for the user to be selected (checkbox should be checked)
> 68 |       await userLocator.locator('input[type="checkbox"]').waitFor({state: 'attached'});
     |                                                           ^
  69 |     }
  70 |
  71 |     await this.page.locator(`${selectById('add-participants')} ${selectByDataAttribute('do-create')}`).click();
    at ConversationDetailsPage.addUsersToConversation (/home/runner/actions-runner/_work/wire-webapp/wire-webapp/test/e2e_tests/pageManager/webapp/pages/conversationDetails.page.ts:68:59)
    at /home/runner/actions-runner/_work/wire-webapp/wire-webapp/test/e2e_tests/specs/CriticalFlow/groupVideoCall-TC-8637.spec.ts:127:7
    at /home/runner/actions-runner/_work/wire-webapp/wire-webapp/test/e2e_tests/specs/CriticalFlow/groupVideoCall-TC-8637.spec.ts:123:5
❌ New person joins team and setups up device (tags: TC-8635, crit-flow-web)

Location: specs/CriticalFlow/joinTeam-TC-8635.spec.ts:38
Duration: 67039ms

Errors:

TimeoutError: locator.waitFor: Timeout 20000ms exceeded.
Call log:
  - waiting for locator('#add-participants [data-uie-name="search-list"] [aria-label="Open profile of Anastasia Schamberger"]').locator('input[type="checkbox"]')


   at pageManager/webapp/pages/conversationDetails.page.ts:68

  66 |       await userLocator.click();
  67 |       // Wait for the user to be selected (checkbox should be checked)
> 68 |       await userLocator.locator('input[type="checkbox"]').waitFor({state: 'attached'});
     |                                                           ^
  69 |     }
  70 |
  71 |     await this.page.locator(`${selectById('add-participants')} ${selectByDataAttribute('do-create')}`).click();
    at ConversationDetailsPage.addUsersToConversation (/home/runner/actions-runner/_work/wire-webapp/wire-webapp/test/e2e_tests/pageManager/webapp/pages/conversationDetails.page.ts:68:59)
    at /home/runner/actions-runner/_work/wire-webapp/wire-webapp/test/e2e_tests/specs/CriticalFlow/joinTeam-TC-8635.spec.ts:125:7
    at /home/runner/actions-runner/_work/wire-webapp/wire-webapp/test/e2e_tests/specs/CriticalFlow/joinTeam-TC-8635.spec.ts:114:5

Flaky Tests:

⚠️ 1:1 Video call with device switch and screenshare (tags: TC-8754, crit-flow-web)

Location: specs/CriticalFlow/oneOnOneCall-TC-8754.spec.ts:34

Attempt 1
Result: ❌ Failed
Duration: 1075ms

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:149:5)
    at /home/runner/actions-runner/_work/wire-webapp/wire-webapp/test/e2e_tests/specs/CriticalFlow/oneOnOneCall-TC-8754.spec.ts:52:20
    at /home/runner/actions-runner/_work/wire-webapp/wire-webapp/test/e2e_tests/specs/CriticalFlow/oneOnOneCall-TC-8754.spec.ts:51: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/oneOnOneCall-TC-8754.spec.ts:145:26

Attempt 2
Result: ✅ Passed
Duration: 55651ms

add function to userActions.ts to send a connection request

add fixture for connection request

delete conversationNotConnected.modal.ts, replace it with acknowledge.modal.ts
@sonarqubecloud
Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
6.5% Duplication on New Code (required ≤ 5%)

See analysis details on SonarQube Cloud

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