kieker-monitoring / kieker

Kieker's main repository
Apache License 2.0
70 stars 41 forks source link

[KIEKER-1048] Functional (automatic) regression tests for Web GUI #2771

Closed rju closed 1 week ago

rju commented 1 week ago

JIRA Issue: KIEKER-1048 Functional (automatic) regression tests for Web GUI Original Reporter: Andre van Hoorn


As discussed today. Framework should support integration into CI.

Jonas, Oliver, Fabian: You mentioned a tool based on Selenium , right?

Would be nice to have a simple demo based on the Kieker WebGUI on one of the upcoming regular meetings.

rju commented 1 week ago

author Fabian Keller -- Mon, 25 Nov 2013 23:09:22 +0100

Web automation testing can be easily achieved by writing tests using a syntax related to Gherkin's syntax. Thus tests are easy to read, to understand and to write. In order to translate the test language into executable code, we need a framework like jBehave, which maps the step definitions to methods in order to have an executable version of the tests.

A combination of jBehave and Selenium Webdriver can be used to automate web regression testing. There is a github repository demonstrating how to setup the two tools to work together.

To automatically run the tests in the cloud SauceLabs provides a free plan for open source projects like TravisCI for Continous Integration, which can also run the tests on mobile devices and all major browsers.

Personally, I use these tests to automatically do functional regression testing of websites and web applications developed in PHP. For PHP there is a handy framework which already supplies a lot of the step definitions commonly needed. The following list is an excerpt of the frameworks' definitions to underline how powerful the tools work together:

Given I am on the homepage
    - Opens homepage.

Given I am on "page"
    - Opens specified page.

 When I move backward one page
    - Moves backward one page in history.

 When I press "button"
    - Presses button with specified id|name|title|alt|value.

 When I follow "link"
    - Clicks link with specified id|title|alt|text.

 When I fill in "field" with "value"
    - Fills in form field with specified id|name|label|value.

 When I select "option" from "select"
    - Selects option in select field with specified id|name|label|value.

 When I additionally select "option" from "select"
    - Selects additional option in select field with specified id|name|label|value.

 When I check "option"
    - Checks checkbox with specified id|name|label|value.

 When I attach the file "..." to "field"
    - Attaches file to field with specified id|name|label|value.

 Then I should be on "page"
    - Checks, that current page PATH is equal to specified.

 Then the url should match pattern "..."
    - Checks, that current page PATH matches regular expression.

An example of a real test case that tests the search function of Wikipedia:

Feature: Search
  In order to see a word definition
  As a website user
  I need to be able to search for a word

  Scenario: Searching for a page that does exist
    Given I am on "/wiki/Main_Page"
    When I fill in "search" with "Behavior Driven Development"
    And I press "searchButton"
    Then I should see "agile software development"

  Scenario: Searching for a page that does NOT exist
    Given I am on "/wiki/Main_Page"
    When I fill in "search" with "Glory Driven Development"
    And I press "searchButton"
    Then I should see "Search results"
rju commented 1 week ago

author André van Hoorn -- Tue, 8 Aug 2017 22:47:43 +0200

Closed because WebGUI to be retired.