Skip to content

Commit

Permalink
Merge branch 'microsoft:main' into aman/html-report-improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
amankagithub committed Mar 28, 2024
2 parents ad4144d + ffffb81 commit 5b26197
Show file tree
Hide file tree
Showing 92 changed files with 2,367 additions and 1,950 deletions.
2 changes: 1 addition & 1 deletion browser_patches/firefox/UPSTREAM_CONFIG.sh
@@ -1,3 +1,3 @@
REMOTE_URL="https://github.com/mozilla/gecko-dev"
BASE_BRANCH="release"
BASE_REVISION="a32b8662993085139ac91212a297123b632fc1c0"
BASE_REVISION="f8704c84a751716bad093b9bdc482db53fe5b3ea"
6 changes: 5 additions & 1 deletion browser_patches/firefox/juggler/NetworkObserver.js
Expand Up @@ -553,7 +553,11 @@ class NetworkRequest {

_sendOnRequestFinished() {
const pageNetwork = this._pageNetwork;
if (pageNetwork) {
// Undefined |responseEndTime| means there has been no response yet.
// This happens when request interception API is used to redirect
// the request to a different URL.
// In this case, we should not emit "requestFinished" event.
if (pageNetwork && this.httpChannel.responseEndTime !== undefined) {
let protocolVersion = undefined;
try {
protocolVersion = this.httpChannel.protocolVersion;
Expand Down
1 change: 0 additions & 1 deletion browser_patches/firefox/juggler/content/PageAgent.js
Expand Up @@ -62,7 +62,6 @@ class PageAgent {

const docShell = frameTree.mainFrame().docShell();
this._docShell = docShell;
this._initialDPPX = docShell.contentViewer.overrideDPPX;

// Dispatch frameAttached events for all initial frames
for (const frame of this._frameTree.frames()) {
Expand Down
271 changes: 135 additions & 136 deletions browser_patches/firefox/patches/bootstrap.diff

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions browser_patches/firefox/preferences/playwright.cfg
Expand Up @@ -15,6 +15,9 @@ pref("datareporting.policy.dataSubmissionPolicyBypassNotification", true);
// Force pdfs into downloads.
pref("pdfjs.disabled", true);

// This preference breaks our authentication flow.
pref("network.auth.use_redirect_for_retries", false);

// Disable cross-process iframes, but not cross-process navigations.
pref("fission.webContentIsolationStrategy", 0);

Expand Down Expand Up @@ -308,3 +311,6 @@ pref("devtools.toolbox.host", "window");
// Disable auto translations
pref("browser.translations.enable", false);
// Disable spell check
pref("layout.spellcheckDefault", 0);
2 changes: 1 addition & 1 deletion browser_patches/webkit/UPSTREAM_CONFIG.sh
@@ -1,3 +1,3 @@
REMOTE_URL="https://github.com/WebKit/WebKit.git"
BASE_BRANCH="main"
BASE_REVISION="3db3a794a844d2c7e4cda8fc6a7588f8e62ee85a"
BASE_REVISION="d477c762a9ecbbc8dedf3ca7a6a2a079577bf60c"
2,061 changes: 1,058 additions & 1,003 deletions browser_patches/webkit/patches/bootstrap.diff

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/src/accessibility-testing-js.md
Expand Up @@ -14,7 +14,7 @@ A few examples of problems this can catch include:

The following examples rely on the [`@axe-core/playwright`](https://npmjs.org/@axe-core/playwright) package which adds support for running the [axe accessibility testing engine](https://www.deque.com/axe/) as part of your Playwright tests.

:::note Disclaimer
:::note[Disclaimer]
Automated accessibility tests can detect some common accessibility problems such as missing or invalid properties. But many accessibility problems can only be discovered through manual testing. We recommend using a combination of automated testing, manual accessibility assessments, and inclusive user testing.

For manual assessments, we recommend [Accessibility Insights for Web](https://accessibilityinsights.io/docs/web/overview/?referrer=playwright-accessibility-testing-js), a free and open source dev tool that walks you through assessing a website for [WCAG 2.1 AA](https://www.w3.org/WAI/WCAG21/quickref/?currentsidebar=%23col_customize&levels=aaa) coverage.
Expand Down
87 changes: 65 additions & 22 deletions docs/src/api/class-browsercontext.md
Expand Up @@ -459,7 +459,71 @@ Returns the browser instance of the context. If it was launched as a persistent
## async method: BrowserContext.clearCookies
* since: v1.8

Clears context cookies.
Removes cookies from context. Accepts optional filter.

**Usage**

```js
await context.clearCookies();
await context.clearCookies({ name: 'session-id' });
await context.clearCookies({ domain: 'my-origin.com' });
await context.clearCookies({ domain: /.*my-origin\.com/ });
await context.clearCookies({ path: '/api/v1' });
await context.clearCookies({ name: 'session-id', domain: 'my-origin.com' });
```


```java
context.clearCookies();
context.clearCookies(new BrowserContext.ClearCookiesOptions().setName("session-id"));
context.clearCookies(new BrowserContext.ClearCookiesOptions().setDomain("my-origin.com"));
context.clearCookies(new BrowserContext.ClearCookiesOptions().setPath("/api/v1"));
context.clearCookies(new BrowserContext.ClearCookiesOptions()
.setName("session-id")
.setDomain("my-origin.com"));
```

```python async
await context.clear_cookies()
await context.clear_cookies(name="session-id")
await context.clear_cookies(domain="my-origin.com")
await context.clear_cookies(path="/api/v1")
await context.clear_cookies(name="session-id", domain="my-origin.com")
```

```python sync
context.clear_cookies()
context.clear_cookies(name="session-id")
context.clear_cookies(domain="my-origin.com")
context.clear_cookies(path="/api/v1")
context.clear_cookies(name="session-id", domain="my-origin.com")
```

```csharp
await context.ClearCookiesAsync();
await context.ClearCookiesAsync(new() { Name = "session-id" });
await context.ClearCookiesAsync(new() { Domain = "my-origin.com" });
await context.ClearCookiesAsync(new() { Path = "/api/v1" });
await context.ClearCookiesAsync(new() { Name = "session-id", Domain = "my-origin.com" });
```

### option: BrowserContext.clearCookies.name
* since: v1.43
- `name` <[string]|[RegExp]>

Only removes cookies with the given name.

### option: BrowserContext.clearCookies.domain
* since: v1.43
- `domain` <[string]|[RegExp]>

Only removes cookies with the given domain.

### option: BrowserContext.clearCookies.path
* since: v1.43
- `path` <[string]|[RegExp]>

Only removes cookies with the given path.

## async method: BrowserContext.clearPermissions
* since: v1.8
Expand Down Expand Up @@ -1013,27 +1077,6 @@ Creates a new page in the browser context.

Returns all open pages in the context.

## async method: BrowserContext.removeCookies
* since: v1.43

Removes cookies from context. At least one of the removal criteria should be provided.

**Usage**

```js
await browserContext.removeCookies({ name: 'session-id' });
await browserContext.removeCookies({ domain: 'my-origin.com' });
await browserContext.removeCookies({ path: '/api/v1' });
await browserContext.removeCookies({ name: 'session-id', domain: 'my-origin.com' });
```

### param: BrowserContext.removeCookies.filter
* since: v1.43
- `filter` <[Object]>
- `name` ?<[string]>
- `domain` ?<[string]>
- `path` ?<[string]>

## property: BrowserContext.request
* since: v1.16
* langs:
Expand Down
2 changes: 1 addition & 1 deletion docs/src/api/class-elementhandle.md
Expand Up @@ -4,7 +4,7 @@

ElementHandle represents an in-page DOM element. ElementHandles can be created with the [`method: Page.querySelector`] method.

:::caution Discouraged
:::warning[Discouraged]
The use of ElementHandle is discouraged, use [Locator] objects and web-first assertions instead.
:::

Expand Down
98 changes: 50 additions & 48 deletions docs/src/api/class-framelocator.md
Expand Up @@ -74,57 +74,11 @@ await page.FrameLocator(".result-frame").First.getByRole(AriaRole.Button).ClickA

**Converting Locator to FrameLocator**

If you have a [Locator] object pointing to an `iframe` it can be converted to [FrameLocator] using [`method: Locator.enterFrame`].
If you have a [Locator] object pointing to an `iframe` it can be converted to [FrameLocator] using [`method: Locator.contentFrame`].

**Converting FrameLocator to Locator**

If you have a [FrameLocator] object it can be converted to [Locator] pointing to the same `iframe` using [`method: FrameLocator.exitFrame`].


## method: FrameLocator.exitFrame
* since: v1.43
- returns: <[Locator]>

Returns a [Locator] object pointing to the same `iframe` as this frame locator.

Useful when you have a [FrameLocator] object obtained somewhere, and later on would like to interact with the `iframe` element.

**Usage**

```js
const frameLocator = page.frameLocator('iframe[name="embedded"]');
// ...
const locator = frameLocator.exitFrame();
await expect(locator).toBeVisible();
```

```java
FrameLocator frameLocator = page.frameLocator("iframe[name=\"embedded\"]");
// ...
Locator locator = frameLocator.exitFrame();
assertThat(locator).isVisible();
```

```python async
frame_locator = page.frame_locator("iframe[name=\"embedded\"]")
# ...
locator = frame_locator.exit_frame
await expect(locator).to_be_visible()
```

```python sync
frame_locator = page.frame_locator("iframe[name=\"embedded\"]")
# ...
locator = frame_locator.exit_frame
expect(locator).to_be_visible()
```

```csharp
var frameLocator = Page.FrameLocator("iframe[name=\"embedded\"]");
// ...
var locator = frameLocator.ExitFrame;
await Expect(locator).ToBeVisibleAsync();
```
If you have a [FrameLocator] object it can be converted to [Locator] pointing to the same `iframe` using [`method: FrameLocator.owner`].


## method: FrameLocator.first
Expand Down Expand Up @@ -248,3 +202,51 @@ Returns locator to the n-th matching frame. It's zero based, `nth(0)` selects th
### param: FrameLocator.nth.index
* since: v1.17
- `index` <[int]>

## method: FrameLocator.owner
* since: v1.43
- returns: <[Locator]>

Returns a [Locator] object pointing to the same `iframe` as this frame locator.

Useful when you have a [FrameLocator] object obtained somewhere, and later on would like to interact with the `iframe` element.

For a reverse operation, use [`method: Locator.contentFrame`].

**Usage**

```js
const frameLocator = page.frameLocator('iframe[name="embedded"]');
// ...
const locator = frameLocator.owner();
await expect(locator).toBeVisible();
```

```java
FrameLocator frameLocator = page.frameLocator("iframe[name=\"embedded\"]");
// ...
Locator locator = frameLocator.owner();
assertThat(locator).isVisible();
```

```python async
frame_locator = page.frame_locator("iframe[name=\"embedded\"]")
# ...
locator = frame_locator.owner
await expect(locator).to_be_visible()
```

```python sync
frame_locator = page.frame_locator("iframe[name=\"embedded\"]")
# ...
locator = frame_locator.owner
expect(locator).to_be_visible()
```

```csharp
var frameLocator = Page.FrameLocator("iframe[name=\"embedded\"]");
// ...
var locator = frameLocator.Owner;
await Expect(locator).ToBeVisibleAsync();
```

0 comments on commit 5b26197

Please sign in to comment.