playwright/utils/generate_types
Andrey Lushnikov 12d8a262be
feat: support screenshotsDir option (#12642)
The `screenshotsDir` option controls the expectation storage
for `toHaveScreenshot()` function.

The new expectation management for screenshots has the following
key properties:
- All screenshots are stored in a single folder called `screenshotsDir`.
- Screenshot names **do not** respect `snapshotDir` and `snapshotSuffix`
  configurations.
- `screenshotsDir` is configurable per project. This way a "smoke tests"
  project can re-use screenshots from "all tests" project.
- Host platform is a top-level folder.

For example, given the following config:

```js
// playwright.config.ts
module.exports = {
  projects: [
    { name: 'Mobile Safari' },
    { name: 'Desktop Chrome' },
  ],
};
```

And the following test structure:

```
smoke-tests/
└── basic.spec.ts
```

Will result in the following screenshots folder structure by default:

```
__screenshots__/
└── darwin/
    ├── Mobile Safari/
    │   └── smoke-tests/
    │       └── basic.spec.ts/
    │           └── screenshot-expectation.png
    └── Desktop Chrome/
        └── smoke-tests/
            └── basic.spec.ts/
                └── screenshot-expectation.png
```
2022-03-10 16:50:26 -08:00
..
test fix(types): allow specifying element type in locator.evaluate callback (#11048) 2021-12-21 13:17:45 -08:00
exported.json feat(test-runner): implement expect(pageOrLocator).toHaveScreenshot (#12242) 2022-02-28 12:25:59 -08:00
index.js docs: simplify test-assertions.md, avoid duplication (#12475) 2022-03-03 10:06:14 -08:00
overrides-test.d.ts feat: support screenshotsDir option (#12642) 2022-03-10 16:50:26 -08:00
overrides-testReporter.d.ts feat(test-runner): support expect.soft (#11800) 2022-02-02 18:33:51 -08:00
overrides.d.ts fix(types): allow specifying element type in locator.evaluate callback (#11048) 2021-12-21 13:17:45 -08:00
parseOverrides.js feat(parallel): allow setting enclosing scope parallel mode (#11822) 2022-02-02 20:44:11 -08:00