MCPcopy
hub / github.com/brimdata/zui / init

Method init

packages/zui-player/helpers/test-app.ts:30–69  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

28 }
29
30 async init() {
31 const userDataDir = path.resolve(
32 path.join(itestDir(), this.name, (this.testNdx++).toString())
33 );
34 this.currentDataDir = userDataDir;
35 const { bin, entry } = getAppInfo();
36 const launchOpts = {
37 args: [`--user-data-dir=${userDataDir}`, entry],
38 bypassCSP: true,
39 timeout: 10000,
40 } as any;
41
42 if (process.env.VIDEO == 'true') {
43 launchOpts.recordVideo = { dir: path.join('run', 'videos') };
44 }
45
46 // @ts-ignore
47 if (bin) launchOpts.executablePath = bin;
48 this.zui = await electron.launch(launchOpts);
49
50 // Pipe the stdout from the electron process into the test runner process
51 if (process.env['VERBOSE']) {
52 this.zui.process().stdout.pipe(process.stdout);
53 }
54
55 await waitForTrue(() => this.zui.windows().length === 2);
56 await waitForTrue(async () => !!(await this.getWindowByTitle('Zui')));
57 await waitForTrue(
58 async () => !!(await this.getWindowByTitle('Background'))
59 );
60 this.mainWin = await this.getWindowByTitle('Zui');
61
62 const debug = false;
63 if (debug) {
64 this.mainWin.on('console', console.log);
65 this.zui.process().stdout.on('data', (data) => {
66 console.log(data.toString());
67 });
68 }
69 }
70
71 async dropFile(file: string) {
72 await this.mainWin.evaluate((file) => {

Callers 11

playFunction · 0.95
queries.spec.tsFile · 0.45
histogram.spec.tsFile · 0.45
ingest.spec.tsFile · 0.45
zed-events.spec.tsFile · 0.45
export.spec.tsFile · 0.45
table.spec.tsFile · 0.45

Calls 7

getWindowByTitleMethod · 0.95
itestDirFunction · 0.90
getAppInfoFunction · 0.85
waitForTrueFunction · 0.85
resolveMethod · 0.65
toStringMethod · 0.65
onMethod · 0.45

Tested by

no test coverage detected