Commit Graph

9462 Commits

Author SHA1 Message Date
Chris Alley
1ec614bfc4
docs: fix grammar within class test API documentation (#18627) 2022-11-10 15:53:48 -08:00
Andrey Lushnikov
23171c5037
chore: support narrow terminal windows for messages (#18714)
This patch starts using a message box that's not really a box and thus
is better behaving on a narrow-width terminals.

Before:
<img width="744" alt="image"
src="https://user-images.githubusercontent.com/746130/201216551-abbac0f8-71b4-413f-9f4e-159c7123ef3d.png">

After:
<img width="745" alt="image"
src="https://user-images.githubusercontent.com/746130/201216504-25257727-06c8-4ae9-8557-a2d937b7ca0b.png">

Signed-off-by: Andrey Lushnikov <aslushnikov@gmail.com>
Co-authored-by: Dmitry Gozman <dgozman@gmail.com>
2022-11-10 15:50:52 -08:00
Andrey Lushnikov
db826c9c8c
chore: drive-by fixes for the snapshotPathTemplate (#18715)
- Use `snapshotPathTemplate` for docker screenshots in html-reporter
- Mark the snapshot path template test as slow since it re-spawns
  worker for each project.
- Fix docker smoke tests
2022-11-10 15:50:13 -08:00
Max Schmitt
56d7d47d43
fix(codegen): make select work with size attribute (#18712)
Fixes https://github.com/microsoft/playwright/issues/18711
2022-11-10 15:06:53 -08:00
Yury Semikhatsky
0765182a4d
fix: conversion to snake case (#18707)
Fixes https://github.com/microsoft/playwright/issues/18695
2022-11-10 14:54:07 -08:00
Dmitry Gozman
194abc35cd
Revert #18561 "feat(test runner): test.reset() to reset options to default/config value" (#18704)
This reverts commit 6fef227f43.

Not shipping in 1.28.
2022-11-10 14:45:05 -08:00
Pavel Feldman
ac25fdd74b
chore: fix ff tests with new events mode (#18708) 2022-11-10 12:59:27 -08:00
Dmitry Gozman
6d456d30dc
docs: improve test.describe.configure() (#18705) 2022-11-10 12:29:38 -08:00
Dmitry Gozman
7c80b77c57
feat(clear): remove clear() methods from all classes except Locator (#18703)
The preferred way is to use the locator, so we should not encourage the
use of `ElementHandle` or `Page` in the new APIs.
2022-11-10 12:29:14 -08:00
Pavel Feldman
ca2e7ef199
chore: report paused signal to the debug controller clients (#18701) 2022-11-10 12:15:29 -08:00
Andrey Lushnikov
f52fa4ceba
chore(snapshotPathTemplate): address review comments (#18702) 2022-11-10 11:37:41 -08:00
Dante Monaldo
e6a1bdffee
docs(auth): fix session storage examples (#18686)
Co-authored-by: Dante <dante@usebasis.co>
2022-11-10 09:43:42 -08:00
Pavel Feldman
c25e67a0e7
chore: conditionally dispatch network events (#18687) 2022-11-09 21:10:57 -08:00
Dmitry Gozman
cafa558845
fix(codegen): update priorites in selector generator (#18688)
- prefer `role=checkbox` over `input[type=checkbox]`
- prefer `#id` over `input[type=checkbox]` and `role=checkbox`
- prefer `text=foo` over `internal:has-text=foo`
- ignore `none` and `presentation` roles
- remove non-strict support
2022-11-09 17:22:13 -08:00
Andrey Lushnikov
6d491f928d
feat(playwright-test): introduce snapshotPathTemplate configuration (#18568)
This configuration option allows to set a string with template
values for precise control over snapshot path location.

An example of `snapshotPathTemplate` usage:

```ts
// playwright.config.ts
// Notice the `testDir` configuration!
export default {
  testDir: './tests',
  snapshotPathTemplate: './__screenshots__/{platform}/{projectName}/{testFilePath}/{arg}{ext}',
}
```

Currently supported "magic tokens" inside the `snapshotPathTemplate`
are:

- `{testDir}` - project's `testDir`
- `{snapshotDir}` - project's `snapshotDir`
- `{platform}` - `process.platform`
- `{projectName}` - Project's sanitized name
- `{testFileDir}` - Directories in relative path from `testDir` to test
  file path (e.g. `page/` in the example below)
- `{testFileName}` - Test file name (with extension) (e.g.
  `page-click.spec.ts` in the example below)
- `{testFilePath}` - Relative path from `testDir` to test file path
  (e.g. `page/page-click.spec.ts` in the example below)
- `{ext}` - snapshot extension (with dots)
- `{arg}` - joined snapshot name parts, without extension (e.g.
`foo/bar/baz` in the example below)
- `{snapshotSuffix}` - `testInfo.snapshotSuffix` value.

Consider the following file structure:

```
playwright.config.ts
tests/
└── page/
    └── page-click.spec.ts
```

The following `page-click.spec.ts`:

```ts
// page-click.spec.ts
import { test, expect } from '@playwright/test';

test('should work', async ({ page }) => {
  await expect(page).toHaveScreenshot(['foo', 'bar', 'baz.png']);
});
```

Fixes #7792
2022-11-09 15:29:07 -08:00
Andrey Lushnikov
9bcb28f25a
Revert "feat: send SIGTERM to webserver before SIGKILL'ing it. (#18220)" (#18661)
This reverts commit c63a0b536d.

Reason: https://github.com/microsoft/playwright/pull/18564
2022-11-09 09:18:33 -08:00
Dmitry Gozman
a7f1c8cb65
fix(codegen): fix csharp options syntax (#18662) 2022-11-08 21:48:01 -08:00
Dmitry Gozman
ef1b68a998
feat(locators): support frame locators in asLocator (#18653)
Drive-by: change `true` to `True` in python.

References #18524.
2022-11-08 17:08:08 -08:00
Playwright Service
54a235284a
feat(chromium-tip-of-tree): roll to r1058 (#18658)
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2022-11-08 16:11:42 -08:00
Max Schmitt
06353e9905
docs(trace-viewer): fix broken examples (#18654)
Fixes https://github.com/microsoft/playwright-python/issues/1616
2022-11-08 14:22:14 -08:00
Pavel Feldman
b8bd4f7a48
chore: serialize config as a part of list-files (#18649) 2022-11-08 12:05:00 -08:00
Pavel Feldman
0355d8618f
chore: use provided value for the generated test id (#18631) 2022-11-08 12:04:43 -08:00
Dmitry Gozman
05b623e6b0
feat(locators): asLocator supports internal:has= (#18625)
The following snippet:
```js
rowLocator
    .filter({ hasText: 'John' })
    .filter({ has: page.getByRole('button', { name: 'Say hello' }) })

```

is shown in the logs:

```log
pw:api waiting for getByRole('listitem').filter({ hasText: 'John' }).filter({ has: getByRole('button', { name: 'Say hello' }) })
```
2022-11-08 08:47:02 -08:00
sand4rt
712ce0dce9
test(ct): vue cli router (#18603) 2022-11-08 08:40:29 -08:00
sand4rt
ccf9c8d487
test(ct): react router (#18602) 2022-11-08 08:40:06 -08:00
sand4rt
84529595cc
test(ct): react vite router (#18601) 2022-11-08 08:39:48 -08:00
github-actions[bot]
63a0b75186
chore(driver): roll driver to recent Node.js LTS version (#18636) 2022-11-08 03:31:27 -08:00
Yury Semikhatsky
d5494edf71
feat(runner): TestOptions.storageStateName (#18587) 2022-11-07 16:27:38 -08:00
Dmitry Gozman
28d3f48a65
test: gardening (#18623)
- Separate worker for some Android tests.
- Use png comparator for some screenshots tests instead of buffer
equality.
- Skip drag&drop tests on Android.
- Various timeout fixes.
2022-11-07 15:35:21 -08:00
Max Schmitt
48d7bfc55f
docs: delete old auth + pom guides (#18615) 2022-11-07 15:31:42 -08:00
Dmitry Gozman
1cee65722b
fix(inspector): disable highlight during screenshot actions (#18621)
Fixes #18049.
2022-11-07 13:53:15 -08:00
Dmitry Gozman
9172a2ca5a
test: use strict png comparator in tests (#18622) 2022-11-07 13:32:46 -08:00
Pavel Feldman
8432d1592f
chore: expose new locator apis on window.playwright (#18595) 2022-11-07 09:06:13 -08:00
Kazuya Takei
05471df8bb
docs(python): remove not-needed semicolons from code snippets (#18589) 2022-11-07 08:28:07 -08:00
Dmitry Gozman
6a65a43e9a
chore: use consistent asLocator() in all logs (#18586)
References #18524.
2022-11-04 15:19:16 -07:00
Yury Semikhatsky
25dc0bfacb
feat(runner): change storage fixture to TestInfo.storage() (#18584) 2022-11-04 14:28:25 -07:00
Yury Semikhatsky
a9c15a25f8
test: storageState from config key (#18581) 2022-11-04 13:10:33 -07:00
Dmitry Gozman
3a24e88e61
test: enable "should not crash when force-clicking hidden input" on chromium (#18576)
Fixed by the latest roll.
2022-11-04 10:39:51 -07:00
Dmitry Gozman
6fef227f43
feat(test runner): test.reset() to reset options to default/config value (#18561) 2022-11-04 09:03:29 -07:00
Dmitry Gozman
7a9f1b5ee4
fix(firefox): force fast shutdown after "xpcom-will-shutdown" phase (#18556) 2022-11-04 09:02:13 -07:00
Dmitry Gozman
227f47effb
feat(firefox): roll to 1364 and 1367, rebase page-drag.spec (#18559) 2022-11-04 08:53:50 -07:00
Playwright Service
7e65b1927a
feat(chromium-tip-of-tree): roll to r1057 (#18566) 2022-11-04 08:27:44 -07:00
Max Schmitt
245260b365
docs(python): Page.emulateMedia.media "null" value follow-up (#18555)
Follow-up of 91f7e3963d.
2022-11-03 17:50:32 -07:00
Playwright Service
ad39e7571d
feat(chromium-tip-of-tree): roll to r1056 (#18500)
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2022-11-03 16:54:59 -07:00
Playwright Service
ae811774b1
feat(chromium): roll to r1033 (#18558)
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2022-11-03 16:21:39 -07:00
Pavel Feldman
3bc9e07daf
chore: parse locators strictly (#18553) 2022-11-03 15:17:08 -07:00
Yury Semikhatsky
c8cd07594c
feat(runner): initialize context.storageState from storage entry (#18549) 2022-11-03 14:20:39 -07:00
Xiaoxing Ye
9338355e47
feat(testinfo): add name to attachment output name (#18440)
Per discussion in #12950, adding sanitized name to the output filename
prefix. This can make debugging easier, and the filename structure more
human friendly.
2022-11-03 13:54:51 -07:00
Andrey Lushnikov
8538f61a72
feat(containers): implement global network tethering for playwright server (#17719)
This patch implements a new mode of network tethering for Playwright
server & its clients.
With this patch:
- playwright server could be launched with the
`--browser-proxy-mode=tether` flag to engage in the new mode
- a new type of client, "Network Tethering Client" can connect to the
server to provide network traffic to the browsers
- all clients that connect to the server with the `x-playwright-proxy:
*` header will get traffic from the "Network Tethering Client"

This patch also adds an environment variable
`PW_OWNED_BY_TETHER_CLIENT`. With this env, playwright server will
auto-close when the network tethering client disconnects. It will also
auto-close if the network client does not connect to the server in the
first 10 seconds of the server existence. This way we can ensure that
`npx playwright docker start` blocks terminal & controls the lifetime of
the started container.
2022-11-03 13:47:51 -07:00
Max Schmitt
91f7e3963d
docs(python): have enum value to reset emulated media (#18550) 2022-11-03 12:38:02 -07:00