Home > Net >  Automation testing with no URL
Automation testing with no URL

Time:06-11

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. Is there a way to perform testing when there is no url available?

CodePudding user response:

You can "write" tests when there is no URL available by using the Gherkin format. 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.)

  • Related