Skip to content

Commit

Permalink
Add simulcast integration tests
Browse files Browse the repository at this point in the history
  • Loading branch information
XHatan authored and ltrung committed Jun 19, 2020
1 parent ee8831f commit 55b34a5
Show file tree
Hide file tree
Showing 12 changed files with 65 additions and 18 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Add simulcast support and provides new uplink downlink policies
- Add MultiLogger to support logging to multiple Logger instances
- Add resize listener on HTMLVideoElement in demo
- Add simulcast integration tests

### Changed
- Use GET instead of POST to obtain TURN credentials
- Move integration tests to use meeting V2 demo
Expand Down
18 changes: 9 additions & 9 deletions docs/classes/videoadaptiveprobepolicy.html
Original file line number Diff line number Diff line change
Expand Up @@ -471,7 +471,7 @@ <h3><span class="tsd-flag ts-flagPrivate">Private</span> avail<wbr>Streams<wbr>S
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/aws/amazon-chime-sdk-js/blob/master/src/videodownlinkbandwidthpolicy/VideoAdaptiveProbePolicy.ts#L650">src/videodownlinkbandwidthpolicy/VideoAdaptiveProbePolicy.ts:650</a></li>
<li>Defined in <a href="https://github.com/aws/amazon-chime-sdk-js/blob/master/src/videodownlinkbandwidthpolicy/VideoAdaptiveProbePolicy.ts#L652">src/videodownlinkbandwidthpolicy/VideoAdaptiveProbePolicy.ts:652</a></li>
</ul>
</aside>
<h4 class="tsd-parameters-title">Parameters</h4>
Expand Down Expand Up @@ -511,7 +511,7 @@ <h3><span class="tsd-flag ts-flagPrivate">Private</span> calculate<wbr>Subscribe
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/aws/amazon-chime-sdk-js/blob/master/src/videodownlinkbandwidthpolicy/VideoAdaptiveProbePolicy.ts#L588">src/videodownlinkbandwidthpolicy/VideoAdaptiveProbePolicy.ts:588</a></li>
<li>Defined in <a href="https://github.com/aws/amazon-chime-sdk-js/blob/master/src/videodownlinkbandwidthpolicy/VideoAdaptiveProbePolicy.ts#L590">src/videodownlinkbandwidthpolicy/VideoAdaptiveProbePolicy.ts:590</a></li>
</ul>
</aside>
<h4 class="tsd-parameters-title">Parameters</h4>
Expand All @@ -537,7 +537,7 @@ <h3><span class="tsd-flag ts-flagPrivate">Private</span> choose<wbr>Content</h3>
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/aws/amazon-chime-sdk-js/blob/master/src/videodownlinkbandwidthpolicy/VideoAdaptiveProbePolicy.ts#L635">src/videodownlinkbandwidthpolicy/VideoAdaptiveProbePolicy.ts:635</a></li>
<li>Defined in <a href="https://github.com/aws/amazon-chime-sdk-js/blob/master/src/videodownlinkbandwidthpolicy/VideoAdaptiveProbePolicy.ts#L637">src/videodownlinkbandwidthpolicy/VideoAdaptiveProbePolicy.ts:637</a></li>
</ul>
</aside>
<h4 class="tsd-parameters-title">Parameters</h4>
Expand Down Expand Up @@ -581,7 +581,7 @@ <h3><span class="tsd-flag ts-flagPrivate">Private</span> chosen<wbr>Streams<wbr>
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/aws/amazon-chime-sdk-js/blob/master/src/videodownlinkbandwidthpolicy/VideoAdaptiveProbePolicy.ts#L670">src/videodownlinkbandwidthpolicy/VideoAdaptiveProbePolicy.ts:670</a></li>
<li>Defined in <a href="https://github.com/aws/amazon-chime-sdk-js/blob/master/src/videodownlinkbandwidthpolicy/VideoAdaptiveProbePolicy.ts#L672">src/videodownlinkbandwidthpolicy/VideoAdaptiveProbePolicy.ts:672</a></li>
</ul>
</aside>
<h4 class="tsd-parameters-title">Parameters</h4>
Expand Down Expand Up @@ -630,7 +630,7 @@ <h3><span class="tsd-flag ts-flagPrivate">Private</span> handle<wbr>Paused<wbr>S
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/aws/amazon-chime-sdk-js/blob/master/src/videodownlinkbandwidthpolicy/VideoAdaptiveProbePolicy.ts#L604">src/videodownlinkbandwidthpolicy/VideoAdaptiveProbePolicy.ts:604</a></li>
<li>Defined in <a href="https://github.com/aws/amazon-chime-sdk-js/blob/master/src/videodownlinkbandwidthpolicy/VideoAdaptiveProbePolicy.ts#L606">src/videodownlinkbandwidthpolicy/VideoAdaptiveProbePolicy.ts:606</a></li>
</ul>
</aside>
<h4 class="tsd-parameters-title">Parameters</h4>
Expand Down Expand Up @@ -659,7 +659,7 @@ <h3><span class="tsd-flag ts-flagPrivate">Private</span> handle<wbr>Probe</h3>
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/aws/amazon-chime-sdk-js/blob/master/src/videodownlinkbandwidthpolicy/VideoAdaptiveProbePolicy.ts#L481">src/videodownlinkbandwidthpolicy/VideoAdaptiveProbePolicy.ts:481</a></li>
<li>Defined in <a href="https://github.com/aws/amazon-chime-sdk-js/blob/master/src/videodownlinkbandwidthpolicy/VideoAdaptiveProbePolicy.ts#L483">src/videodownlinkbandwidthpolicy/VideoAdaptiveProbePolicy.ts:483</a></li>
</ul>
</aside>
<h4 class="tsd-parameters-title">Parameters</h4>
Expand Down Expand Up @@ -688,7 +688,7 @@ <h3><span class="tsd-flag ts-flagPrivate">Private</span> maybe<wbr>Override<wbr>
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/aws/amazon-chime-sdk-js/blob/master/src/videodownlinkbandwidthpolicy/VideoAdaptiveProbePolicy.ts#L514">src/videodownlinkbandwidthpolicy/VideoAdaptiveProbePolicy.ts:514</a></li>
<li>Defined in <a href="https://github.com/aws/amazon-chime-sdk-js/blob/master/src/videodownlinkbandwidthpolicy/VideoAdaptiveProbePolicy.ts#L516">src/videodownlinkbandwidthpolicy/VideoAdaptiveProbePolicy.ts:516</a></li>
</ul>
</aside>
<h4 class="tsd-parameters-title">Parameters</h4>
Expand Down Expand Up @@ -726,7 +726,7 @@ <h3>set<wbr>Probe<wbr>State</h3>
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/aws/amazon-chime-sdk-js/blob/master/src/videodownlinkbandwidthpolicy/VideoAdaptiveProbePolicy.ts#L406">src/videodownlinkbandwidthpolicy/VideoAdaptiveProbePolicy.ts:406</a></li>
<li>Defined in <a href="https://github.com/aws/amazon-chime-sdk-js/blob/master/src/videodownlinkbandwidthpolicy/VideoAdaptiveProbePolicy.ts#L408">src/videodownlinkbandwidthpolicy/VideoAdaptiveProbePolicy.ts:408</a></li>
</ul>
</aside>
<h4 class="tsd-parameters-title">Parameters</h4>
Expand Down Expand Up @@ -814,7 +814,7 @@ <h3><span class="tsd-flag ts-flagPrivate">Private</span> upgrade<wbr>ToStream</h
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/aws/amazon-chime-sdk-js/blob/master/src/videodownlinkbandwidthpolicy/VideoAdaptiveProbePolicy.ts#L453">src/videodownlinkbandwidthpolicy/VideoAdaptiveProbePolicy.ts:453</a></li>
<li>Defined in <a href="https://github.com/aws/amazon-chime-sdk-js/blob/master/src/videodownlinkbandwidthpolicy/VideoAdaptiveProbePolicy.ts#L455">src/videodownlinkbandwidthpolicy/VideoAdaptiveProbePolicy.ts:455</a></li>
</ul>
</aside>
<h4 class="tsd-parameters-title">Parameters</h4>
Expand Down
27 changes: 27 additions & 0 deletions integration/configs/video_test_simulcast.config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"`": 1,
"name": "video_test_simulcast.config.json %ts",
"grids": [
],
"tests": [
{
"name": "Video Test Simulcast %ts",
"description": "Video Test Simulcast",
"tupleSize": 2,
"noOfThreads": 1,
"testImpl": "VideoTest.js",
"payload": {
"url": "http://localhost:8080/",
"retry": 2,
"useSimulcast": true
}
}
],
"clients": [
{
"browserName": "chrome",
"version": "78",
"platform": "MAC"
}
]
}
3 changes: 2 additions & 1 deletion integration/js/VideoTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,10 @@ class VideoTest extends SdkBaseTest {

async runIntegrationTest() {
const session = this.seleniumSessions[0];
const useSimulcast = this.useSimulcast;
await WaitForMeetingToBeCreated.executeStep(this, session);
await OpenAppStep.executeStep(this, session);
await AuthenticateUserStep.executeStep(this, session, this.attendeeId);
await AuthenticateUserStep.executeStep(this, session, this.attendeeId, useSimulcast);
await UserAuthenticationCheck.executeStep(this, session);
await JoinMeetingStep.executeStep(this, session);
await UserJoinedMeetingCheck.executeStep(this, session, this.attendeeId);
Expand Down
6 changes: 6 additions & 0 deletions integration/js/pages/AppPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ const elements = {

meetingAudio: By.id('meeting-audio'),
sipUri: By.id('sip-uri'),
optionalFeatures: By.id('optional-features'),
};

const SessionStatus = {
Expand Down Expand Up @@ -73,6 +74,11 @@ class AppPage {
await authenticateButton.click();
}

async chooseUseSimulcast() {
let featureSelection = await this.driver.findElement(elements.optionalFeatures);
await featureSelection.sendKeys('simulcast');
}

async joinMeeting() {
let joinButton = await this.driver.findElement(elements.joinButton);
await joinButton.click();
Expand Down
1 change: 1 addition & 0 deletions integration/js/script/run-test
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ case $1 in
;;
video)
r video_test.config.json
r video_test_simulcast.config.json
r app_quit_video_test.config.json
r meeting_leave_video_test.config.json
r reconnection_test.config.json
Expand Down
12 changes: 8 additions & 4 deletions integration/js/steps/AuthenticateUserStep.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@ const {KiteTestError, Status} = require('kite-common');
const AppTestStep = require('../utils/AppTestStep');

class AuthenticateUserStep extends AppTestStep {
constructor(kiteBaseTest, sessionInfo, attendee_id) {
constructor(kiteBaseTest, sessionInfo, attendee_id, useSimulcastFlag = false) {
super(kiteBaseTest, sessionInfo);
this.attendee_id = attendee_id;
this.useSimulcastFlag = useSimulcastFlag;
}

static async executeStep(KiteBaseTest, sessionInfo, attendee_id) {
const step = new AuthenticateUserStep(KiteBaseTest, sessionInfo, attendee_id);
static async executeStep(KiteBaseTest, sessionInfo, attendee_id, useSimulcastFlag = false) {
const step = new AuthenticateUserStep(KiteBaseTest, sessionInfo, attendee_id, useSimulcastFlag);
await step.execute(KiteBaseTest);
}

Expand All @@ -23,7 +24,10 @@ class AuthenticateUserStep extends AppTestStep {
async run() {
this.logger("attendee id: " + this.attendee_id);
await this.page.enterAttendeeName(this.attendee_id);

if (this.useSimulcastFlag) {
this.logger("choose to use simulcast");
await this.page.chooseUseSimulcast();
}
await this.page.authenticate();
this.logger("waiting to authenticate");
let authenticationState = await this.page.waitForAuthentication();
Expand Down
4 changes: 4 additions & 0 deletions integration/js/utils/SdkBaseTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ class SdkBaseTest extends KiteBaseTest {
this.capabilities["name"] = process.env.STAGE !== undefined ? `${testName}-${process.env.TEST_TYPE}-${process.env.STAGE}`: `${testName}-${process.env.TEST_TYPE}`;
this.seleniumSessions = [];
this.timeout = this.payload.testTimeout ? this.payload.testTimeout : 60;
this.useSimulcast = !!this.payload.useSimulcast ? true : false;
if (this.useSimulcast) {
this.testName += 'Simulcast';
}
if (this.numberOfParticipant > 1) {
this.attendeeId = uuidv4();
this.io.emit("test_name", testName);
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "amazon-chime-sdk-js",
"version": "1.9.9",
"version": "1.9.10",
"description": "Amazon Chime SDK for JavaScript",
"main": "build/index.js",
"types": "build/index.d.ts",
Expand Down
2 changes: 1 addition & 1 deletion src/versioning/Versioning.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export default class Versioning {
* Return string representation of SDK version
*/
static get sdkVersion(): string {
return '1.9.9';
return '1.9.10';
}

/**
Expand Down
4 changes: 3 additions & 1 deletion src/videodownlinkbandwidthpolicy/VideoAdaptiveProbePolicy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,9 @@ export default class VideoAdaptiveProbePolicy implements VideoDownlinkBandwidthP
this.downlinkStats.packetsLost === 0
) {
// Set target to be the same as last
this.logger.info('bwe: ValidateRate: Using Previous rate ' + this.prevTargetRateKbps);
this.logger.debug(() => {
return 'bwe: ValidateRate: Using Previous rate ' + this.prevTargetRateKbps;
});
this.usingPrevTargetRate = true;
targetBitrate = this.prevTargetRateKbps;
} else {
Expand Down

0 comments on commit 55b34a5

Please sign in to comment.