mirror of https://github.com/OpenVidu/openvidu.git
openvidu-test-e2e and openvidu-testapp: fix openviduSdkFetchTest
parent
09b3bbda62
commit
166ab0ba83
|
@ -4407,7 +4407,7 @@ public class OpenViduTestAppE2eTest extends AbstractOpenViduTestappE2eTest {
|
|||
// Java SDK should return false as the recording has been stopped with it
|
||||
Assert.assertFalse("Java fetch should be false", session.fetch());
|
||||
Assert.assertFalse("Java fetch should be false", OV.fetch());
|
||||
// Node SDK should return true as it doesn't know about the recording stooped
|
||||
// Node SDK should return true as it doesn't know about the recording stopped
|
||||
checkNodeFetchChanged(user, false, true);
|
||||
checkNodeFetchChanged(user, false, false);
|
||||
checkNodeFetchChanged(user, true, false);
|
||||
|
@ -4538,6 +4538,10 @@ public class OpenViduTestAppE2eTest extends AbstractOpenViduTestappE2eTest {
|
|||
}
|
||||
|
||||
private void checkNodeFetchChanged(OpenViduTestappUser user, boolean global, boolean hasChanged) {
|
||||
final String textAreaId = "api-response-text-area";
|
||||
By textAreaLocator = By.id(textAreaId);
|
||||
user.getDriver().findElement(By.id("clear-response-text-area-btn")).click();
|
||||
user.getWaiter().until(ExpectedConditions.attributeToBe(textAreaLocator, "value", ""));
|
||||
user.getDriver().findElement(By.id(global ? "list-sessions-btn" : "get-session-btn")).click();
|
||||
user.getWaiter().until(new NodeFetchHasChanged(hasChanged));
|
||||
}
|
||||
|
|
|
@ -33,3 +33,9 @@ mat-dialog-content button {
|
|||
margin-left: 9px;
|
||||
width: 30%;
|
||||
}
|
||||
|
||||
#clear-response-text-area-btn {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 0;
|
||||
}
|
||||
|
|
|
@ -65,8 +65,9 @@
|
|||
<button mat-button id="delete-recording-btn" (click)="deleteRecording()" [disabled]="!recordingId">Delete
|
||||
recording</button>
|
||||
</div>
|
||||
<mat-form-field *ngIf="!!response" id="response-text-area" appearance="fill">
|
||||
<mat-form-field id="response-text-area" appearance="fill">
|
||||
<textarea id="api-response-text-area" [(ngModel)]="response" matInput readonly></textarea>
|
||||
<button mat-button id="clear-response-text-area-btn" (click)="response=''">Clear</button>
|
||||
</mat-form-field>
|
||||
</mat-dialog-content>
|
||||
<mat-dialog-actions>
|
||||
|
|
|
@ -140,14 +140,20 @@ export class SessionApiDialogComponent {
|
|||
}
|
||||
this.session.fetch()
|
||||
.then(anyChange => {
|
||||
const resp = {};
|
||||
const resp = {
|
||||
activeConnections: [],
|
||||
sessionId: this.session.sessionId,
|
||||
createdAt: this.session.createdAt,
|
||||
properties: this.session.properties,
|
||||
recording: this.session.recording
|
||||
};
|
||||
this.session.activeConnections.forEach(con => {
|
||||
resp[con.connectionId] = [];
|
||||
resp.activeConnections[con.connectionId] = [];
|
||||
con.publishers.forEach(pub => {
|
||||
resp[con.connectionId].push(pub);
|
||||
resp.activeConnections[con.connectionId].push(pub);
|
||||
});
|
||||
});
|
||||
this.response = 'Session info fetched %[' + JSON.stringify(resp) + ']%. Changes: ' + anyChange;
|
||||
this.response = 'Session info fetched ' + JSON.stringify(resp) + '. Changes: ' + anyChange;
|
||||
})
|
||||
.catch(error => {
|
||||
this.response = 'Error [' + error.message + ']';
|
||||
|
|
Loading…
Reference in New Issue