Hi, I am putting this PR out as a feeler to see if there's interested in
improving this error message, but the copy is by no means final and I am
open to improvement suggestions.
My intention here is to:
- Explain what a "focused item" is - that we're talking about a test and
it being focused is most likely down it using `only`
Are there other types of "items"? Are there other ways to make them
focused other than `only`?
- Explain why we're even in focused mode and how to control it
The default scaffolded Playwright config file includes a forbidMode
expression driven by whether `CI=1` is set.
I ran into this when trying to reproduce a CI issue locally so I had it
set and unknowingly entered focus only mode.
I wasn't aware this mode was a thing because I was using the default
configuration from `npm init` and did not familiarize myself with all
the options in it.
Is there a way to tell if we're in a TypeScript or JavaScript project in
this function? I would use that to display the configuration file name
with the right extension.
---------
Signed-off-by: Tomáš Hübelbauer <tomas@hubelbauer.net>
* docs(CONTRIBUTING.md): Add build step
Without the build step, a fresh install without any previous
builds would get:
```
$ npm test
> playwright-internal@1.2.0-post test /Users/pw/code/playwright
> cross-env BROWSER=all node --unhandled-rejections=strict test/test.js
internal/modules/cjs/loader.js:1033
throw err;
^
Error: Cannot find module '../lib/rpc/server/dispatcher'
Require stack:
- /Users/pw/code/playwright/test/environments.js
- /Users/pw/code/playwright/test/test.js
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:1030:15)
at Function.Module._load (internal/modules/cjs/loader.js:899:27)
at Module.require (internal/modules/cjs/loader.js:1090:19)
at require (internal/modules/cjs/helpers.js:75:18)
at Object.<anonymous> (/Users/pw/code/playwright/test/environments.js:23:34)
at Module._compile (internal/modules/cjs/loader.js:1201:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1221:10)
at Module.load (internal/modules/cjs/loader.js:1050:32)
at Function.Module._load (internal/modules/cjs/loader.js:938:14)
at Module.require (internal/modules/cjs/loader.js:1090:19) {
code: 'MODULE_NOT_FOUND',
requireStack: [
'/Users/pw/code/playwright/test/environments.js',
'/Users/pw/code/playwright/test/test.js'
]
}
npm ERR! Test failed. See above for more details.
```
Fixes#2868.
Co-authored-by: Andrey Lushnikov <aslushnikov@gmail.com>
When contributing some test cases, I was a bit confused about if I should use `skip` and `fail`, the difference between the two, and how they interact with CI/CD tests passing or failing: https://github.com/microsoft/playwright/pull/1939#discussion_r413946012.
This is my attempt at explaining the difference, but feel free to edit to make it more clear and concise (and correct any inaccuracies).