Skip to content

Commit

Permalink
test: update reconnection tests
Browse files Browse the repository at this point in the history
  • Loading branch information
antonbsa committed Dec 12, 2024
1 parent 38c0aff commit cdaa6c9
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 12 deletions.
2 changes: 1 addition & 1 deletion bigbluebutton-tests/playwright/core/elements.js
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ exports.userListContent = 'div[data-test="userListContent"]';
exports.brandingAreaLogo = 'div[data-test="brandingArea"]';
exports.toolbarToolsList = 'div[data-test="toolbarToolsList"]';
exports.notificationBannerBar = 'div[data-test="notificationBannerBar"]';
exports.reconnectingBar = '//div[@data-test="notificationBannerBar" and contains(text(), "Connecting ...")]';
exports.reconnectingBar = '//div[@data-test="notificationBannerBar" and contains(text(), "Reconnection in progress")]';
exports.zoomInBtn = 'button[data-test="zoomInBtn"]';
exports.recordingIndicator = 'div[data-test="recordingIndicator"]';
exports.webcamMirroredVideoContainer = 'video[data-test="mirroredVideoContainer"]';
Expand Down
23 changes: 12 additions & 11 deletions bigbluebutton-tests/playwright/reconnection/reconnection.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ const { expect } = require('@playwright/test');
const { MultiUsers } = require('../user/multiusers');
const e = require('../core/elements');
const { killConnection } = require('./util');
const { runScript } = require('../core/util');
const { ELEMENT_WAIT_TIME } = require('../core/constants');

class Reconnection extends MultiUsers {
Expand All @@ -14,19 +13,20 @@ class Reconnection extends MultiUsers {
// chat enabled
await this.modPage.waitForSelector(e.chatBox);
const chatBoxLocator = this.modPage.getLocator(e.chatBox);
await expect(chatBoxLocator).toBeEnabled();
await expect(chatBoxLocator, 'should the chat box be enabled as soon as the user join').toBeEnabled();

killConnection();
await this.modPage.hasElement(e.notificationBannerBar, 'should the notification bar be displayed after connection lost');

// chat disabled and notification bar displayed
await Promise.all([
expect(chatBoxLocator).toBeDisabled({ timeout: ELEMENT_WAIT_TIME }),
this.modPage.hasElement(e.reconnectingBar),
expect(chatBoxLocator, 'should the chat box be disabled when the connection lost').toBeDisabled({ timeout: ELEMENT_WAIT_TIME }),
this.modPage.hasText(e.notificationBannerBar, 'Reconnection in progress'),
]);

// reconnected -> chat enabled
await expect(chatBoxLocator).toBeEnabled();
await this.modPage.wasRemoved(e.notificationBannerBar);
await expect(chatBoxLocator, 'chat box should be enabled again after reconnecting successfully').toBeEnabled();
await this.modPage.wasRemoved(e.notificationBannerBar, 'notification bar should be removed after reconnecting successfully');
}

async microphone() {
Expand All @@ -36,17 +36,18 @@ class Reconnection extends MultiUsers {

// mute is available
const muteMicButtonLocator = this.modPage.getLocator(e.muteMicButton);
await expect(muteMicButtonLocator).toBeEnabled();
await expect(muteMicButtonLocator, 'mute button should be enabled as soon as the user join').toBeEnabled();

killConnection();
await this.modPage.hasElement(e.reconnectingBar);
await this.modPage.hasElement(e.notificationBannerBar, 'should the notification bar be displayed after connection lost');
await this.modPage.hasText(e.notificationBannerBar, 'Reconnection in progress'),

// reconnected
await this.modPage.wasRemoved(e.notificationBannerBar);
await this.modPage.wasRemoved(e.notificationBannerBar, 'notification bar should be removed after reconnecting successfully');

// audio connection should keep connected
await this.modPage.hasElement(e.muteMicButton);
await this.modPage.hasElement(e.isTalking);
await this.modPage.hasElement(e.muteMicButton, 'user audio should keep connected after reconnection');
await this.modPage.hasElement(e.isTalking, 'user audio should be kept capturing after reconnection');
}
}

Expand Down

0 comments on commit cdaa6c9

Please sign in to comment.