Skip to content

Commit a7408b4

Browse files
Merge pull request #18 from dheerajbstack/pr-36397
Pr 36397
2 parents 937a921 + 07e981f commit a7408b4

File tree

165 files changed

+2554
-2760
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

165 files changed

+2554
-2760
lines changed

.github/workflows/tests_others.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,27 @@ jobs:
134134
env:
135135
PW_CLOCK: ${{ matrix.clock }}
136136

137+
test_legacy_progress_timeouts:
138+
name: legacy progress timeouts
139+
environment: ${{ github.event_name == 'push' && 'allow-uploading-flakiness-results' || null }}
140+
permissions:
141+
id-token: write # This is required for OIDC login (azure/login) to succeed
142+
contents: read # This is required for actions/checkout to succeed
143+
runs-on: ubuntu-22.04
144+
steps:
145+
- uses: actions/checkout@v4
146+
- uses: ./.github/actions/run-test
147+
with:
148+
node-version: 20
149+
browsers-to-install: chromium
150+
command: npm run test -- --project=chromium-*
151+
bot-name: "legacy-progress-timeouts-linux"
152+
flakiness-client-id: ${{ secrets.AZURE_FLAKINESS_DASHBOARD_CLIENT_ID }}
153+
flakiness-tenant-id: ${{ secrets.AZURE_FLAKINESS_DASHBOARD_TENANT_ID }}
154+
flakiness-subscription-id: ${{ secrets.AZURE_FLAKINESS_DASHBOARD_SUBSCRIPTION_ID }}
155+
env:
156+
PLAYWRIGHT_LEGACY_TIMEOUTS: 1
157+
137158
test_electron:
138159
name: Electron - ${{ matrix.os }}
139160
environment: ${{ github.event_name == 'push' && 'allow-uploading-flakiness-results' || null }}

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
# 🎭 Playwright
22

