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';

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

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));
  },
});

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