Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/xiefenga/playwright-filechooser-bug-reproduce
https://github.com/xiefenga/playwright-filechooser-bug-reproduce
Last synced: 12 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/xiefenga/playwright-filechooser-bug-reproduce
- Owner: xiefenga
- Created: 2023-12-14T07:16:09.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2023-12-14T07:27:22.000Z (about 1 year ago)
- Last Synced: 2024-11-25T11:41:36.694Z (2 months ago)
- Language: TypeScript
- Size: 239 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## playwright reproduce
### reproduce steps
1. pull docker image
```shell
docker pull mcr.microsoft.com/playwright:v1.40.0-jammydocker run -it --rm -v .:/demo --ipc=host mcr.microsoft.com/playwright:v1.40.0-jammy /bin/bash
```2. run tests in docker
```shell
yarnyarn playwright test -u
```### behavior
test-1.spec.ts:29:1 › test - 压缩文件 will fail
```log
Running 2 tests using 2 workers
1) [chromium] › test-1.spec.ts:29:1 › test - 压缩文件 ─────────────────────────────────Error: Timed out 5000ms waiting for expect(locator).toContainText(expected)
Locator: locator('#root')
Expected string: "压缩文件.zip"
Received string: "Fileselectopen modal"
Call log:
- expect.toContainText with timeout 5000ms
- waiting for locator('#root')
- locator resolved to…
- unexpected value "Fileselectopen modal"
- locator resolved to…
- unexpected value "Fileselectopen modal"
- locator resolved to…
- unexpected value "Fileselectopen modal"
- locator resolved to…
- unexpected value "Fileselectopen modal"
- locator resolved to…
- unexpected value "Fileselectopen modal"
- locator resolved to…
- unexpected value "Fileselectopen modal"
- locator resolved to…
- unexpected value "Fileselectopen modal"
- locator resolved to…
- unexpected value "Fileselectopen modal"
- locator resolved to…
- unexpected value "Fileselectopen modal"33 | const fileChooser1 = await fileChooserPromise1
34 | await fileChooser1.setFiles(filePath2)
> 35 | await expect(page.locator('#root')).toContainText('压缩文件.zip');
| ^
36 |
37 | await page.getByRole('button', { name: 'open modal' }).click();
38 | const fileChooserPromise2 = page.waitForEvent('filechooser')at /demo/tests/test-1.spec.ts:35:39
attachment #1: trace (application/zip) ──────────────────────────────────────────
test-results/test-1-test---压缩文件-chromium/trace.zip
Usage:yarn playwright show-trace test-results/test-1-test---压缩文件-chromium/trace.zip
─────────────────────────────────────────────────────────────────────────────────
1 failed
[chromium] › test-1.spec.ts:29:1 › test - 压缩文件 ──────────────────────────────────
1 passed (7.5s)
```
we can commit the `test-1.spec.ts` file line 35 and 42, and test agagin, it will pass.screenshots will generate in `tests/test-1.spec.ts-snapshots`, we can see difference between the different test case