Cypress Tutorial
Selected Reading
- Cypress - Discussion
- Cypress - Useful Resources
- Cypress - Quick Guide
- Cypress - GitHub
- Cypress - Plugins
- Cypress - Reports
- Cypress - Configuration of JSON File
- Cypress - Hooks
- Cypress - Environment Variables
- Cypress - Fixtures
- Cypress - Custom Commands
- Cypress - Debugging
- Cypress - Screenshots and Videos
- Cypress - Dashboards
- Cypress - Prompt Pop-up Window
- Cypress - Data Driven Testing
- Cypress - File Upload
- Cypress - Get and Post
- Cypress - Cookies
- Cypress - Mouse Actions
- Cypress - Web Tables
- Cypress - Frames
- Cypress - Hidden Elements
- Cypress - Child Windows
- Cypress - Alerts
- Cypress - Dropdown
- Cypress - Tabs
- Cypress - Checkbox
- Cypress - jQuery
- Cypress - Working with XHR
- Cypress - Asynchronous Behavior
- Cypress - Text Verification
- Cypress - Assertions
- Cypress - Locators
- Cypress - Aliases
- Cypress - Variables
- Cypress - Basic Commands
- Cypress - Supported Browsers
- Cypress - Build First Test
- Cypress - Test Runner
- Cypress - Architecture and Environment Setup
- Cypress - Introduction
- Cypress - Home
Selected Reading
- Who is Who
- Computer Glossary
- HR Interview Questions
- Effective Resume Writing
- Questions and Answers
- UPSC IAS Exams Notes
Cypress - Hidden Elements
Cypress - Hidden Elements
风暴能够处理隐藏的元素。 有时,子宫只被 h在主菜.上。 这些子动物最初被隐藏在Cascading上型谢物(CSS)上:无。
在处理隐蔽元素时,Cypress利用 j法显示的帮助。 必须在Cypress指挥部的帮助下援引。
For example, on hovering over the Sign in menu, the Sign in button gets displayed, as shown below −
![Sign in](/cypress/images/sign_in.jpg)
On在把 mo子从 Sign子中搬出时, Sign子的签字被隐藏起来,如下所示。
![Sign in Menu](/cypress/images/sign_in_menu.jpg)
Implementation
采用“ j show”法的隐藏元素如下:
describe( Tutorialspoint Test , function () { // test case it( Scenario 1 , function (){ // launch URL cy.visit("https://www.amazon.com/"); // show hidden element with invoke cy.get( #nav-flyout-ya-signin ).invoke( show ); //cpck hidden element cy.contains( Sign ).cpck(); }); });
产出如下:
![jQuery show](/cypress/images/jquery_show.jpg)
describe( Tutorialspoint Test , function () { // test case it( Scenario 1 , function (){ // launch URL cy.visit("https://www.amazon.com/"); // show hidden element with invoke cy.get( #nav-flyout-ya-signin ).invoke( show ); //cpck hidden element cy.contains( Sign ).cpck(); }); });
Execution Results
产出如下:
![Hidden Elements with jQuery](/cypress/images/hidden_elements_with_jquery.jpg)
执行记录显示由icon代表的隐藏要素是步骤的权利。
热带风暴具有另一种处理隐蔽元素的技术。
例如,为了点击一个隐蔽的元素,我们可以点击Cypress指挥,并通过选项{force:真实}作为参数,点击(力量:真实})。
这改变了隐藏元素的隐蔽特征,我们可以点击。
Implementation with cpck
下面是用点击在Cypress实施。
describe( Tutorialspoint Test , function () { // test case it( Scenario 1 , function (){ // launch URL cy.visit("https://www.amazon.com/"); //cpck hidden element cy.contains( Sign ).cpck({force:true}); }); });
产出如下:
![Implementation with Cpck](/cypress/images/implementation_with_cpck.jpg)
处决记录显示被点击的隐性元素(Sign in),我们被浏览到下页。
Advertisements