debian-image-builder-frontend/playwright/helpers/navHelpers.ts
Tom Koscielniak 0bddb80e94 tests/playwright: Add Hostname customization test
Adds a Hostname customization test that creates a BP, edits BP, exports and imports it back and verifies the BP content.
This test also servers as a template for other customization tests. Includes a refactor of existing helper functions.
2025-04-15 14:14:40 +02:00

26 lines
881 B
TypeScript

import type { FrameLocator, Page } from '@playwright/test';
import { isHosted } from './helpers';
/**
* Opens the wizard, fills out the "Image Output" step, and navigates to the optional steps
* @param page - the page object
*/
export const navigateToOptionalSteps = async (page: Page | FrameLocator) => {
await page.getByRole('button', { name: 'Create blueprint' }).click();
await page.getByRole('checkbox', { name: 'Virtualization' }).click();
await page.getByRole('button', { name: 'Next' }).click();
};
/**
* Returns the FrameLocator object in case we are using cockpit plugin, else it returns the page object
* @param page - the page object
*/
export const ibFrame = (page: Page): FrameLocator | Page => {
if (isHosted()) {
return page;
}
return page
.locator('iframe[name="cockpit1\\:localhost\\/cockpit-image-builder"]')
.contentFrame();
};