Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Question] When running two or more browser instance for running test cases, all the test cases fails with in Docker #2624

Closed
raju-singh opened this issue Jun 18, 2020 · 1 comment

Comments

@raju-singh
Copy link

When running two or more browser instance for running test cases, all the test cases fails with timeout error inside docker container

@mxschmitt
Copy link
Member

Could you give us more insights into your environment? Which browser, Playwright version, testing setup and which Docker file would be really helpful. If possible, also a small reproducible in a repository.

I tried this one in the official Docker image, which works:

// @ts-check
const playwright = require("playwright");

const createPages = async (browserType) => {
  /** @type {import('playwright').Browser} */
  const browser = await playwright[browserType].launch();
  const page1 = await browser.newPage();
  await page1.goto("https://try.playwright.tech")
  await page1.screenshot({ path: `example-${browserType}-1.png` });

  const page2 = await browser.newPage();
  await page2.goto("https://google.com")
  await page2.screenshot({ path: `example-${browserType}-2.png` });
  return browser
}

(async () => {
  for (const browserType of ['chromium', 'webkit', 'firefox']) {
    const browser1 = await createPages(browserType)
    const browser2 = await createPages(browserType)

    await browser1.close();
    await browser2.close();
  }
})();

Here also interactively (only multiple pages), which is based on the official Docker image.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants