Compare commits

...

2 Commits

Author SHA1 Message Date
damencho
4f0f8ea019 fix(tests): Skip iframeAPI if it is disabled. 2025-02-26 14:35:11 -06:00
damencho
444f4a7abc feat(tests): Adds an option for an access jwt token.
Used only for the first participant joining/creating the room.
2025-02-25 09:17:58 -06:00
3 changed files with 18 additions and 3 deletions

View File

@@ -26,6 +26,9 @@
# The kid to use in the token
#JWT_KID=
# An access token to use to create meetings (used for the first participant)
#JWT_ACCESS_TOKEN=
# The count of workers that execute the tests in parallel
# MAX_INSTANCES=1

View File

@@ -165,9 +165,14 @@ async function joinTheModeratorAsP1(ctx: IContext, options?: IJoinOptions) {
const p1DisplayName = P1_DISPLAY_NAME;
let token;
// if it is jaas create the first one to be moderator and second not moderator
if (ctx.jwtPrivateKeyPath && !options?.skipFirstModerator) {
token = getModeratorToken(p1DisplayName);
if (!options?.skipFirstModerator) {
// we prioritize the access token when iframe is not used and private key is set,
// otherwise if private key is not specified we use the access token if set
if (process.env.JWT_ACCESS_TOKEN && (!ctx.jwtPrivateKeyPath || !ctx.iframeAPI)) {
token = process.env.JWT_ACCESS_TOKEN;
} else if (ctx.jwtPrivateKeyPath) {
token = getModeratorToken(p1DisplayName);
}
}
// make sure the first participant is moderator, if supported by deployment

View File

@@ -37,6 +37,13 @@ describe('Participants presence', () => {
const { p1, p2, webhooksProxy } = ctx;
if (await p1.execute(() => config.disableIframeAPI)) {
// skip the test if iframeAPI is disabled
ctx.skipSuiteTests = true;
return;
}
// let's populate endpoint ids
await Promise.all([
p1.getEndpointId(),