microsoft / playwright-test

Build a cross-browser end-to-end test suite with Playwright.
https://playwright.dev
Apache License 2.0
777 stars 34 forks source link

Running basic test throws "Host system is missing dependencies" #181

Closed Waterstraal closed 4 years ago

Waterstraal commented 4 years ago

I followed the get started and have the following files:

foo.spec.ts

import { it, expect } from '@playwright/test';

it('is a basic test with the page', async ({ page }) => {
  await page.goto('https://playwright.dev/');
  const name = await page.innerText('.home-navigation');
  expect(name).toBe('🎭 Playwright');
});

package.json

{
  "name": "e2e-playwright",
  "version": "1.0.0",
  "scripts": {
    "test": "npx folio --param screenshotOnFailure"
  },
  "devDependencies": {
    "@playwright/test": "^0.152.0"
  }
}

Running npm run test throws the following error:

> npx folio --param screenshotOnFailure

Running 3 tests using 3 workers
  1) foo.spec.ts:3:1 › is a basic test with the page ===============================================
     browserName=firefox, headful=false, slowMo=0, video=false, screenshotOnFailure=true

    browserType.launch: Host system is missing dependencies!

    Full list of missing libraries:
        vcruntime140_1.dll

    Note: use DEBUG=pw:api environment variable and rerun to capture Playwright logs.

        at Connection.sendMessageToServer (C:\foo\e2e-playwright\node_modules\playwright\lib\client\connection.js:69:15)
        at Proxy.<anonymous> (C:\foo\e2e-playwright\node_modules\playwright\lib\client\channelOwner.js:54:53)
        at C:\foo\e2e-playwright\node_modules\playwright\lib\client\browserType.js:62:73
        at BrowserType._wrapApiCall (C:\foo\e2e-playwright\node_modules\playwright\lib\client\channelOwner.js:80:34)
        at BrowserType.launch (C:\foo\e2e-playwright\node_modules\playwright\lib\client\browserType.js:53:21)
        at Object.fixtures.browser.init.scope [as fn] (C:\foo\e2e-playwright\node_modules\@playwright\test\out\index.js:48:39)
        at Fixture.setup (C:\foo\e2e-playwright\node_modules\folio\out\fixtures.js:78:52)
        at processTicksAndRejections (internal/process/task_queues.js:89:5)
        at FixturePool.setupFixtureForRegistration (C:\foo\e2e-playwright\node_modules\folio\out\fixtures.js:239:9)
        at Fixture.setup (C:\foo\e2e-playwright\node_modules\folio\out\fixtures.js:68:25)
        at FixturePool.setupFixtureForRegistration (C:\foo\e2e-playwright\node_modules\folio\out\fixtures.js:239:9)
        at Fixture.setup (C:\foo\e2e-playwright\node_modules\folio\out\fixtures.js:68:25)
        at FixturePool.setupFixtureForRegistration (C:\foo\e2e-playwright\node_modules\folio\out\fixtures.js:239:9)
        at Fixture.setup (C:\foo\e2e-playwright\node_modules\folio\out\fixtures.js:68:25)
        at FixturePool.setupFixtureForRegistration (C:\foo\e2e-playwright\node_modules\folio\out\fixtures.js:239:9)

  2 passed (3s)
  1 failed
    foo.spec.ts:3:1 › is a basic test with the page ================================================
    browserName=firefox, headful=false, slowMo=0, video=false, screenshotOnFailure=true

npm ERR! Test failed.  See above for more details.

Process finished with exit code 1

Versions:

Node: 12.4.0
OS: win32 x64
Waterstraal commented 4 years ago

Note that npx folio --param browserName=chromium runs fine:

Running 1 test using 1 worker
  1 passed (3s)
mxschmitt commented 4 years ago

Which Windows version are you using?

Waterstraal commented 4 years ago

Edition: Windows 10 Enterprise Version: 1909 OS build: 18363.1139

arjunattam commented 4 years ago

Thanks, @waterstraal. While Chromium and WebKit are working for you, Firefox is missing system-level dependency. To fix this, you can install the Visual C++ redistributable package. We will explore bundling this dependency so it doesn't need to be manually configured. I'll open an issue on the Playwright repo and close this one. We can re-open if you have any issues.