1

I want to run the same test for some urls (1000+) and I want to be the quickest as possible. I loop the test for each url, but when the number of urls exceeds 10, it will cause a timeout error. I guess this may be because each test is ran sequentially, do we have a way to run test in parallel?

const queries = getQueries();

for (let i=0; i < queries.length; i++){
    test.describe('LinkBroken'+ i.toString(), () => {
        test(queries[i].split('\t')[2], async ({ page }, testInfo) => {

            const url = getUrl(queries[i])
            await page.goto(url);
        
            const locators = page.locator('#b_content').locator('a:visible');
            const locator_count = await locators.count()
        
            for (let i=0; i <locator_count; i++){
                const link = locators.nth(i);
                await link.highlight();
                await link.click({trial:true});
            }
        });
    })
}

I tried to set playwright config as below, but it still doesn't work with fullyParallel: true and workers: 10.

1 Answer 1

0

According to the playwright documentation you should add this line before test logic.

test.describe.configure({ mode: 'parallel' });

More information here

Also you may need to extend your timeout in playwright.config.ts file due to default limit for one test is 30sec.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.