SpecFlow Tutorial
Selected Reading
- SpecFlow - Discussion
- SpecFlow - Useful Resources
- SpecFlow - Quick Guide
- SpecFlow - Table with CreateSet
- Table with CreateInstance
- Table conversion to Dictionary
- Table conversion to Data Table
- Data Driven Testing without Examples
- Data Driven Testing with Examples
- SpecFlow - Background Illustration
- SpecFlow - Hooks
- SpecFlow - Step Definition File
- SpecFlow - Feature File
- SpecFlow - Gherkin Keywords
- SpecFlow - Gherkin
- Configure Selenium Webdriver
- SpecFlow - Creating First Test
- SpecFlow - Binding Test Steps
- SpecFlow - HTML Reports
- SpecFlow - Runner Activation
- Other Project Dependencies
- SpecFlow - Project Set Up
- Visual Studio Extension Installation
- SpecFlow - Visual Studio Installation
- Behaviour Driven Development
- Test Driven Development
- SpecFlow - Introduction
- SpecFlow - Home
Selected Reading
- Who is Who
- Computer Glossary
- HR Interview Questions
- Effective Resume Writing
- Questions and Answers
- UPSC IAS Exams Notes
Data Driven Testing without Examples
SpecFlow - Data Driven Testing without Examples
如果没有关键词Examples的帮助,我们可以进行数据驱动的测试。 可以通过将数据直接传递到(......)所附的“特征档案”内的各项步骤来做到这一点。 然后将提供给《步骤定义文件》。
让我们核实一个单元,需要为此执行以下步骤:
User launches URL
URL should open
Step 1: Create a Feature File
本章——特征文件——详细讨论了如何建立特征档案的细节。
Feature: Launching apppcation Scenario: Launch URL Given User hits URL https://www.tutorialspoint.com/index.htm Then URL should be launched
Step 2: Create a Step Definition File
如何建立步骤定义档案的细节在《——步骤定义文件》中详细讨论。
using System; using TechTalk.SpecFlow; namespace SpecFlowProject1.Features{ [Binding] pubpc class LaunchingApppcationSteps{ [Given(@"User hits URL (.*) ")] pubpc void GivenUserHitsURL(string url){ Console.WriteLine(url); } [Then(@"URL should be launched")] pubpc void ThenURLShouldBeLaunched(){ Console.WriteLine("URL should be launched"); } } }
Step 3: Execution & Results
选择发射应用特征,然后点击“从所有角度进行试验”。
选择发射URL Scenario,然后点击这一结果链接的公开额外产出。
在上述产出中,从地理特征档案中直接提取了圆顶。
Advertisements