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
|
||||
String response = user.getDriver().findElement(By.id("api-response-text-area")).getAttribute("value");
|
||||
JsonObject json = JsonParser.parseString(response.split("%")[1]).getAsJsonArray().get(0).getAsJsonObject();
|
||||
String connectionId = json.keySet().iterator().next();
|
||||
String streamId = json.get(connectionId).getAsJsonArray().get(0).getAsJsonObject().get("streamId")
|
||||
response = response.replace("Session info fetched {", "{").replace("}. Changes: true", "}");
|
||||
JsonObject jsonConnection = JsonParser.parseString(response).getAsJsonObject().get("activeConnections")
|
||||
.getAsJsonArray().get(0).getAsJsonObject();
|
||||
String connectionId = jsonConnection.get("connectionId").getAsString();
|
||||
String streamId = jsonConnection.get("publishers").getAsJsonArray().get(0).getAsJsonObject().get("streamId")
|
||||
.getAsString();
|
||||
|
||||
// Fetch all sessions (no change)
|
||||
|
|
|
@ -141,17 +141,27 @@ export class SessionApiDialogComponent {
|
|||
this.session.fetch()
|
||||
.then(anyChange => {
|
||||
const resp = {
|
||||
activeConnections: [],
|
||||
activeConnections: <any>[],
|
||||
sessionId: this.session.sessionId,
|
||||
createdAt: this.session.createdAt,
|
||||
properties: this.session.properties,
|
||||
recording: this.session.recording
|
||||
};
|
||||
this.session.activeConnections.forEach(con => {
|
||||
resp.activeConnections[con.connectionId] = [];
|
||||
const publishers = <any>[];
|
||||
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;
|
||||
})
|
||||
|
|
Loading…
Reference in New Issue