3-
[![npm version](https://img.shields.io/npm/v/playwright.svg)](https://www.npmjs.com/package/playwright) <!-- GEN:chromium-version-badge -->[![Chromium version](https://img.shields.io/badge/chromium-138.0.7204.15-blue.svg?logo=google-chrome)](https://www.chromium.org/Home)<!-- GEN:stop --> <!-- GEN:firefox-version-badge -->[![Firefox version](https://img.shields.io/badge/firefox-139.0-blue.svg?logo=firefoxbrowser)](https://www.mozilla.org/en-US/firefox/new/)<!-- GEN:stop --> <!-- GEN:webkit-version-badge -->[![WebKit version](https://img.shields.io/badge/webkit-18.5-blue.svg?logo=safari)](https://webkit.org/)<!-- GEN:stop --> [![Join Discord](https://img.shields.io/badge/join-discord-infomational)](https://aka.ms/playwright/discord)
3+
[![npm version](https://img.shields.io/npm/v/playwright.svg)](https://www.npmjs.com/package/playwright) <!-- GEN:chromium-version-badge -->[![Chromium version](https://img.shields.io/badge/chromium-138.0.7204.35-blue.svg?logo=google-chrome)](https://www.chromium.org/Home)<!-- GEN:stop --> <!-- GEN:firefox-version-badge -->[![Firefox version](https://img.shields.io/badge/firefox-139.0-blue.svg?logo=firefoxbrowser)](https://www.mozilla.org/en-US/firefox/new/)<!-- GEN:stop --> <!-- GEN:webkit-version-badge -->[![WebKit version](https://img.shields.io/badge/webkit-18.5-blue.svg?logo=safari)](https://webkit.org/)<!-- GEN:stop --> [![Join Discord](https://img.shields.io/badge/join-discord-informational)](https://aka.ms/playwright/discord)
44

55
## [Documentation](https://playwright.dev) | [API reference](https://playwright.dev/docs/api/class-playwright)
66

77
Playwright is a framework for Web Testing and Automation. It allows testing [Chromium](https://www.chromium.org/Home), [Firefox](https://www.mozilla.org/en-US/firefox/new/) and [WebKit](https://webkit.org/) with a single API. Playwright is built to enable cross-browser web automation that is **ever-green**, **capable**, **reliable** and **fast**.
88

99
| | Linux | macOS | Windows |
1010
| :--- | :---: | :---: | :---: |
11-
| Chromium <!-- GEN:chromium-version -->138.0.7204.15<!-- GEN:stop --> | :white_check_mark: | :white_check_mark: | :white_check_mark: |
11+
| Chromium <!-- GEN:chromium-version -->138.0.7204.35<!-- GEN:stop --> | :white_check_mark: | :white_check_mark: | :white_check_mark: |
1212
| WebKit <!-- GEN:webkit-version -->18.5<!-- GEN:stop --> | :white_check_mark: | :white_check_mark: | :white_check_mark: |
1313
| Firefox <!-- GEN:firefox-version -->139.0<!-- GEN:stop --> | :white_check_mark: | :white_check_mark: | :white_check_mark: |
1414

docs/src/api/class-browsercontext.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -987,6 +987,7 @@ Here are some permissions that may be supported by some browsers:
987987
* `'notifications'`
988988
* `'payment-handler'`
989989
* `'storage-access'`
990+
* `'local-fonts'`
990991

991992
### option: BrowserContext.grantPermissions.origin
992993
* since: v1.8

docs/src/clock.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,47 @@ await page.clock.setFixedTime(new Date('2024-02-02T10:30:00'));
6464
await expect(page.getByTestId('current-time')).toHaveText('2/2/2024, 10:30:00 AM');
6565
```
6666

67+
```python async
68+
await page.clock.set_fixed_time(datetime.datetime(2024, 2, 2, 10, 0, 0))
69+
await page.goto("http://localhost:3333")
70+
await expect(page.get_by_test_id("current-time")).to_have_text("2/2/2024, 10:00:00 AM")
71+
72+
await page.clock.set_fixed_time(datetime.datetime(2024, 2, 2, 10, 30, 0))
73+
# We know that the page has a timer that updates the time every second.
74+
await expect(page.get_by_test_id("current-time")).to_have_text("2/2/2024, 10:30:00 AM")
75+
```
76+
77+
```python sync
78+
page.clock.set_fixed_time(datetime.datetime(2024, 2, 2, 10, 0, 0))
79+
page.goto("http://localhost:3333")
80+
expect(page.get_by_test_id("current-time")).to_have_text("2/2/2024, 10:00:00 AM")
81+
page.clock.set_fixed_time(datetime.datetime(2024, 2, 2, 10, 30, 0))
82+
# We know that the page has a timer that updates the time every second.
83+
expect(page.get_by_test_id("current-time")).to_have_text("2/2/2024, 10:30:00 AM")
84+
```
85+
86+
```java
87+
SimpleDateFormat format = new SimpleDateFormat("yyy-MM-dd'T'HH:mm:ss");
88+
page.clock().setFixedTime(format.parse("2024-02-02T10:00:00"));
89+
page.navigate("http://localhost:3333");
90+
Locator locator = page.getByTestId("current-time");
91+
assertThat(locator).hasText("2/2/2024, 10:00:00 AM");
92+
page.clock().setFixedTime(format.parse("2024-02-02T10:30:00"));
93+
// We know that the page has a timer that updates the time every second.
94+
assertThat(locator).hasText("2/2/2024, 10:30:00 AM");
95+
```
96+
97+
```csharp
98+
// Set the fixed time for the clock.
99+
await Page.Clock.SetFixedTimeAsync(new DateTime(2024, 2, 2, 10, 0, 0));
100+
await Page.GotoAsync("http://localhost:3333");
101+
await Expect(Page.GetByTestId("current-time")).ToHaveTextAsync("2/2/2024, 10:00:00 AM");
102+
// Set the fixed time for the clock.
103+
await Page.Clock.SetFixedTimeAsync(new DateTime(2024, 2, 2, 10, 30, 0));
104+
// We know that the page has a timer that updates the time every second.
105+
await Expect(Page.GetByTestId("current-time")).ToHaveTextAsync("2/2/2024, 10:30:00 AM");
106+
```
107+
67108
## Consistent time and timers
68109

69110
Sometimes your timers depend on `Date.now` and are confused when the `Date.now` value does not change over time.

docs/src/test-api/class-test.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1425,7 +1425,7 @@ Timeout in milliseconds.
14251425

14261426
Skip a test. Playwright will not run the test past the `test.skip()` call.
14271427

1428-
Skipped tests are not supposed to be ever run. If you intent to fix the test, use [`method: Test.fixme`] instead.
1428+
Skipped tests are not supposed to be ever run. If you intend to fix the test, use [`method: Test.fixme`] instead.
14291429

14301430
To declare a skipped test:
14311431
* `test.skip(title, body)`

docs/src/test-reporters-js.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ List report supports the following configuration options and environment variabl
102102
| Environment Variable Name | Reporter Config Option| Description | Default
103103
|---|---|---|---|
104104
| `PLAYWRIGHT_LIST_PRINT_STEPS` | `printSteps` | Whether to print each step on its own line. | `false`
105-
| `PLAYWRIGHT_FORCE_TTY` | | Whether to produce output suitable for a live terminal. If a number is specified, it will also be used as the terminal width. | `true` when terminal is in TTY mode, `false` otherwise.
105+
| `PLAYWRIGHT_FORCE_TTY` | | Whether to produce output suitable for a live terminal. Supports `true`, `1`, `false`, `0`, `[WIDTH]`, and `[WIDTH]x[HEIGHT]`. `[WIDTH]` and `[WIDTH]x[HEIGHT]` specifies the TTY dimensions. | `true` when terminal is in TTY mode, `false` otherwise.
106106
| `FORCE_COLOR` | | Whether to produce colored output. | `true` when terminal is in TTY mode, `false` otherwise.
107107

108108

@@ -140,7 +140,7 @@ Line report supports the following configuration options and environment variabl
140140

141141
| Environment Variable Name | Reporter Config Option| Description | Default
142142
|---|---|---|---|
143-
| `PLAYWRIGHT_FORCE_TTY` | | Whether to produce output suitable for a live terminal. If a number is specified, it will also be used as the terminal width. | `true` when terminal is in TTY mode, `false` otherwise.
143+
| `PLAYWRIGHT_FORCE_TTY` | | Whether to produce output suitable for a live terminal. Supports `true`, `1`, `false`, `0`, `[WIDTH]`, and `[WIDTH]x[HEIGHT]`. `[WIDTH]` and `[WIDTH]x[HEIGHT]` specifies the TTY dimensions. | `true` when terminal is in TTY mode, `false` otherwise.
144144
| `FORCE_COLOR` | | Whether to produce colored output. | `true` when terminal is in TTY mode, `false` otherwise.
145145

146146

@@ -182,7 +182,7 @@ Dot report supports the following configuration options and environment variable
182182

183183
| Environment Variable Name | Reporter Config Option| Description | Default
184184
|---|---|---|---|
185-
| `PLAYWRIGHT_FORCE_TTY` | | Whether to produce output suitable for a live terminal. If a number is specified, it will also be used as the terminal width. | `true` when terminal is in TTY mode, `false` otherwise.
185+
| `PLAYWRIGHT_FORCE_TTY` | | Whether to produce output suitable for a live terminal. Supports `true`, `1`, `false`, `0`, `[WIDTH]`, and `[WIDTH]x[HEIGHT]`. `[WIDTH]` and `[WIDTH]x[HEIGHT]` specifies the TTY dimensions. | `true` when terminal is in TTY mode, `false` otherwise.
186186
| `FORCE_COLOR` | | Whether to produce colored output. | `true` when terminal is in TTY mode, `false` otherwise.
187187

188188
### HTML reporter

packages/html-reporter/src/filter.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,10 @@ export class Filter {
2929
annotations: FilterToken[] = [];
3030

3131
empty(): boolean {
32-
return this.project.length + this.status.length + this.text.length === 0;
32+
return (
33+
this.project.length + this.status.length + this.text.length +
34+
this.labels.length + this.annotations.length
35+
) === 0;
3336
}
3437

3538
static parse(expression: string): Filter {

packages/html-reporter/src/headerView.tsx

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ import * as icons from './icons';
2323
import { Link, navigate, SearchParamsContext } from './links';
2424
import { statusIcon } from './statusIcon';
2525
import { filterWithToken } from './filter';
26+
import { linkifyText } from '@web/renderUtils';
2627

2728
export const HeaderView: React.FC<{
2829
title: string | undefined,
@@ -35,7 +36,7 @@ export const HeaderView: React.FC<{
3536
<div style={{ flex: 'auto' }}></div>
3637
{rightSuperHeader}
3738
</div>
38-
{title && <div className='header-title'>{title}</div>}
39+
{title && <div className='header-title'>{linkifyText(title)}</div>}
3940
</div>;
4041
};
4142

@@ -60,13 +61,16 @@ export const GlobalFilterView: React.FC<{
6061
event => {
6162
event.preventDefault();
6263
const url = new URL(window.location.href);
63-
url.hash = filterText ? '?' + new URLSearchParams({ q: filterText }) : '';
64+
// If <form/> onSubmit happens immediately after <input/> onChange, the filterText state is not updated yet.
65+
// Using FormData here is a workaround to get the latest value.
66+
const q = new FormData(event.target as HTMLFormElement).get('q') as string;
67+
url.hash = q ? '?' + new URLSearchParams({ q }) : '';
6468
navigate(url);
6569
}
6670
}>
6771
{icons.search()}
6872
{/* Use navigationId to reset defaultValue */}
69-
<input spellCheck={false} className='form-control subnav-search-input input-contrast width-full' value={filterText} onChange={e => {
73+
<input name='q' spellCheck={false} className='form-control subnav-search-input input-contrast width-full' value={filterText} onChange={e => {
7074
setFilterText(e.target.value);
7175
}}></input>
7276
</form>

packages/injected/src/ariaSnapshot.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
import { escapeRegExp, longestCommonSubstring, normalizeWhiteSpace } from '@isomorphic/stringUtils';
1818

19-
import { box, getElementComputedStyle, getGlobalOptions, isElementVisible } from './domUtils';
19+
import { box, getElementComputedStyle, isElementVisible } from './domUtils';
2020
import * as roleUtils from './roleUtils';
2121
import { yamlEscapeKeyIfNeeded, yamlEscapeValueIfNeeded } from './yaml';
2222

@@ -214,7 +214,7 @@ function toAriaNode(element: Element, options?: { forAI?: boolean, refPrefix?: s
214214
result.selected = roleUtils.getAriaSelected(element);
215215

216216
if (element instanceof HTMLInputElement || element instanceof HTMLTextAreaElement) {
217-
if (element.type !== 'checkbox' && element.type !== 'radio' && (element.type !== 'file' || getGlobalOptions().inputFileRoleTextbox))
217+
if (element.type !== 'checkbox' && element.type !== 'radio' && element.type !== 'file')
218218
result.children = [element.value];
219219
}
220220

packages/injected/src/domUtils.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616

1717
type GlobalOptions = {
1818
browserNameForWorkarounds?: string;
19-
inputFileRoleTextbox?: boolean;
2019
};
2120
let globalOptions: GlobalOptions = {};
2221
export function setGlobalOptions(options: GlobalOptions) {

0 commit comments

Comments
 (0)