【问题标题】:Specflow for UI automation用于 UI 自动化的 Specflow
【发布时间】:2014-12-02 05:46:25
【问题描述】:

对于我们的项目,开发团队遵循 TDD 方法。但是 BA 以相同的示例格式编写用户故事

作为 AN:匿名客户 (ACUST) 我想要:按颜色过滤我的搜索结果 所以:我只能看到我喜欢的颜色的产品

如果 BA 以更通用的格式编写用户故事,开发人员会将用户故事分成多个故事。我们的手动测试人员以 Given-when-then 形式编写测试用例,然后交给自动化测试人员(我们)进行自动化。

作为自动化测试人员,我们让 SBI 拥有与之关联的单个测试用例。

现在我们使用 SpecFlow-Selenium 使用 PageObject 模式来自动化我们的测试用例。并将使用 MTM 将测试脚本与测试用例相关联并从 MTM 运行它们。

我们现在应该如何处理上述场景,我们应该如何在 specflow 中创建我们的场景和特征文件?

任何信息都会很棒。

【问题讨论】:

    标签: selenium-webdriver specflow mtm


    【解决方案1】:

    你应该从快乐的场景开始,比如: (也可以用“场景大纲”代替“常规场景”)

    Feature: filter results page of "Anonymous Customer"
             In order to help anonymous customers to find what their looked for
             As a anonymous customer I want be able to filter my search results   
    
    BACKGROUND:
    GIVEN i am an Anonymous Customer
    AND i am at search results page
    
    SCENARIO: customer filter results by color
    GIVEN the page contains the following items:
             | product name | color | 
             | name1        | blue  |
             | etc....      | etc.. |
    WHEN i filter results by <color X> (for example "blue")
    THEN i should see the following items: <verify existence for the following items> 
             | product name       |
             | name1              |
             | other blue items...|
    

    然后你可以开始检查“坏场景”的行为,只有当它们很重要时(这取决于运行时间、金钱等),例如:

    scenario: customer change the filter color
    scenario: customer remove all filters
    scenario: etc...
    

    无论如何,根据您的描述,测试人员似乎没有将这个故事纳入验收标准

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-05-22
      • 2018-11-17
      • 2020-09-13
      相关资源
      最近更新 更多