bigbluebutton-Github/bigbluebutton-tests/playwright
Gabriel Luiz Porfirio dda6f9f85b
test: add test webcam background by passing URL (#21007)
* add test webcam background url

* Update bigbluebutton-tests/playwright/parameters/parameters.spec.js

Co-authored-by: Anton Barboza de Sá <antonbsa.bck@gmail.com>

* add some check for the webcamsettings modal

* changing check for custom background

* add sleep func to wait background to load

* adding a wait for the whiteboard

* added click to select the custom background

---------

Co-authored-by: Anton Barboza de Sá <antonbsa.bck@gmail.com>
2024-09-16 15:42:25 -04:00
..
api test: fix and update tests 2023-02-14 10:59:46 -03:00
audio docs: Testing plan update (what's new features) (#20913) 2024-08-14 09:50:03 -04:00
breakout docs: Testing plan update (what's new features) (#20913) 2024-08-14 09:50:03 -04:00
chat docs: Testing plan update (what's new features) (#20913) 2024-08-14 09:50:03 -04:00
connectionFailure docs: Testing plan update (what's new features) (#20913) 2024-08-14 09:50:03 -04:00
connectionStatus test: increase the amount of tests for CI runs 2023-05-19 10:11:24 -03:00
core test: correctly avoid all presentation notification toasts on unrelated tests 2024-09-13 16:26:54 -03:00
layouts test: correctly avoid all presentation notification toasts on unrelated tests 2024-09-13 16:26:54 -03:00
learningdashboard test: dynamically set parallel or serial mode 2023-08-31 17:21:48 -03:00
notifications test: 2.7 tests fixes 2023-08-22 17:25:50 -03:00
options test: dynamically set parallel or serial mode 2023-08-31 17:21:48 -03:00
parameters test: add test webcam background by passing URL (#21007) 2024-09-16 15:42:25 -04:00
polling test: dynamically set parallel or serial mode 2023-08-31 17:21:48 -03:00
presentation test: update timer test 2024-09-13 16:25:22 -03:00
reconnection test: dynamically set parallel or serial mode 2023-08-31 17:21:48 -03:00
screenshare docs: Testing plan update (what's new features) (#20913) 2024-08-14 09:50:03 -04:00
sharednotes test: minor fixes 2023-08-23 11:05:40 -03:00
stress update test usersJoinKeepingConnected 2022-07-22 17:44:46 -04:00
user test: correctly avoid all presentation notification toasts on unrelated tests 2024-09-13 16:26:54 -03:00
virtualizedlist test: fix and update tests 2023-02-14 10:59:46 -03:00
webcam backport disable self-view test (#20982) 2024-08-21 14:56:21 -03:00
whiteboard test: correctly avoid all presentation notification toasts on unrelated tests 2024-09-13 16:26:54 -03:00
.env.template test: update playwright tests to support sha256 and sha512 algorithms (#19725) 2024-03-07 15:09:54 -05:00
.gitignore add debug features 2022-02-28 18:21:50 -03:00
package-lock.json fix: bigbluebutton-tests/playwright/package.json & bigbluebutton-tests/playwright/package-lock.json to reduce vulnerabilities (#20939) 2024-08-27 08:59:26 -04:00
package.json fix: bigbluebutton-tests/playwright/package.json & bigbluebutton-tests/playwright/package-lock.json to reduce vulnerabilities (#20939) 2024-08-27 08:59:26 -04:00
playwright.config.js Merge pull request #18664 from antonbsa/shard-tests-ci 2023-09-15 08:49:09 -04:00
README.md test: update instructions to only test specific browser 2023-03-31 15:37:07 -04:00

BigBlueButton Playwright Tests

Tests for BigBlueButton using Playwright.

Setup (with an existing BigBlueButton server)

You need to install the dependencies:

$ cd ../bigbluebutton-tests/playwright
$ npm install
$ npx playwright install

You may also need to run the following command:

$ npx playwright install-deps

To run these tests with an existing BigBlueButton server, you need to find the server's URL and secret (can be done with bbb-conf --secret command). You need to put them into the .env file inside bigbluebutton-tests/playwright folder (variables BBB_URL and BBB_SECRET). Note: the value for BBB_URL follows the format of https://<hostname>/bigbluebutton/api.

Run tests

We recommend to use Node version 16 or higher to avoid errors in JavaScript. Tests can be executed using npx and npm test. You can run all tests in each of 3 supported environments (chromium, firefox, webkit) with one of the following commands:

$ npx playwright test
or
$ npm test

You can also run a single test suite and limit the execution to only one browser:

$ npx playwright test chat --project="firefox"
or
$ npm test chat -- --project="firefox" # or "chromium" for example

Additional commands

To see the tests running visually, you must run them in headed mode:

$ npm run test:headed chat

If you want to run a specific test or a specific group of tests, you can do so with the following command:

$ npm run test:filter "Send public message"

(note that this filter needs to be passed in "double quotes")

You can also use this also through the test tree, adding the test suite / group of tests before the test filter:

$ npm run test:filter "notifications chat"

If you don't have BBB_URL and BBB_SECRET set, but have ssh access to the test server, you can use the following command to obtain BBB_URL and BBB_SECRET via ssh:

$ npm run test:ssh -- HOSTNAME

Recording Meteor messages

A modified version of websockify can be used to record the Meteor messages exchanged between client and server, by inserted a WebSocket proxy between the client and server, configured to record the sessions.

First, on the server, obtain the modified websockify:

git clone https://github.com/BrentBaccala/websockify.git

Install additional dependencies:

sudo apt install python3-numpy

Then add the following stanza to /usr/share/bigbluebutton/nginx/bbb-html5.nginx:

location ~* /html5client/.*/websocket {
  proxy_pass http://127.0.0.1:4200;
  proxy_http_version 1.1;
  proxy_set_header Upgrade $http_upgrade;
  proxy_set_header Connection "Upgrade";
}

From the websockify directory, run websockify configured to proxy WebSocket connections from port 4200 to port 4100, recording the sessions to files named bbb.1, bbb.2, etc.:

./run -v --record=bbb --ws-target=ws://localhost:4100{path} 4200

Now reload nginx:

sudo systemctl reload nginx

Meteor messages for Big Blue Button sessions will now be recorded for later review.

It doesn't seem necessary to relay cookies, but that could be done by giving a --ws-relay-header=Cookie argument to websockify.

You can print the browser console log to standard output by setting the environment variable CONSOLE:

$ CONSOLE= npm test chat -- --project=firefox

CONSOLE can be blank (as in the example), or can be a comma-separated list of the following options:

Option Meaning
color (or "colour") colorize the output
label label each line with the BigBlueButton user
norefs remove JavaScript reference URLs
nots remove timestamps
nocl remove "clientLogger:" strings