webrtc / KITE

KITE is a test engine designed to test WebRTC interoperability across browsers
Apache License 2.0
468 stars 126 forks source link

How can i get call duration with KITE? #92

Closed KiteTesting closed 4 years ago

KiteTesting commented 4 years ago

This is the JoinMeetingStep , from which i get the date and time when each participant joins the conference :const {TestStep, TestUtils, KiteTestError, Status} = require('kite-common');

class MeetingStep extends TestStep {

constructor(kiteBaseTest) { super(); this.driver = kiteBaseTest.driver; this.timeout = kiteBaseTest.timeout;

this.url = kiteBaseTest.payload.url1;
this.uuid = kiteBaseTest.uuid;
this.page = kiteBaseTest.page;

this.statsCollectionInterval = kiteBaseTest.statsCollectionInterval;
 this.selectedStats = kiteBaseTest.selectedStats;
 this.peerConnections = kiteBaseTest.peerConnections;
 this.testReporter = kiteBaseTest.reporter;
 this.id = kiteBaseTest.id;
 this.user = kiteBaseTest.payload.users[this.id].user;
 this.pass = kiteBaseTest.payload.users[this.id].pass;
 this.statsCollectionTime = kiteBaseTest.statsCollectionTime;

} stepDescription() { return 'Join a meeting room as guest ' + this.user + ' in: ' + this.url + ' at ' + Date(); } async step() {

await this.page.open(this); await this.page.hitLogin();

} }

module.exports = MeetingStep;

Now, i have these issues: 1.How can i set for a call to have a fixed duration of 15minutes; 2.If a participant ends the call , how can i know the time and date when he leaved the call

namvuCosmo commented 4 years ago
  1. the call duration can be set in the test's payload in the config file.

      "payload" : {
        "url": "https://appr.tc",
        "port": 30000,
        "duration": 90000, <<-
        "testTimeout": 60,
        "getStats" : {
          "enabled": true,
          "statsCollectionTime": 2,
          "statsCollectionInterval": 1,
          "peerConnections": ["appController.call_.pcClient_.pc_"],
          "selectedStats" : ["inbound-rtp", "outbound-rtp", "candidate-pair"]
        }

    then you can access this the same way as the url value.

  2. It depends on how you detect this participant leaving the call, maybe you can have this value in your app, and retrieve this by executing the script on browser side. Something like:

    const participant1LeaveTime= await this.driver.executeScript('return getTimeLeave(participant1)');
KiteTesting commented 4 years ago

issue is solved