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 - Text Verification
Cypress - Text Verification
方法案文可以用于获取网络内容。 此外,还可增加一些建议,以核查案文内容。
Implementation with text()
Given below is the command for the implementation with text() with regards to verification −
// test suite describe( Tutorialspoint , function () { // it function to identify test it( Scenario 1 , function (){ // test step to launch a URL cy.visit("https://accounts.google.com") // identify element cy.get( h1#headingText ).find( span ).then(function(e){ //method text to obtain text content const t = e.text() expect(t).to.contains( Sign ) }) }) })
产出如下:
产出记录显示用文字方法获得的文本标语。
Implementation with text assertions
我们还可以在以下指挥机构的帮助下,在网络要素文本上执行主张:
// test suite describe( Tutorialspoint , function () { // it function to identify test it( Scenario 1 , function (){ // test step to launch a URL cy.visit("https://accounts.google.com") // verify text with have.text cy.get( h1#headingText ).find( span ).should( have.text , Sign in ) }) })
产出如下:
产出记录显示对案文的核查,应当加以说明。
Advertisements