Skip to content

Commit b6aa408

Browse files
committed
fix cy.origin() "yielding a value" example
1 parent 7626c57 commit b6aa408

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

docs/api/commands/origin.mdx

+3-3
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ will not work:
191191
cy.origin('https://example.cypress.io', () => {
192192
cy.visit('/')
193193
cy.get('h1') // Yields an element, which can't be serialized...
194-
}).contains('CYPRESS') // ...so this will fail
194+
}).contains('Kitchen Sink') // ...so this will fail
195195
```
196196

197197
Instead, you must explicitly yield a serializable value:
@@ -201,8 +201,8 @@ Instead, you must explicitly yield a serializable value:
201201
```js
202202
cy.origin('https://example.cypress.io', () => {
203203
cy.visit('/')
204-
cy.get('h1').invoke('textContent') // Yields a string...
205-
}).should('equal', 'CYPRESS') // 👍
204+
cy.get('h1').invoke('text') // Yields a string...
205+
}).should('equal', 'Kitchen Sink') // 👍
206206
```
207207

208208
### Navigating to secondary origin with cy.visit

0 commit comments

Comments
 (0)