in integration/js/utils/SdkBaseTest.js [12:100]
constructor(name, kiteConfig, testName) {
super(name, kiteConfig);
this.baseUrl = this.url;
if (testName === 'ContentShareOnlyAllowTwoTest') {
this.url = this.getTransformedURL(this.url, 'max-content-share', 'true');
}
if (testName === 'MessagingSessionTest') {
this.userArn = this.payload.userArn;
}
if (testName === 'MediaCapture' || testName === 'Transcription') {
this.region = this.payload.region;
}
if (['Video', 'Audio'].includes(testName)) {
this.url = this.getTransformedURL(this.url, 'attendee-presence-timeout-ms', 5000);
// Allows us to easily treat unexpected reconnects as failures
this.url = this.getTransformedURL(this.url, 'abort-on-reconnect', 'true');
this.url = this.getTransformedURL(this.url, 'fatal', '1');
}
this.originalURL = this.url;
this.testReady = false;
this.testFinish = false;
this.testName = testName;
this.useSimulcast = !!this.payload.useSimulcast;
if (this.useSimulcast) {
this.testName += 'Simulcast';
}
this.useVideoProcessor = !!this.payload.useVideoProcessor;
if (this.useVideoProcessor) {
this.testName += 'Processor';
}
this.capabilities["name"] = process.env.STAGE !== undefined ? `${this.testName}-${process.env.TEST_TYPE}-${process.env.STAGE}`: `${this.testName}-${process.env.TEST_TYPE}`;
this.seleniumSessions = [];
this.timeout = this.payload.testTimeout ? this.payload.testTimeout : 60;
if (this.numberOfParticipant > 1) {
this.io.emit("test_name", this.testName);
this.io.emit("test_capabilities", this.capabilities);
this.io.on('all_clients_ready', isReady => {
this.testReady = !!isReady;
});
this.io.on("remote_video_on", (id) => {
console.log(`[${id}] turned on video`);
this.numVideoRemoteOn += 1;
this.numVideoRemoteOff = Math.max(1, this.numVideoRemoteOff - 1);
});
this.io.on("remote_video_off", (id) => {
console.log(`[${id}] turned off video`);
this.numVideoRemoteOff += 1;
this.numVideoRemoteOn = Math.max(1, this.numVideoRemoteOn - 1);
});
this.io.on("video_check_completed_by_other_participants", (id) => {
console.log(`[${id}] completed video checks`);
this.numOfParticipantsCompletedVideoCheck += 1;
});
this.io.on("audio_check_completed_by_other_participants", (id) => {
console.log(`[${id}] completed audio checks`);
this.numOfParticipantsCompletedAudioCheck += 1;
});
this.io.on("remote_audio_on", (id) => {
console.log(`[${id}] turned on audio`);
this.numRemoteAudioOn += 1;
this.numRemoteAudioOff = Math.max(1, this.numRemoteAudioOff - 1);
});
this.io.on("remote_audio_off", (id) => {
console.log(`[${id}] turned off audio`);
this.numRemoteAudioOff += 1;
this.numRemoteAudioOn = Math.max(1, this.numRemoteAudioOn - 1);
});
this.io.on("failed", () => {
console.log("[OTHER_PARTICIPANT] test failed, quitting...");
this.remoteFailed = true;
});
this.io.on("participant_count", count => {
console.log("Number of participants on the meeting: " + count);
this.numRemoteJoined = count;
});
this.io.on("meeting_created", meetingId => {
this.meetingCreated = true;
this.meetingTitle = meetingId;
this.url = this.getTransformedURL(this.originalURL, 'm', this.meetingTitle);
});
this.io.on("finished", () => {
this.testFinish = true;
});
}
}