EnergyVenom's picture
Patchwise Agent Studio: Oracle AI Agent Studio cycles
af1bee9 verified
Raw History Blame Contribute Delete
1.04 kB
import { Page } from '@playwright/test';
import { P2MUi } from '../p2m/ui';
import { NAV, FIELD, BUTTON } from './labels';
/** Page actions for the MOCK PPM pack (same locator policy as the other packs). Every label comes from ./labels.ts. */
export class PPMUi extends P2MUi {
constructor(page: Page) { super(page); }
async ppmNav(key: keyof typeof NAV) { await this.go(NAV[key]); }
textbox(name: string) { return this.page.getByRole('textbox', { name, exact: true }); }
combo(name: string) { return this.page.getByRole('combobox', { name, exact: true }); }
/** Fill a search textbox (Project / Adjustment / Invoice) and press the Search button of that same form. */
async searchField(field: string, value: string) {
const box = this.textbox(field); await box.fill(value);
await this.page.getByRole('search', { name: field, exact: true }).getByRole('button', { name: BUTTON.search, exact: true }).click();
}
async projectSearch(project: string) { await this.searchField(FIELD.project, project); }
}