Quantcast
Channel: Active questions tagged svelte - Stack Overflow
Viewing all articles
Browse latest Browse all 1882

Timeout error on mounting Svelte components in Playwright

$
0
0

I am trying to use Playwright for component testing.this is my test code:

import { test, expect } from '@playwright/experimental-ct-svelte';import Button from '../Button.svelte';test('renders with default label', async ({ mount }) => {const component = await mount(Button as any, {    props: {         variant: 'primary',        label: 'Button',        ariaLabel: 'Primary Button',        isDisabled: false,        size: 'small',    }  });  //await expect(component.locator('Button')).toHaveText('Button');});

But playwright throws the below error.

Test timeout of 30000ms exceeded.Error: page._wrapApiCall: Test timeout of 30000ms exceeded.   5 |   6 | test('renders with default label', async ({ mount }) => {>  7 | const component = await mount(Button as any, {     |                         ^   8 |     props: {   9 |                 variant: 'primary',  10 |                 label: 'Button',    at mount (C:\Users\xxxx\xxxxx\node_modules\@playwright\experimental-ct-core\lib\mount.js:43:35)    at C:\Users\xxxx\xxxxxx\src\lib\atoms\button\tests\primaryButton.spec.ts:7:25`

How can i get the components mounted?


Viewing all articles
Browse latest Browse all 1882

Trending Articles