Skip to content

Latest commit

 

History

History
450 lines (269 loc) · 12.8 KB

faqs.rst

File metadata and controls

450 lines (269 loc) · 12.8 KB
.. cssclass:: topic

FAQs

This page lists FAQs (Frequently Asked Questions) about installing Gauge, running a Gauge specification (spec), configuring Gauge, language runners used with Gauge, and using text editors while writing a Gauge spec. To understand these concepts, see Gauge Documentation.

.. cssclass:: category-title

Installation

Where is the Gauge executable installed by default?

Where are the plugins installed by default?

What is GAUGE_HOME?

How can I manually install a plugin?

.. cssclass:: category-title

Configuration

How can I increase the language runner timeout?

.. cssclass:: category-title

Execution

What is the order of execution of scenarios in a specification?

Why we cannot skip all tests dynamically during a gauge run if there is a test failure?

.. cssclass:: category-title

Logs

Where does gauge log the test execution output. warnings, validation results etc

Where can I find gauge API logs for debugging IDE plugins

How can I customize the log directory location

Where does gauge non project specific logs like plugin installation etc.

.. cssclass:: category-title

Uninstall Gauge

How can I uninstall Gauge

.. cssclass:: category-title

Gauge JavaScript

How to debug without IDE

.. cssclass:: category-title

Gauge Python

How to change/rename default step implementation(step_impl) directory

How to use different version of python while running specs

How to debug gauge-python without using an IDE

.. cssclass:: category-title

I don't see my question here

If you have any questions that are not answered you can get help from our Github.

.. cssclass:: category

Installation

.. cssclass:: question

Where is the Gauge executable installed by default?

.. cssclass:: answer

Windows

%ProgramFiles%\gauge\bin

macOS

/usr/local/bin

linux

/usr/local/bin

.. cssclass:: question

Where are the plugins installed by default?

Windows

%APPDATA%\gauge\plugins

macOS

~/.gauge/plugins

linux

~/.gauge/plugins

.. cssclass:: question

What is GAUGE_HOME?

GAUGE_HOME environment variable can be used to customize config files and plugins installation location.

.. cssclass:: question

How can I manually install a plugin?

Download the plugin's zip file from github release and install the plugin by using the -f flag.

gauge install <plugin_name> -f <path_to_gauge_csharp_zip_file>
.. cssclass:: category

Configuration

Note

Gauge specific properties are stored in gauge.properties under gauge configuration folder. Refer to :ref:`Gauge Properties<gauge_properties>`.

.. cssclass:: question

How can I increase the language runner timeout?

By setting

runner_connection_timeout = 3000
.. cssclass:: category

Execution

.. cssclass:: question

What is the order of execution of scenarios in a specification?

The scenarios should execute in the order they are specified when running in serial mode. But, when executed in parallel or when a scenario/specification uses a data table (data driven tests), all scenarios are parallelized and hence there will not be any order maintained.

We suggest that scenarios should be independent of each other.

.. cssclass:: question

Why we cannot skip all tests dynamically during a gauge run if there is a test failure?

If execution of a step fails, that step is marked as failed and execution of further steps in that scenario will be skipped and the execution of the next scenario begins. This is done because we encourage scenarios to be independent of each other.

.. cssclass:: category

Logs

.. cssclass:: question

Where does gauge log the test execution output. warnings, validation results etc?

You'll find the logged at logs/gauge.log in your projects directory.

Note

logs is the default location for log files. This can be changed using logs_directory in :ref:`project's properties<default_properties>`.

.. cssclass:: question

Where can I find gauge API logs for debugging IDE plugins?

You'll find that at logs/api.log in your projects directory.

Note

logs is the default location for log files. This can be changed using logs_directory in :ref:`project's properties<default_properties>`.

.. cssclass:: question

How can I customize the log directory location?

You can specify a custom directory by changing the logs_directory property under env/default/default.properties Refer to :ref:`project's properties<default_properties>`.

logs_directory = my_custom_log_directory
.. cssclass:: question

Where does gauge non project specific logs like plugin installation etc.?

Windows

%APPDATA%\gauge\logs

macOS

~/.gauge/logs

linux

~/.gauge/logs

.. cssclass:: category

Uninstalling Gauge

.. cssclass:: question

How can I uninstall Gauge?

Remove the Plugins before uninstalling Gauge. For information about removing plugins, see :ref:`plugins-uninstallation`.

Prerequisite

Remove the Plugins before uninstalling Gauge. For information about removing plugins, see :ref:`plugins-uninstallation`.

While uninstalling Gauge, you must remove the Gauge folder (~/.gauge in Mac/Linux and in %APPDATA%Gauge in windows) manually. This folder contains Gauge config, logs and plugins.

Windows

Uninstall Gauge by using Chocolatey .

choco uninstall gauge
macOS

Uninstall Gauge by using HomeBrew .

brew uninstall gauge
Debian/APT

Uninstall Gauge by using the apt-get command:

sudo apt-get remove gauge
YUM/DNF

You can uninstall Gauge in one of the following ways:

Uninstall by using yum.

yum remove gauge

OR

Uninstall by using dnf.

dnf remove gauge
Freebsd

Delete the Gauge files from the installed location.

Curl

Delete the Gauge files from the installed location.

NPM

Uninstall Gauge by using npm.

npm uninstall -g @getgauge/cli

Note

If you have installed Gauge on your system by downloading the Gauge release from GitHub, then delete the Gauge files from the installed location.

.. cssclass:: category

Gauge JavaScript

.. cssclass:: question

How to debug without IDE

gauge-js supports debugging your test implementation code using node-inspector.

Requirements

Ensure you have the latest Chrome browser and node-inspector installed. Please consult the node-inspector documentation for installation instructions. Ensure that the binaries node-debug and node-inspector are available on PATH. Starting gauge-js with debugger You can do either of these:

Set the DEBUG key to true in env/<env-name>/js.properties file in your gauge project. Set the environment variable DEBUG=true when calling gauge. Like: DEBUG=true gauge specs/. This needs gauge v0.3.2 or newer.

How it works

Setting the debug option will launch the runner code through node-debug. It will start node-inspector, launch Chrome DevTools and pause on the first line of execution. You will need to continue execution to let gauge carry on with its execution.

You can set debugger; inside step implementation or hook callbacks to pause execution in the debugger. This retains the gauge context and gives you a full blown debugger to debug your test implementations.

Example:

gauge.step("There are <num> vowels.", function (num) {
    debugger;
    assert.equal(num, 5);
});

This will pause the debugger when this step's callback is executed by gauge-js.

Caveats

The debugger exposes entire gauge-js runner code. You need to be quick enough to hit continue in the browser when node-inspector launches. If this takes too long, gauge will timeout connecting to the API. A workaround for this is to increase the runner_connection_timeout property to an acceptable value.

.. cssclass:: category

Gauge Python

.. cssclass:: question

How to change/rename default step implementation(step_impl) directory

Create python.properties file in the <PROJECT_DIR>/env/default directory and add the following line to it.

STEP_IMPL_DIR = PATH_TO_STEP_IMPLEMENTATION_DIR

Note

The path specified in STEP_IMPL_DIR property should be relative to project root.

.. cssclass:: question

How to use different version of python while running specs

By default the language runner uses python command to run specs. To change the default behaviour, add GAUGE_PYTHON_COMMAND property to the python.properties file in the <PROJECT_DIR>/env/default directory.

GAUGE_PYTHON_COMMAND = <python_command>
GAUGE_PYTHON_COMMAND = python3
GAUGE_PYTHON_COMMAND = python2
.. cssclass:: question

How to debug gauge-python without using an IDE

Gauge-Python supports debugging your test implementation code using pbd.

import pdb

The typical usage to break into the debugger from a running program is to insert

pdb.set_trace()

Execution will stop where it finds the above statement and you can debug.

.. cssclass:: category

Gauge VS Code

.. cssclass:: question

Why are some features not working?

If you notice that any of the documented features (ex. goto definition, Code Lens of implementation files, find usages) are not working then make sure the required language runner is installed, by running gauge version. If not installed, install using gauge install <plugin_name>.

.. cssclass:: question

Why does the debugger not stop at the right breakpoint (gauge-java)?

In Java projects, if the debugger does not stop at the right breakpoint, it is related to this issue.