Cypress学习文档

沉淀cypress对常用html组件定位的文档


App Action (暂不考虑)

<h1>Testing with App Actions</h1> <h2>1.说明</h2> <p>Cypress运行在浏览器之内,并且和你的应用程序运行在同一生命周期,这意味着Cypress可以直接访问和控制应用程序本身的行为。</p> <p>而这种直接控制应用程序到达要测试所需状态的能力,就是“App Action”。</p> <p>与 PageObject模式相比,App Action更有优势。</p> <h2>2.cy.window</h2> <p>Get the window object of the page that is currently active. 一些用法</p> <pre><code>cy.window().its('tags.foo').should('equal', 'bar') .. cy.window().its('sessionStorage') // Get the 'sessionStorage' property</code></pre> <h1>4. Reference</h1> <p>[1.] <a href="https://docs.cypress.io/api/commands/window#Syntax">cy.window()</a> [2.] <a href="https://www.cypress.io/blog/2019/02/28/shrink-the-untestable-code-with-app-actions-and-effects/#Testing-with-App-Actions">App Actions And Effects</a> [3.] <a href="https://github.com/bahmutov/overmind-demo-1-react">An Example for App Action</a> [4.] <a href="https://www.cypress.io/blog/2019/01/03/stop-using-page-objects-and-start-using-app-actions/#page-objects">Stop using Page Objects and Start using App Actions</a></p>

页面列表

ITEM_HTML