Skip to content

Commit

Permalink
fixed pages not working in electron
Browse files Browse the repository at this point in the history
Signed-off-by: Vincent T <vtaylor@microsoft.com>
  • Loading branch information
vyncent-t committed Aug 6, 2024
1 parent 5152204 commit bd2077e
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 29 deletions.
30 changes: 1 addition & 29 deletions app/app-e2e-tests/e2e/example.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { expect, Page, test } from '@playwright/test';
import { expect, test } from '@playwright/test';
import { _electron } from '@playwright/test';
import { spawn } from 'child_process';

Expand Down Expand Up @@ -88,34 +88,6 @@ test('launch app', async () => {
// await window.click('text=Click me');
});

class HeadlampPage {
constructor(private page: Page) {}

async homepage() {
await this.page.goto('http://localhost:3000/');
await this.page.waitForLoadState('domcontentloaded');
await this.page.waitForSelector('button');
await this.page.click('button');
}
}

test('launch app w/page', async () => {
// Launch Electron app.
const electronApp = await electron.launch({
cwd: '/home/vtaylor/headlamp/app/electron',
timeout: 0,
args: ['main.js'],
});

// const context = await electronApp.context();
const page = await electronApp.firstWindow();
const headlampPage = new HeadlampPage(page);

electronApp.on('window', async () => {
await headlampPage.homepage();
});
});

test('launch app with integrated shell commands', async () => {
// Start the frontend server
await runCommand('npm', ['start'], { cwd: '/home/vtaylor/headlamp/frontend' });
Expand Down
Empty file.
Empty file.

0 comments on commit bd2077e

Please sign in to comment.