Abgabe Max Kupper
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
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();
|
||||
});
|
||||
@@ -0,0 +1,24 @@
|
||||
const { test, expect, _electron: electron } = require("@playwright/test");
|
||||
const path = require("path");
|
||||
|
||||
test("Dropdown Auswahl", async () => {
|
||||
const app = await electron.launch({
|
||||
args: [path.join(__dirname, "../main.js")]
|
||||
});
|
||||
|
||||
const win = await app.firstWindow();
|
||||
const page = win.page();
|
||||
|
||||
// Dropdown öffnen
|
||||
// await win.click('id=dialog-example');
|
||||
await page.getByTestId('dropdown-example').click();
|
||||
|
||||
// Option 2 wählen
|
||||
await win.click('div[role="option"]:has-text("Option 2")');
|
||||
|
||||
// Prüfen ob ausgewählt
|
||||
const text = await win.innerText(".ms-Dropdown-title");
|
||||
expect(text).toBe("Option 2");
|
||||
|
||||
await app.close();
|
||||
});
|
||||
@@ -0,0 +1,16 @@
|
||||
const { test, expect, _electron: electron } = require('@playwright/test');
|
||||
const path = require("path");
|
||||
|
||||
test("Electron startet und zeigt Fenster", async () => {
|
||||
const electronApp = await electron.launch({
|
||||
args: [path.join(__dirname, "../main.js")]
|
||||
});
|
||||
|
||||
const window = await electronApp.firstWindow();
|
||||
|
||||
// Titel prüfen
|
||||
const title = await window.title();
|
||||
expect(title).not.toBe(""); // oder dein eigener Titel
|
||||
|
||||
await electronApp.close();
|
||||
});
|
||||
@@ -0,0 +1,21 @@
|
||||
const { test, expect, _electron: electron } = require("@playwright/test");
|
||||
const path = require("path");
|
||||
|
||||
test("Navigation: Home → Settings", async () => {
|
||||
const app = await electron.launch({
|
||||
args: [path.join(__dirname, "../main.js")]
|
||||
});
|
||||
|
||||
const win = await app.firstWindow();
|
||||
|
||||
// Auf Settings klicken
|
||||
await win.click('button:has-text("Settings")');
|
||||
|
||||
// Prüfen dass der Settings-Header sichtbar ist
|
||||
await expect(win.locator("id=settings-title")).toBeVisible();
|
||||
|
||||
// Auf Settings klicken
|
||||
await win.click('button:has-text("home")');
|
||||
|
||||
await app.close();
|
||||
});
|
||||
Reference in New Issue
Block a user