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:
@@ -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);
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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");
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user