drawer.spec.ts 782 B

12345678910111213141516171819
  1. import { test, expect } from '@playwright/test';
  2. import Homepage from '@/tests/POM/home-page';
  3. test.beforeEach(async ({ page }) => {
  4. await page.goto('/');
  5. });
  6. test('Settings drawer icon should open the drawer when clicked', async ({ page, context }) => {
  7. const homepage = new Homepage(page, context);
  8. // 1. Make sure the theme section is not visible
  9. await expect(page.locator('button:has-text("Light")')).not.toBeVisible();
  10. // 2. Click the settings drawer trigger
  11. await homepage.openSettingsDrawer();
  12. // 3. Make sure the theme section is visible
  13. await expect(page.locator('button:has-text("Light")')).toBeVisible();
  14. await expect(page.locator('button:has-text("Sepia")')).toBeVisible();
  15. await expect(page.locator('button:has-text("Dark")')).toBeVisible();
  16. });