trying to run the following snippet
const { it, expect } = require('@playwright/test');
it('is a basic test with the page', async ({ page }) => {
await page.goto('https://playwright.dev/');
const home = await page.waitForSelector('home-navigation');
expect(await home.innerText()).toBe(' Playwright');
});
but get the following error :
TypeError: test_runner_1.fixtures.defineParameter is not a function
pointing to my require statement, I have run npm i -D @playwright/test @playwright/test-runner and have the modules present. Why would this fail? trying to run it with node 'filename.js'
when you use playwright-test test runner: run commands like with npx:
file should be store in format *.ts, like:
Run all tests across Chromium, Firefox and WebKit
Run tests on a single browser
Run all tests in headful mode
Run tests with slowMo (slows down Playwright operations by n milliseconds)
Save screenshots on failure in test-results directory
See all options
to run your code with more than 1 param: