Skip to main content

Provides basic steps for a Gauge project, that runs tests with Selenium and Appium

Project description

gauge-web-app-steps

License: MIT Python 3.10 Selenium Appium Gauge SauceLabs OpenSSF Scorecard

A Python module, that provides re-usable steps for testing web applications with the Gauge framework. Development on native app testing has only just started.

Description

This is an extensible and flexible test-automation library for Gauge. It enables users with and without programming knowledge to create end-to-end test scenarios in Markdown syntax. Developers can still easily extend their test scenarios with custom code. Selenium and Appium are used to simulate user interaction with the browser. A wide range of platforms and browsers are supported. Tests can also be executed on devices and emulators in the SauceLabs cloud.

Gauge Step Overview

Find the documentation on all Gauge steps of this project in the overview:

Gauge Step Overview

Quick Start

This is a library for the Gauge framework, so Gauge+Python must be installed first.

It is useful to understand the basic workings of Gauge first. The documentation is excellent.

  • Install this module
  • Find out the path to this module after installation:
    echo $( python -m site --user-site )/gauge_web_app_steps
    
  • Add that path to the property STEP_IMPL_DIR inside the test project file env/default/python.properties. Paths to multiple modules are comma separated.
    Example on a Mac:
    STEP_IMPL_DIR = /Users/<user>/Library/Python/3.10/lib/python/site-packages/gauge_web_app_steps, step_impl
    
  • Reload Visual Studio Code
  • Write a new scenario in specs/example.spec. VSC offers auto-completion

Installation

This module can be installed from source:

cd path/to/gauge-web-app-steps
pip install --user .

Or the latest package can be downloaded and installed from PyPi:

pip install gauge-web-app-steps --user --upgrade

Development

When coding on this project, unit tests can be executed like this:

TEST_SKIP_IT=1 python -m unittest discover -v -s tests/ -p 'test_*.py'

Contributions are welcome.

Troubleshooting

Some known inter-operability issues can be found on the troubleshooting page. If things don't work immediately, a solution might already be documented there.

Configuration

The Configuration follows the Gauge configuration approach. A lot of behaviour, including the browsers and devices to use for the tests, can be determined with properties.

Configuration Overview

Expressions in Parameters

Property Placeholders

Step parameters allow the use of placeholders, that can be defined in the Gauge environment properties files. Some steps also allow to set a placeholder value manually. Property keys act as placeholders, they are defined like ${key}. They will be replaced by its value if such a property key/value pair exists in any env/*/*.properties file or within the execution scope.

Mathematical Expressions

Mathematical expressions can also be evaluated. For example: #{5 + 5 * 5} is evaluated to 30.

It is possible to combine the two features. Placeholder substitution takes place before mathematical expression evaluation.

Functional Expressions

Functional expressions will generate a result during step execution. There are 2 expressions: One will generate a UUID, and the other will yield the current date and time: !{uuid}, !{time}, !{time:%Y-%m-%d}. The time format is optional, if omitted ISO format will be used. The time format pattern is described in the Python language documentation.

Expression Examples

Note that the property expressions start with $, mathematical expressions with #, and functional expressions with !.

* Open "${homepage_url}/home"

* Assert "id" = "sum" equals "#{5 + 6}"

* Assert "id" = "sum" equals "#{$addend + 5 * 5}"

* Type "!{uuid}"

* Type "!{time}"

* Type "!{time:%Y-%m-%d}"

The property "homepage_url" can be defined in env/default/test.properties like this:

homepage_url = https://my-app.net

It is also possible to define a property in a step:

* Save placeholder "addend" = "5"

Maintainers

Maintainers

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gauge-web-app-steps-0.63.tar.gz (32.7 kB view details)

Uploaded Source

Built Distribution

gauge_web_app_steps-0.63-py3-none-any.whl (37.7 kB view details)

Uploaded Python 3

File details

Details for the file gauge-web-app-steps-0.63.tar.gz.

File metadata

  • Download URL: gauge-web-app-steps-0.63.tar.gz
  • Upload date:
  • Size: 32.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/4.0.2 CPython/3.11.10

File hashes

Hashes for gauge-web-app-steps-0.63.tar.gz
Algorithm Hash digest
SHA256 dd4893fe0ea6b4f9319cf46894351a940bb3ec6f81bf3593ab3808c1777d512d
MD5 a3c2815fce49c12b926b3b7f245cc1d9
BLAKE2b-256 48bb3f3ebbf4c16ddf092006a222d61786421266197ef2021728728c92c74423

See more details on using hashes here.

File details

Details for the file gauge_web_app_steps-0.63-py3-none-any.whl.

File metadata

File hashes

Hashes for gauge_web_app_steps-0.63-py3-none-any.whl
Algorithm Hash digest
SHA256 4a9dab1fb9b1dee1369e17cf35479dbb16c4b4630612bf5f1ad881da5b65ea1d
MD5 155f52eac94f40bb8cd626d58cefebc0
BLAKE2b-256 100d96d2afafccf0d6d48b1bee35fc1bf7445d69203c3653a009250fa7be45b5

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page