Compare commits

...

2 Commits

Author SHA1 Message Date
damencho
8cf76b20c7 debug 2025-03-05 07:40:32 -06:00
damencho
44c1633952 feat(tests): Fixes the checks when to use token.
We have few options:
- iframeAPI tests generating tokens via jwtPrivateKeyPath
- tests that just use provided JWT_ACCESS_TOKEN for the first participant to avoid deployments where initial authentication is required
- tests that does not use iframeAPI, but want to use the jwtPrivateKeyPath for a meeting (invite test as JWT_ACCESS_TOKEN does not satisfy some services)
2025-03-04 19:08:04 -06:00
2 changed files with 9 additions and 3 deletions

View File

@@ -617,7 +617,13 @@ export class Participant {
// let's give it some time to leave the muc, we redirect after hangup so we should wait for the
// change of url
await this.driver.waitUntil(
async () => current !== await this.driver.getUrl(),
async () => {
const u = await this.driver.getUrl();
console.log('url:', current, u);
return current !== u;
},
{
timeout: 5000,
timeoutMsg: `${this.name} did not leave the muc in 5s`

View File

@@ -168,8 +168,8 @@ async function joinTheModeratorAsP1(ctx: IContext, options?: IJoinOptions) {
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
|| !options?.forceGenerateToken)) {
if (process.env.JWT_ACCESS_TOKEN
&& (ctx.jwtPrivateKeyPath && !ctx.iframeAPI && !options?.forceGenerateToken)) {
token = process.env.JWT_ACCESS_TOKEN;
} else if (ctx.jwtPrivateKeyPath) {
token = getModeratorToken(p1DisplayName);