[Feature] Provide easy access to the Playwright version string
It would be nice to be able to access the current version of Playwright from the test code itself. For example, if I want to set a default userAgent from the default config, I can use a trick like this:
userAgent: devices['Desktop Chrome'].userAgent + " Playwright/1"
However, I don't have access to the Playwright version string, so the best I can do is put a major version there. Is there a property hidden somewhere that has the version string?
@SineSwiper can you just do the following:
const pwVersion = require('@playwright/test/package.json').version;
Yes, that does work.
Are there any merits to making either the UA suffix setting or Playwright version string acquiring easier to do?
Are there any merits to making either the UA suffix setting or Playwright version string acquiring easier to do?
IMO playwright version is already easy to get, and consistent with the rest of NPM ecosystem. I'll close this then since there's no action required from the team.