28 lines
730 B
JavaScript
28 lines
730 B
JavaScript
const { test, expect, _electron: electron } = require("@playwright/test");
|
|
const path = require("path");
|
|
|
|
test("Dialog öffnen & schließen", async () => {
|
|
const app = await electron.launch({
|
|
args: [path.join(__dirname, "../main.js")]
|
|
});
|
|
|
|
const win = await app.firstWindow();
|
|
|
|
// Home-Button sicherheitshalber klicken
|
|
await win.click('button:has-text("Home")');
|
|
|
|
// Dialog öffnen
|
|
await win.click('button:has-text("Dialog öffnen")');
|
|
|
|
// Dialog sichtbar
|
|
await expect(win.locator('text=Beispiel-Dialog')).toBeVisible();
|
|
|
|
// OK Button
|
|
await win.click('button:has-text("OK")');
|
|
|
|
// Dialog sollte verschwinden
|
|
await expect(win.locator('text=Beispiel-Dialog')).toHaveCount(0);
|
|
|
|
await app.close();
|
|
});
|