Add example for location.href - also should example (#4702)

This commit is contained in:
Jennifer Shehane
2019-07-13 00:29:53 +06:30
committed by Zach Bloomquist
parent fbd523615e
commit 5963b1eff8
+5
View File
@@ -846,6 +846,8 @@ declare namespace Cypress {
* @example
* cy.location('host') // Get the host of the location object
* cy.location('port') // Get the port of the location object
* // Assert on the href of the location
* cy.location('href').should('contain', '/tag/tutorials')
*/
location(key: string, options?: Partial<Loggable & Timeoutable>): Chainable<Location>
@@ -1276,6 +1278,9 @@ declare namespace Cypress {
* Create an assertion. Assertions are automatically retried until they pass or time out.
*
* @see https://on.cypress.io/should
* @example
* // Assert on the href of the location
* cy.location('href').should('contain', '/tag/tutorials/')
*/
should: Chainer<Subject>