Fixing e2e tests.

Broken e2e test due to changing the way files are uploaded. This should
fix it.

Test: npm run test:e2e
Bug: b/241571689
Change-Id: I74c8d489ecf4c0627d844505037f886d1f183b72
This commit is contained in:
Priyanka Patel
2022-08-12 09:54:06 +00:00
parent 9697901bb3
commit 864e448436
3 changed files with 15 additions and 1 deletions

View File

@@ -20,6 +20,7 @@ import {PersistentStore} from "common/persistent_store";
import {ViewerWindowManagerComponent} from "viewers/viewer_window_manager/viewer_window_manager.component";
import {Core} from "./core";
import {ProxyState, proxyClient} from "trace_collection/proxy_client";
import { Viewer } from "viewers/viewer";
@Component({
selector: "app-root",
@@ -77,6 +78,7 @@ export class AppComponent {
onDataLoadedChange(dataLoaded: boolean) {
if (dataLoaded && !this.viewersCreated) {
this.core.createViewers();
this.createViewerElements();
const dummyTimestamp = this.core.getTimestamps()[1]; //TODO: get timestamp from time scrub
this.core.notifyCurrentTimestamp(dummyTimestamp);
this.viewersCreated = true;
@@ -84,6 +86,15 @@ export class AppComponent {
}
}
createViewerElements() {
const viewersDiv = document.querySelector("div#viewers")!;
viewersDiv.innerHTML = "";
this.core.getViews().forEach((view: HTMLElement) => {
viewersDiv.appendChild(view);
});
}
public notifyCurrentTimestamp() {
const dummyTimestamp = new Timestamp(TimestampType.ELAPSED, 1000000n);
this.core.notifyCurrentTimestamp(dummyTimestamp);

View File

@@ -46,7 +46,7 @@ import { LoadedTrace } from "app/loaded_trace";
Choose File
</button>
<div *ngIf="this.loadedTraces.length > 0">
<button mat-raised-button (click)="onLoadData()">Load Data</button>
<button mat-raised-button class="load-btn" (click)="onLoadData()">Load Data</button>
<button mat-raised-button (click)="onClearData()">Clear All</button>
</div>
</div>

View File

@@ -26,6 +26,9 @@ describe("Viewer WindowManager", () => {
const inputFile = element(by.css("input[type=\"file\"]"));
inputFile.sendKeys(E2eTestUtils.getFixturePath("traces/elapsed_and_real_timestamp/WindowManager.pb"));
const loadData = element(by.css(".load-btn"));
loadData.click();
const windowManagerViewerTitle = element(by.css(".viewer-window-manager .title"));
expect(windowManagerViewerTitle.getText()).toContain("Window Manager");
});