import { test as base } from '@playwright/test';
import { AdminLoginPage } from '../pages/admin/login.page';
import { DashboardPage } from '../pages/admin/dashboard.page';
import { UserManagementPage } from '../pages/admin/user-management.page';
import { DisabilityPersonManagementPage } from '../pages/admin/disability-person.page';

type Fixtures = {
  adminLoginPage: AdminLoginPage;
  dashboardPage: DashboardPage;
  userManagementPage: UserManagementPage;
  disabilityPersonPage: DisabilityPersonManagementPage;
};

export const test = base.extend<Fixtures>({
  adminLoginPage: async ({ page }, use) => {
    await use(new AdminLoginPage(page));
  },
  dashboardPage: async ({ page }, use) => {
    await use(new DashboardPage(page));
  },
  userManagementPage: async ({ page }, use) => {
    await use(new UserManagementPage(page));
  },
  disabilityPersonPage: async ({ page }, use) => {
    await use(new DisabilityPersonManagementPage(page));
  },
});

export { expect } from '@playwright/test';
