mirror of https://github.com/OpenVidu/openvidu.git
openvidu-test-e2e: fix restApiFetchForce
parent
166ab0ba83
commit
e5f87f58e8
|
@ -1996,9 +1996,11 @@ public class OpenViduTestAppE2eTest extends AbstractOpenViduTestappE2eTest {
|
||||||
|
|
||||||
// Store connectionId and streamId
|
// Store connectionId and streamId
|
||||||
String response = user.getDriver().findElement(By.id("api-response-text-area")).getAttribute("value");
|
String response = user.getDriver().findElement(By.id("api-response-text-area")).getAttribute("value");
|
||||||
JsonObject json = JsonParser.parseString(response.split("%")[1]).getAsJsonArray().get(0).getAsJsonObject();
|
response = response.replace("Session info fetched {", "{").replace("}. Changes: true", "}");
|
||||||
String connectionId = json.keySet().iterator().next();
|
JsonObject jsonConnection = JsonParser.parseString(response).getAsJsonObject().get("activeConnections")
|
||||||
String streamId = json.get(connectionId).getAsJsonArray().get(0).getAsJsonObject().get("streamId")
|
.getAsJsonArray().get(0).getAsJsonObject();
|
||||||
|
String connectionId = jsonConnection.get("connectionId").getAsString();
|
||||||
|
String streamId = jsonConnection.get("publishers").getAsJsonArray().get(0).getAsJsonObject().get("streamId")
|
||||||
.getAsString();
|
.getAsString();
|
||||||
|
|
||||||
// Fetch all sessions (no change)
|
// Fetch all sessions (no change)
|
||||||
|
|
|
@ -141,17 +141,27 @@ export class SessionApiDialogComponent {
|
||||||
this.session.fetch()
|
this.session.fetch()
|
||||||
.then(anyChange => {
|
.then(anyChange => {
|
||||||
const resp = {
|
const resp = {
|
||||||
activeConnections: [],
|
activeConnections: <any>[],
|
||||||
sessionId: this.session.sessionId,
|
sessionId: this.session.sessionId,
|
||||||
createdAt: this.session.createdAt,
|
createdAt: this.session.createdAt,
|
||||||
properties: this.session.properties,
|
properties: this.session.properties,
|
||||||
recording: this.session.recording
|
recording: this.session.recording
|
||||||
};
|
};
|
||||||
this.session.activeConnections.forEach(con => {
|
this.session.activeConnections.forEach(con => {
|
||||||
resp.activeConnections[con.connectionId] = [];
|
const publishers = <any>[];
|
||||||
con.publishers.forEach(pub => {
|
con.publishers.forEach(pub => {
|
||||||
resp.activeConnections[con.connectionId].push(pub);
|
publishers.push(pub);
|
||||||
});
|
});
|
||||||
|
resp.activeConnections.push({
|
||||||
|
connectionId: con.connectionId,
|
||||||
|
activeAt: con.activeAt,
|
||||||
|
clientData: con.clientData,
|
||||||
|
createdAt: con.createdAt,
|
||||||
|
ip: con.ip,
|
||||||
|
platform: con.platform,
|
||||||
|
status: con.status,
|
||||||
|
publishers
|
||||||
|
})
|
||||||
});
|
});
|
||||||
this.response = 'Session info fetched ' + JSON.stringify(resp) + '. Changes: ' + anyChange;
|
this.response = 'Session info fetched ' + JSON.stringify(resp) + '. Changes: ' + anyChange;
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in New Issue