All files / src/tests perf.spec.ts

0% Statements 0/16
0% Branches 0/2
0% Functions 0/4
0% Lines 0/16

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31                                                             
import { expect, test } from '@playwright/test'
 
import { getGraphView, takeBeforeEach } from './helper'
 
const skipWebkitMessage = [
  'WebKit has problems running Angular apps with a lot of elements',
  '(at least in WSL2 environment)'
].join(' ')
 
test.describe('Perf', () => {
  test.beforeEach(({ browserName }) => {
    const shouldSkip = browserName === 'webkit' && String(process.env.APP).startsWith('angular')
 
    test.skip(shouldSkip, skipWebkitMessage)
  })
  const { getContainer } = takeBeforeEach('?template=perf&rows=10&cols=10', 500, 500)
 
  test('has nodes', async ({ page }) => {
    const { nodes, connections } = await getGraphView(getContainer())
 
    await page.waitForTimeout(3000)
    expect(await nodes()).toHaveLength(100)
    expect(await connections()).toHaveLength(99)
  })
 
  test('snapshot', async ({ page }) => {
    await page.waitForTimeout(3000)
    expect(await page.screenshot()).toMatchSnapshot('perf.png')
  })
})