Skip to content

Commit

Permalink
fix: docs
Browse files Browse the repository at this point in the history
  • Loading branch information
kobenguyent committed Nov 20, 2023
1 parent e0d1ab1 commit bdf05e6
Show file tree
Hide file tree
Showing 11 changed files with 14 additions and 26 deletions.
4 changes: 1 addition & 3 deletions docs/helpers/Nightmare.md
Original file line number Diff line number Diff line change
Expand Up @@ -147,15 +147,13 @@ if none provided clears all cookies.

```js
I.clearCookie();
I.clearCookie('test');
I.clearCookie('test'); // Playwright currently doesn't support clear a particular cookie name
```

#### Parameters

- `cookie` **[string][3]?** (optional, `null` by default) cookie name

Returns **[Promise][5]<void>** automatically synchronized promise through #recorder

### clearField

Clears a `<textarea>` or text `<input>` element's value.
Expand Down
7 changes: 3 additions & 4 deletions docs/helpers/Playwright.md
Original file line number Diff line number Diff line change
Expand Up @@ -518,19 +518,18 @@ I.checkOption('Agree', '.signup', { position: { x: 5, y: 5 } })

### clearCookie

Clears all cookies. Playwright currently doesn't support to delete a certain cookie.
Clears a cookie by name,
if none provided clears all cookies.

```js
I.clearCookie();
I.clearCookie('test'); // currently has the same effect as line above
I.clearCookie('test'); // Playwright currently doesn't support clear a particular cookie name
```

#### Parameters

- `cookie` **[string][8]?** (optional, `null` by default) cookie name

Returns **[Promise][9]&lt;void>** automatically synchronized promise through #recorder

### clearField

Clears the text input element: `<input>`, `<textarea>` or `[contenteditable]` .
Expand Down
4 changes: 1 addition & 3 deletions docs/helpers/Protractor.md
Original file line number Diff line number Diff line change
Expand Up @@ -267,15 +267,13 @@ if none provided clears all cookies.

```js
I.clearCookie();
I.clearCookie('test');
I.clearCookie('test'); // Playwright currently doesn't support clear a particular cookie name
```

#### Parameters

- `cookie` **[string][9]?** (optional, `null` by default) cookie name

Returns **[Promise][10]&lt;void>** automatically synchronized promise through #recorder

### clearField

Clears a `<textarea>` or text `<input>` element's value.
Expand Down
4 changes: 1 addition & 3 deletions docs/helpers/Puppeteer.md
Original file line number Diff line number Diff line change
Expand Up @@ -396,16 +396,14 @@ if none provided clears all cookies.

```js
I.clearCookie();
I.clearCookie('test');
I.clearCookie('test'); // Playwright currently doesn't support clear a particular cookie name
```

#### Parameters

- `name`
- `cookie` **[string][6]?** (optional, `null` by default) cookie name

Returns **[Promise][7]&lt;void>** automatically synchronized promise through #recorder

### clearField

Clears a `<textarea>` or text `<input>` element's value.
Expand Down
4 changes: 1 addition & 3 deletions docs/helpers/TestCafe.md
Original file line number Diff line number Diff line change
Expand Up @@ -198,16 +198,14 @@ if none provided clears all cookies.

```js
I.clearCookie();
I.clearCookie('test');
I.clearCookie('test'); // Playwright currently doesn't support clear a particular cookie name
```

#### Parameters

- `cookieName`
- `cookie` **[string][4]?** (optional, `null` by default) cookie name

Returns **[Promise][5]&lt;void>** automatically synchronized promise through #recorder

### clearField

Clears a `<textarea>` or text `<input>` element's value.
Expand Down
4 changes: 1 addition & 3 deletions docs/helpers/WebDriver.md
Original file line number Diff line number Diff line change
Expand Up @@ -554,15 +554,13 @@ if none provided clears all cookies.

```js
I.clearCookie();
I.clearCookie('test');
I.clearCookie('test'); // Playwright currently doesn't support clear a particular cookie name
```

#### Parameters

- `cookie` **[string][17]?** (optional, `null` by default) cookie name

Returns **[Promise][19]&lt;void>** automatically synchronized promise through #recorder

### clearField

Clears a `<textarea>` or text `<input>` element's value.
Expand Down
3 changes: 1 addition & 2 deletions docs/webapi/clearCookie.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ if none provided clears all cookies.

```js
I.clearCookie();
I.clearCookie('test');
I.clearCookie('test'); // Playwright currently doesn't support clear a particular cookie name
```

@param {?string} [cookie=null] (optional, `null` by default) cookie name
@returns {Promise<void>} automatically synchronized promise through #recorder
2 changes: 1 addition & 1 deletion lib/helper/Playwright.js
Original file line number Diff line number Diff line change
Expand Up @@ -1892,7 +1892,7 @@ class Playwright extends Helper {
*/
async clearCookie() {
// Playwright currently doesn't support to delete a certain cookie
// https://github.com/microsoft/playwright/blob/main/docs/src/api/class-browsercontext.md
// https://github.com/microsoft/playwright/blob/main/docs/src/api/class-browsercontext.md#async-method-browsercontextclearcookies
if (!this.browserContext) return;
return this.browserContext.clearCookies();
}
Expand Down
2 changes: 1 addition & 1 deletion typings/tests/helpers/Playwright.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ playwright.setCookie({ name: str, value: str}); // $ExpectType Promise<void>
playwright.seeCookie(str); // $ExpectType Promise<void>
playwright.dontSeeCookie(str); // $ExpectType Promise<void>
playwright.grabCookie(); // $ExpectType any
playwright.clearCookie(); // $ExpectType Promise<void>
playwright.clearCookie(); // $ExpectType void
playwright.executeScript(() => {}); // $ExpectType Promise<any>
playwright.grabTextFrom(str); // $ExpectType Promise<string>
playwright.grabTextFromAll(str); // $ExpectType Promise<string[]>
Expand Down
2 changes: 1 addition & 1 deletion typings/tests/helpers/PlaywrightTs.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ playwright.setCookie({ name: str, value: str}); // $ExpectType Promise<void>
playwright.seeCookie(str); // $ExpectType Promise<void>
playwright.dontSeeCookie(str); // $ExpectType Promise<void>
playwright.grabCookie(); // $ExpectType Promise<any>
playwright.clearCookie(); // $ExpectType Promise<void>
playwright.clearCookie(); // $ExpectType Promise<any>
playwright.executeScript(() => {}); // $ExpectType Promise<any>
playwright.grabTextFrom(str); // $ExpectType Promise<string>
playwright.grabTextFromAll(str); // $ExpectType Promise<string[]>
Expand Down
4 changes: 2 additions & 2 deletions typings/tests/helpers/WebDriverIO.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -272,8 +272,8 @@ wd.setCookie(); // $ExpectError
wd.setCookie({ name: str, value: str }); // $ExpectType Promise<void>
wd.setCookie([{ name: str, value: str }]); // $ExpectType Promise<void>

wd.clearCookie(); // $ExpectType Promise<void>
wd.clearCookie(str); // $ExpectType Promise<void>
wd.clearCookie(); // $ExpectType void
wd.clearCookie(str); // $ExpectType void

wd.seeCookie(); // $ExpectError
wd.seeCookie(str); // $ExpectType Promise<void>
Expand Down

0 comments on commit bdf05e6

Please sign in to comment.