Skip to content

Commit

Permalink
add window page
Browse files Browse the repository at this point in the history
  • Loading branch information
bahmutov committed Apr 23, 2020
1 parent ac9d95c commit fdf3e51
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docs/.vuepress/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@ module.exports = {
[
'script',
{
src:
'https://code.jquery.com/jquery-3.4.1.slim.min.js',
src: 'https://code.jquery.com/jquery-3.4.1.slim.min.js',
integrity:
'sha256-pasqAKBDmFT4eHoN2ndd6lN370kFiGUFyTiUHWhU7k8=',
crossorigin: 'anonymous',
Expand All @@ -47,6 +46,7 @@ module.exports = {
link: '/commands/traversal/',
},
{ text: 'Actions', link: '/commands/actions/' },
{ text: 'Window', link: '/commands/window/' },
{
text: 'Navigation',
link: '/commands/navigation/',
Expand Down
45 changes: 45 additions & 0 deletions docs/commands/window.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# Window

Examples of referencing window and other properties on window in Cypress, for a full reference of commands, go to [docs.cypress.io](https://on.cypress.io/api)

## [cy.window()](https://on.cypress.io/window)

To get the global window object, use the `cy.window()` command.

<!-- fiddle window -->

```js
cy.window().should('have.property', 'top')
```

<!-- fiddle-end -->

## [cy.document()](https://on.cypress.io/document)

To get the document object, use the `cy.document()` command.

<!-- fiddle document -->

```js
cy.document().should('have.property', 'charset').and('eq', 'UTF-8')
```

<!-- fiddle-end -->

## [cy.title()](https://on.cypress.io/title)

To get the title, use the `cy.title()` command.

<!-- fiddle title -->

```html
<script>
document.title = 'Kitchen Sink'
</script>
```

```js
cy.title().should('include', 'Kitchen Sink')
```

<!-- fiddle-end -->
1 change: 1 addition & 0 deletions md-to-js.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ echo "Each spec file will visit $BASE_URL before tests in each spec"
npx export-fiddle docs/commands/querying.md --before $BASE_URL/commands/querying
npx export-fiddle docs/commands/traversal.md --before $BASE_URL/commands/traversal
npx export-fiddle docs/commands/actions.md --before $BASE_URL/commands/actions
npx export-fiddle docs/commands/window.md --before $BASE_URL/commands/window
npx export-fiddle docs/commands/navigation.md --before $BASE_URL
npx export-fiddle docs/commands/connectors.md --before $BASE_URL/commands/connectors
npx export-fiddle docs/commands/spies_stubs_clocks.md --before $BASE_URL/commands/spies_stubs_clocks
Expand Down

0 comments on commit fdf3e51

Please sign in to comment.