前言
在 Cypress 中引用窗口和窗口上其他屬性的示例
cy.window()
要獲取全局窗口對象,請使用cy.window()命令。
cy.window().should('have.property', 'top')
cy.document()
To get the document object, use the cy.document() command.
要獲取document對象,請使用cy.document()命令。
cy.document().should('have.property', 'charset').and('eq', 'UTF-8')
cy.title()
要獲取標題,請使用cy.title()命令。
cy.title().should('include', 'Kitchen Sink')
