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 - Data Driven Testing
Cypress - Data Driven Testing
在固定装置的帮助下,进行了风化数据驱动测试。 添加气压装置,以保持和掌握自动化测试数据。
固定装置在Cypress项目夹(Example.json文档)内。 基本上,它帮助我们从外部档案中获得数据投入。
气压固定装置的夹可在 Java本末端(JSON)或其他格式有文档,数据以“钥匙:价值”为平。
所有测试数据都可以通过一次以上的测试加以利用。 所有固定装置数据必须在前栏目中公布。
Syntax
The syntax for Cypress data Drive test is as follows -
cy.fixture(path of test data) cy.fixture(path of test data, encoding type) cy.fixture(path of test data, opts) cy.fixture(path of test data, encoding type, options)
这里
编码类型——编码类型(tf-8, asci,等等)用于读文档。
Opts − Modifies the timeout for response. The default value is 30000ms. The wait time for cy.fixture(), prior throws an exception.
Implementation in example.json
下面是采用数据驱动测试。 json in Cypress -
{ "email": "abctest@gmail.com", "password": "Test@123" }
Implementation of Actual Test
在Cypress实施实际数据驱动测试如下:
describe( Tutorialspoint Test , function () { //part of before hook before(function(){ //access fixture data cy.fixture( example ).then(function(signInData){ this.signInData = signInData }) }) // test case it( Test Case1 , function (){ // launch URL cy.visit("https://www.pnkedin.com/") //data driven from fixture cy.get( #session_key ) .type(this.signInData.email) cy.get( # session_password ).type(this.signInData.password) }); });
产出如下:
产出记录显示,将分送电子邮件和密码田的数值分别为abctest@gmail.com和 Test@123。 这些数据已经通过固定装置进行测试。
Advertisements