From cdaa6c92d20423d0fca0528b917f94a5ff971610 Mon Sep 17 00:00:00 2001 From: Anton B Date: Thu, 12 Dec 2024 10:16:34 -0300 Subject: [PATCH] test: update reconnection tests --- .../playwright/core/elements.js | 2 +- .../playwright/reconnection/reconnection.js | 23 ++++++++++--------- 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/bigbluebutton-tests/playwright/core/elements.js b/bigbluebutton-tests/playwright/core/elements.js index 75af8935c6de..12b4ed9e225b 100644 --- a/bigbluebutton-tests/playwright/core/elements.js +++ b/bigbluebutton-tests/playwright/core/elements.js @@ -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"]'; diff --git a/bigbluebutton-tests/playwright/reconnection/reconnection.js b/bigbluebutton-tests/playwright/reconnection/reconnection.js index 19efe5e79c20..286354926b3d 100644 --- a/bigbluebutton-tests/playwright/reconnection/reconnection.js +++ b/bigbluebutton-tests/playwright/reconnection/reconnection.js @@ -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 { @@ -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() { @@ -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'); } }