Rayrun
โ† Back to Discord Forum

Test passes in headed mode but fails on headless

codewiz_123posted in #help-playwright
Open in Discord

This test passes in headed mode but not in headless mode. Why is this?

it.only('should sequence numbers on the second page', async ({ page }) => {
            await nextPage.click();
            await page.waitForTimeout(500);
            const el1 = page.getByRole('cell').filter({ hasText: '14' }); // using 14 because 13 is also used in dob
            const el2 = page.getByRole('cell').filter({ hasText: '25' }); // last row on page
                                                     
            expect(el1).toBeVisible();               
            expect(el2).toBeVisible();               
          });

This thread is trying to answer question "Why does this test pass in headed mode but not in headless mode?"

3 replies

should be guessing failure reason? ๐Ÿ˜ƒ

you are missing awaits in asserts

that's got to be it, thanks

Related Discord Threads

TwitterGitHubLinkedIn
AboutQuestionsDiscord ForumBrowser ExtensionTagsQA Jobs

Rayrun is a community for QA engineers. I am constantly looking for new ways to add value to people learning Playwright and other browser automation frameworks. If you have feedback, email luc@ray.run.