Skip to content

Commit

Permalink
Add docs for .selectFile() and Cypress.Buffer
Browse files Browse the repository at this point in the history
This is a manual recreation of #4241 for 9.3.0 release
  • Loading branch information
BlueWinds authored and cowboy committed Jan 14, 2022
1 parent 7fa53cb commit e784cb6
Show file tree
Hide file tree
Showing 24 changed files with 561 additions and 58 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/img/api/selectfile/selectfile-console.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 0 additions & 7 deletions content/_data/plugins.json
Original file line number Diff line number Diff line change
Expand Up @@ -376,13 +376,6 @@
"keywords": ["dragndrop", "drag", "drop", "commands"],
"badge": "community"
},
{
"name": "cypress-file-upload",
"description": "Simple custom command to ease file upload testing",
"link": "https://github.com/abramenal/cypress-file-upload",
"keywords": ["fileupload", "file", "upload", "commands"],
"badge": "community"
},
{
"name": "cypress-fill-command",
"description": "A Cypress command for fill inputs",
Expand Down
8 changes: 8 additions & 0 deletions content/_data/sidebar.json
Original file line number Diff line number Diff line change
Expand Up @@ -636,6 +636,10 @@
"title": "select",
"slug": "select"
},
{
"title": "selectFile",
"slug": "selectfile"
},
{
"title": "server",
"slug": "server"
Expand Down Expand Up @@ -754,6 +758,10 @@
"title": "Blob",
"slug": "blob"
},
{
"title": "Buffer",
"slug": "buffer"
},
{
"title": "minimatch",
"slug": "minimatch"
Expand Down
4 changes: 2 additions & 2 deletions content/api/commands/check.md
Original file line number Diff line number Diff line change
Expand Up @@ -158,8 +158,8 @@ cy.get('#pick-fruit :checked').should('be.checked').and('have.value', 'apple')

#### The element must first reach actionability

`.check()` is an "action command" that follows all the rules
[defined here](/guides/core-concepts/interacting-with-elements).
`.check()` is an "action command" that follows all the rules of
[Actionability](/guides/core-concepts/interacting-with-elements).

## Rules

Expand Down
4 changes: 2 additions & 2 deletions content/api/commands/clear.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ cy.get('textarea').clear().type('Hello, World')

#### The element must first reach actionability

`.clear()` is an "action command" that follows all the rules
[defined here](/guides/core-concepts/interacting-with-elements).
`.clear()` is an "action command" that follows all the rules of
[Actionability](/guides/core-concepts/interacting-with-elements).

### Documentation

Expand Down
4 changes: 2 additions & 2 deletions content/api/commands/click.md
Original file line number Diff line number Diff line change
Expand Up @@ -177,8 +177,8 @@ cy.get('li:first').click({

#### The element must first reach actionability

`.click()` is an "action command" that follows all the rules
[defined here](/guides/core-concepts/interacting-with-elements).
`.click()` is an "action command" that follows all the rules of
[Actionability](/guides/core-concepts/interacting-with-elements).

### Focus

Expand Down
4 changes: 2 additions & 2 deletions content/api/commands/dblclick.md
Original file line number Diff line number Diff line change
Expand Up @@ -178,8 +178,8 @@ cy.get('li:first').dblclick({

#### The element must first reach actionability

`.dblclick()` is an "action command" that follows all the rules
[defined here](/guides/core-concepts/interacting-with-elements).
`.dblclick()` is an "action command" that follows all the rules of
[Actionability](/guides/core-concepts/interacting-with-elements).

## Rules

Expand Down
9 changes: 6 additions & 3 deletions content/api/commands/fixture.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,9 @@ supported:
- `'utf-16le'`
- `null`

Using `null` explicitly will return the fixture as a `Buffer`, regardless of
file extension.
Using `null` explicitly will return the fixture as a
[`Cypress.Buffer`](/api/utilities/buffer) instance, regardless of file
extension.

**<Icon name="angle-right"></Icon> options** **_(Object)_**

Expand Down Expand Up @@ -144,6 +145,7 @@ cy.fixture('images/logo.png', null).then((logo) => {
// logo will be read as a buffer
// and should look something like this:
// Buffer([0, 0, ...])
expect(Cypress.Buffer.isBuffer(logo)).to.be.true
})
```

Expand Down Expand Up @@ -235,7 +237,8 @@ Cypress automatically determines the encoding for the following file types:

For other types of files, they will be read as `utf8` by default, unless
specified in the second argument of `cy.fixture()`. You can specify `null` as
the encoding in order to read the file as a `Buffer` instead.
the encoding in order to read the file as a
[`Cypress.Buffer`](/api/utilities/buffer) instance instead.

### `this` context

Expand Down
3 changes: 2 additions & 1 deletion content/api/commands/readfile.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ supported:
- `'utf-16le'`
- `null`

Using `null` explicitly will return the file as a `Buffer`, regardless of file
Using `null` explicitly will return the file as a
[`Cypress.Buffer`](/api/utilities/buffer) instance, regardless of file
extension.

**<Icon name="angle-right"></Icon> options** **_(Object)_**
Expand Down
4 changes: 2 additions & 2 deletions content/api/commands/rightclick.md
Original file line number Diff line number Diff line change
Expand Up @@ -185,8 +185,8 @@ cy.get('.menu-item').rightclick({

#### The element must first reach actionability

`.rightclick()` is an "action command" that follows all the rules
[defined here](/guides/core-concepts/interacting-with-elements).
`.rightclick()` is an "action command" that follows all the rules of
[Actionability](/guides/core-concepts/interacting-with-elements).

## Rules

Expand Down
4 changes: 2 additions & 2 deletions content/api/commands/scrollto.md
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,8 @@ cy.get('table').find('tr:last-child').should('be.visible')

### Actionability

`cy.scrollTo()` is an "action command" that follows all the rules
[defined here](/guides/core-concepts/interacting-with-elements).
`cy.scrollTo()` is an "action command" that follows all the rules of
[Actionability](/guides/core-concepts/interacting-with-elements).

### Scopes

Expand Down
4 changes: 2 additions & 2 deletions content/api/commands/select.md
Original file line number Diff line number Diff line change
Expand Up @@ -238,8 +238,8 @@ cy.get('select#name option:selected').should('have.text', 'Peter')

### Actionability

`.select()` is an action command that follows the rules
[defined here](/guides/core-concepts/interacting-with-elements).
`.select()` is an action command that follows the rules of
[Actionability](/guides/core-concepts/interacting-with-elements).

However, passing `{ force: true }` to `.select()` will not override the
actionability checks for selecting a disabled `<option>` or an option within a
Expand Down
Loading

0 comments on commit e784cb6

Please sign in to comment.