25 lines
654 B
JavaScript
25 lines
654 B
JavaScript
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();
|
|
});
|