Migriert die weiterhin benötigten Zeitaufgaben einschließlich SOAP-Importen, Betriebsstatus und Wiederanlaufkontrolle. Aktiviert 115 native Spring-Tasks im Docker-Image ohne Cron-Daemon oder PHP und dokumentiert die entfallenen HHA-Aufrufe. Ergänzt PHP-/UI-Testwerkzeuge und aktualisiert den Projektstand auf Version 0.2.0.
71 lines
4.3 KiB
TypeScript
71 lines
4.3 KiB
TypeScript
import { expect, type Page } from '@playwright/test';
|
|
|
|
export async function openOrder(start: Page): Promise<Page> {
|
|
await start.goto('/admin/start.php');
|
|
await start.locator('#auftraege a').click();
|
|
const popup = start.waitForEvent('popup');
|
|
await start.locator('#erfassung a').click();
|
|
const order = await popup;
|
|
await order.waitForLoadState('load');
|
|
await expect(order).toHaveTitle('AUFTRAGSERFASSUNG');
|
|
await expect(order.frameLocator('frame[name="job_tour"]').locator('[name="von_cs_comp"]')).toBeVisible();
|
|
await expect(order.frameLocator('frame[name="job_options"]').locator('[name="toursubmit"]')).toBeVisible();
|
|
await expect(order.frameLocator('frame[name="job_tour"]').locator('[name="nameOfPayer"]')).toHaveValue(/Bezahler wählen/);
|
|
await expect(order.frameLocator('frame[name="job_tour_list"]').getByText('Tourendaten (Etappen)', { exact: true })).toBeVisible();
|
|
await expect.poll(() => order.frame({ name: 'job_options' })!.evaluate(() => (window as any).isCurrentlySubmitting)).toBe(false);
|
|
return order;
|
|
}
|
|
|
|
export function fields(order: Page) {
|
|
return {
|
|
tour: order.frameLocator('frame[name="job_tour"]'),
|
|
options: order.frameLocator('frame[name="job_options"]'),
|
|
list: order.frameLocator('frame[name="job_tour_list"]'),
|
|
};
|
|
}
|
|
|
|
/** Select an existing, explicitly named test cost centre through the real customer picker. */
|
|
export async function selectTestCustomer(order: Page, button: string, name: 'Testkunde Assecutor 1' | 'Testkunde Assecutor 2') {
|
|
const popup = order.waitForEvent('popup', { predicate: candidate => candidate.url().includes('/admin/cs_csc_list.php') });
|
|
await fields(order).tour.locator(`[name="${button}"]`).click();
|
|
const search = await popup;
|
|
await search.locator('[name="f_cmp_comp"]').fill(name);
|
|
await Promise.all([
|
|
search.waitForNavigation({waitUntil:'domcontentloaded'}),
|
|
search.getByRole('link', {name:'Suchen',exact:true}).first().click(),
|
|
]);
|
|
const match = search.locator('a[href^="javascript:finishPage("]');
|
|
await expect(match).toHaveCount(1);
|
|
const href = await match.getAttribute('href');
|
|
expect(href).toContain(name);
|
|
const expectedCentre = name.endsWith('1') ? '878914' : '878915';
|
|
expect(href).toMatch(new RegExp(`finishPage\\('\\d+','${expectedCentre}'`));
|
|
await Promise.all([search.waitForEvent('close'), match.click()]);
|
|
await expect.poll(() => order.frame({ name: 'job_options' })!.evaluate(() => (window as any).isCurrentlySubmitting)).toBe(false);
|
|
}
|
|
|
|
export async function fillTestOrder(order: Page, marker: string) {
|
|
await selectTestCustomer(order, 'vonFirmaButton', 'Testkunde Assecutor 1');
|
|
await selectTestCustomer(order, 'nachFirmaButton', 'Testkunde Assecutor 2');
|
|
await selectTestCustomer(order, 'bezahlerFirmaButton', 'Testkunde Assecutor 1');
|
|
const {tour,options}=fields(order);
|
|
await expect(tour.locator('[name="nameOfPayer"]')).toHaveValue('Testkunde Assecutor 1');
|
|
await tour.locator('[name="jb_orderer"]').fill(marker);
|
|
await tour.locator('[name="von_tr_remark"]').fill(marker + ' - automatischer Test, NICHT AUSFÜHREN');
|
|
await tour.locator('[name="nach_tr_remark"]').fill(marker + ' - keine echte Beförderung');
|
|
await options.locator('[name="jb_fixprice"]').fill('10,00');
|
|
await options.locator('[name="jb_fixprice"]').press('Tab');
|
|
await options.locator('[name="jb_markup"]').fill('0');
|
|
await options.locator('[name="jb_markup"]').press('Tab');
|
|
await options.locator('[name="jb_status_manual"]').check();
|
|
await options.locator('[name="jb_incomplete"]').check();
|
|
await expect(options.locator('[name="cr_id_order"]')).toHaveValue('');
|
|
await expect(options.locator('[name="jb_globaljob"]')).not.toBeChecked();
|
|
await expect(options.locator('[name="jb_insurance"]')).not.toBeChecked();
|
|
await expect(options.locator('[name="jb_offer"]')).not.toBeChecked();
|
|
await expect(options.locator('[name="afterwards"]')).not.toBeChecked();
|
|
await expect(options.locator('[name="jb_multi_factor"]')).toHaveValue('1');
|
|
await expect(options.locator('[name="toursubmit"]')).toBeEnabled();
|
|
await expect.poll(() => order.frame({ name: 'job_options' })!.evaluate(() => ({ busy: (window as any).isCurrentlySubmitting, alert: (window as any).alertIsOpen })), { timeout: 35_000, message: 'Preisberechnung ist vor dem Absenden abgeschlossen' }).toEqual({ busy: false, alert: false });
|
|
}
|