/ tests / specs / app.spec.ts
app.spec.ts
 1  import { test, expect, beforeAll, afterAll } from '../fixtures.mts'
 2  
 3  test.beforeAll(beforeAll)
 4  test.afterAll(afterAll)
 5  
 6  test('Document element check', async ({ page, util }) => {
 7    try {
 8      await expect(
 9        page.getByTestId('main-menu').first(),
10        `Confirm main logo is visible`
11      ).toBeVisible()
12      await expect(
13        page.getByTestId('select-language').first(),
14        `Confirm language selector is visible`
15      ).toBeVisible()
16  
17      await util.captureScreenshot(page, 'result')
18    } catch (error) {
19      throw await util.onTestError(error)
20    }
21  })
22  
23  test('Counter button click check', async ({ page, util }) => {
24    try {
25      await page.getByTestId('btn-menu-mcp').click({ clickCount: 2, delay: 50 })
26  
27      await page.getByTestId('btn-menu-chat').click({ clickCount: 2, delay: 50 })
28  
29      await page.getByTestId('btn-menu-setting').click({ clickCount: 2, delay: 50 })
30  
31      // const counterValueElement = await page
32      //   .getByTestId('counter-badge')
33      //   .getByRole('status')
34      //   .innerHTML()
35  
36      // expect(counterValueElement).toBe('10')
37    } catch (error) {
38      throw await util.onTestError(error)
39    }
40  })