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

Playwright not waiting for elements to be visible

$
0
0

I'm trying to write a "hello world" test using Playwright to start testing my Svelte app. The app shows a loading screen for about two seconds, then shows the app itself, which shows some data in a table. I want to simply detect that there is a table on the screen.

To get past the loading screen, I'm using the waitFor() method, but it keeps timing out after about two seconds no matter what I put for the timeout value in the Playwright config. I even put it to 100000ms and it still times out after about two seconds (same amount of time as the loading screen is on the screen). The error that appears is that the 100000ms timeout has been exceeded, which obviously isn't true. I even tried the page.slow() option, but then it just says I've exceeded the 300000ms timeout.

Here's the test I'm trying to get to work. Any help would be hugely appreciated.

test('The table is present after the loading screen disappears', async ({page}) => {    await page.goto('localhost:3000');    const tbl = await page.locator('table');    await tbl.waitFor();    await expect(tbl.count()).toBeGreaterThan(0);});

Here's what the relevant part of my playwright.config.ts look like:

export default defineConfig({  testDir: './e2e',  /* Maximum time one test can run for. */  timeout: 100 * 1000,  expect: {    /**     * Maximum time expect() should wait for the condition to be met.     * For example in `await expect(locator).toHaveText();`     */    timeout: 500000000  },

Here's the error:enter image description here


Viewing all articles
Browse latest Browse all 1541

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>