import { test, expect, Page } from '@playwright/test';
import { strictEqual } from 'assert';

let page: Page;

test.beforeAll(async ({ browser }) => {
  page = await browser.newPage();
});

test.afterAll(async () => {
  if (page !== undefined) {
    await page.close();
  }
});

test('Login', async () => {
  // Login
  await page.goto('http://192.168.1.90:20001/');
  await expect(page).toHaveTitle(/^Sign in to /);
  await page.fill("input[name='username']", 'admin');
  await page.fill("input[name='password']", '1234');
  await page.click('id=kc-login');
  await page.waitForTimeout(2000);
  //   await page.click('id=acceptBtn');
});

test('Selete Filter Employee Active', async () => {
  await page.click('id=menu-icon-customer-management');
  await page.click('id=tab-employee');
  await page.fill('id=input-search', 'ปองพล กันธะณะ');
  await page.waitForTimeout(2000);
  await page.fill('id=input-search', 'ปองพล');
  await page.waitForTimeout(2000);
  await page.fill('id=input-search', 'กันธะณะ');
  await page.waitForTimeout(2000);
  await page.fill('id=input-search', 'ไทย');
  await page.waitForTimeout(2000);
  await page.fill('id=input-search', '6282282246226');
  await page.waitForTimeout(2000);
  await page.fill('id=input-search', 'TH2862242226262');
  await page.waitForTimeout(2000);
  await page.fill('id=input-search', 'บางรัก');
  await page.waitForTimeout(2000);
});
