简体   繁体   English

没有 URL 的自动化测试

[英]Automation testing with no URL

We are provided with gherkins and asked to create feature files and perform automation testing when only UI prototypes are available and there is no URL provided.我们提供了小黄瓜,并要求我们在只有 UI 原型可用且未提供 URL 时创建功能文件并执行自动化测试。 Is there a way to perform testing when there is no url available?当没有可用的 url 时,有没有办法进行测试?

You can "write" tests when there is no URL available by using the Gherkin format.当没有可用的 URL 时,您可以使用 Gherkin 格式“编写”测试。 Here's an example for some calculator tests:以下是一些计算器测试的示例:

Feature: Scenarios for the Calculator App

  Background:
    Given Open the Calculator App

  Scenario: Pressing "C" outputs "0"
    When Press C
    Then Verify output is "0"

  Scenario: 1 + 2 + 3 + 4 + 5 = 15
    When Press C
    And Press 1
    And Press +
    And Press 2
    And Press +
    And Press 3
    And Press +
    And Press 4
    And Press +
    And Press 5
    And Press =
    Then Verify output is "15"

  Scenario: 6 × 7 × 8 × 9 = 3024
    When Press C
    And Press 6
    And Press ×
    And Press 7
    And Press ×
    And Press 8
    And Press ×
    And Press 9
    And Press =
    Then Verify output is "3024"

(The above examples of a Gherkin feature file were taken from the SeleniumBase Behave-BDD examples folder , which I wrote. It requires a steps file with definitions in order to work.) (上面的 Gherkin 功能文件示例取自我编写的SeleniumBase Behave-BDD 示例文件夹。它需要一个带有定义的步骤文件才能工作。)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM