Skip to content

test: write the federation regression tests [WPB-19988]#21440

Open
zhannach wants to merge 17 commits into
devfrom
test/WPB-19988-write-the-federation-tests
Open

test: write the federation regression tests [WPB-19988]#21440
zhannach wants to merge 17 commits into
devfrom
test/WPB-19988-write-the-federation-tests

Conversation

@zhannach
Copy link
Copy Markdown
Collaborator

@zhannach zhannach commented Jun 3, 2026

TaskWPB-19988 [Web/QA] Write the Federation regression tests in Playwright

This PR introduces new Federation regression test suite.

These tests validate key federation capabilities, including asset sharing, cross-backend communication, backup imports, and real-time audio/video calls between different backend environments.

Changes:

  • New Regression Coverage: Added 6 new automated test cases.
  • Refactored API-related logic to dynamically support requests across different backend environments.
  • Extended the CreateTeam fixture and PageManager to accept and initialize distinct backend configurations.
  • Refactored conversation participant selectors to eliminate duplication and improve maintainability.


getUserAvailabilityIcon(fullName: string) {
return this.getLocatorByUser(fullName).getByTestId('status-availability-icon');
getParticipant(fullName: string) {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Lovely ❤️

Comment on lines +251 to +257
const messageNormalUser = normalUserPages.conversation().getMessage({sender: normalUser});
await expect(messageNormalUser).toBeVisible();
await expect(federatedUserPages.conversation().getMessage({sender: normalUser})).toBeVisible();

await normalUserPages.conversation().deleteMessage(messageNormalUser, 'Everyone');
await expect(messageNormalUser).not.toBeVisible();
await expect(federatedUserPage.getByTestId('element-message-delete')).toBeVisible();
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Why use the "element-message-deleted" test id? How about checking the message is there and then expecting it to be gone after deletion? :)

Suggested change
const messageNormalUser = normalUserPages.conversation().getMessage({sender: normalUser});
await expect(messageNormalUser).toBeVisible();
await expect(federatedUserPages.conversation().getMessage({sender: normalUser})).toBeVisible();
await normalUserPages.conversation().deleteMessage(messageNormalUser, 'Everyone');
await expect(messageNormalUser).not.toBeVisible();
await expect(federatedUserPage.getByTestId('element-message-delete')).toBeVisible();
const messageNormalUser = normalUserPages.conversation().getMessage({sender: normalUser});
const messageFederatedUser = federatedUserPages.conversation().getMessage({sender: normalUser});
await expect(messageNormalUser).toBeVisible();
await expect(messageFederatedUser).toBeVisible();
await normalUserPages.conversation().deleteMessage(messageNormalUser, 'Everyone');
await expect(messageNormalUser).not.toBeVisible();
await expect(messageFederatedUser).not.toBeVisible();

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

It was implemented according to the requirements:

User A deletes previous text message for all users 
User B sees deleted message 

Comment on lines +354 to +358
let backupName: string;
await test.step('Create and save backup for the normal user', async () => {
await normalUserComponents.conversationSidebar().clickPreferencesButton();
backupName = await createAndSaveBackup(testInfo, normalUserPageManager);
});
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

🎨 I learned that this was possible from you in one of your previous PRs ;)

Suggested change
let backupName: string;
await test.step('Create and save backup for the normal user', async () => {
await normalUserComponents.conversationSidebar().clickPreferencesButton();
backupName = await createAndSaveBackup(testInfo, normalUserPageManager);
});
const backupName = await test.step('Create and save backup for the normal user', async () => {
await normalUserComponents.conversationSidebar().clickPreferencesButton();
return await createAndSaveBackup(testInfo, normalUserPageManager);
});

Comment on lines +226 to +230
await createGroup(normalUserPages, groupName, []);
await normalUserPages.conversationList().getConversation(groupName).open();
await normalUserPages.conversation().toggleGroupInformation();
await normalUserPages.conversationDetails().clickAddPeopleButton();
await normalUserPages.conversationDetails().addUsersToConversation([federatedUser.fullName]);
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Is there a specific reason why you're adding the federatedUser like this instead of just passing him to the users array?

Suggested change
await createGroup(normalUserPages, groupName, []);
await normalUserPages.conversationList().getConversation(groupName).open();
await normalUserPages.conversation().toggleGroupInformation();
await normalUserPages.conversationDetails().clickAddPeopleButton();
await normalUserPages.conversationDetails().addUsersToConversation([federatedUser.fullName]);
await createGroup(normalUserPages, groupName, [federatedUser]);

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Yes, the requirements were to create an empty group and then invite the federated user to it. However, since there are no specific checks during this step, I'd like to see if we can align on simplifying it.

@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented Jun 4, 2026

Quality Gate Failed Quality Gate failed

Failed conditions
C Reliability Rating on New Code (required ≥ A)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

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