This tool allows stress testing of a BBBB server by running automation scripts in a browserless environment.
The Browserless server can run either locally or on a remote machine. Use Docker to set up the server.
If you want to run the Browserless server locally, execute the following command:
docker run -e 'TIMEOUT=3600000' -d -p 3000:3000 --rm --name bbb_stress_test_browserless ghcr.io/browserless/multi
If you prefer to run the Browserless server on a remote machine:
-
Install Docker on the remote machine.
-
Run the above Docker command on the remote machine.
-
Note the public or private IP address of the remote server and ensure port 3000 is accessible.
On the machine running the bbb-stress-test
client, install the required Node.js dependencies and Playwright:
npm install
npx playwright install --with-deps
Ensure your automation scripts are compatible with the expected format. Each script should export a doIt
function, like this:
export async function doIt(contextData, browser, page, log) {
log("Executing automation script...");
// Your automation logic here
}
Use the following command to run the stress test:
./stress-test.js --bbbbServerUrl <URL> --bbbServerSecret <SECRET> --automationScripts <SCRIPTS> [--concurrent <SESSIONS>]
-
--bbbbServerUrl
: The URL of the BBBB server (required). -
--bbbServerSecret
: The secret key for the BBB server (required). -
--automationScripts
: A comma-separated list of paths to your automation scripts (required). -
--concurrent
: The number of concurrent sessions to run (optional, defaults to 1).
The code assumes the Browserless server is running at ws://localhost:3000/chromium/playwright
. If the server is running on a remote machine, you need to update the connection URL in the code to point to the remote server's WebSocket URL (e.g., ws://<REMOTE_IP>:3000/chromium/playwright
).
# Create a meeting, join 1 moderator, and 4 attendees, and wait 60 seconds
node index.js \
--bbbbServerUrl "https://example.com" \
--bbbServerSecret "mySecretKey" \
--automationScripts "./automation-scripts/createMeeting.js,./automation-scripts/printJoinUrls.js,./automation-scripts/joinMeetingAsModeratorIfFirstSession.js,./automation-scripts/joinMeetingAsAttendeeIfNotFirstSession.js,./automation-scripts/sleep60Seconds.js" \
--concurrent 5