Gauge Documentation Release 0.9.8
Total Page:16
File Type:pdf, Size:1020Kb
Gauge Documentation Release 0.9.8 Gauge Team Apr 20, 2018 Contents 1 Windows 3 1.1 Using Chocolatey............................................3 2 MacOS 5 3 Linux 7 3.1 On Debian, Ubuntu............................................7 3.2 On RHEL, Fedora, CentOS.......................................7 4 Alternate Methods 9 4.1 Offline Installation............................................9 4.2 Nightly installation............................................ 10 5 Plugins 11 5.1 Language runner............................................. 11 5.2 Reporting plugin............................................. 12 6 Verify your installation 13 7 Uninstallation 15 7.1 Gauge................................................... 15 7.2 Plugins.................................................. 16 8 Quick start 17 8.1 Prerequisites............................................... 17 8.2 Creating a Project............................................ 17 8.3 Running the specs............................................ 18 8.4 Interpret results.............................................. 18 9 Long Start 19 9.1 Why Gauge?............................................... 19 9.2 Gauge Terminologies........................................... 19 10 Using Gauge 29 10.1 Command Line Interface......................................... 29 10.2 Project Structure............................................. 44 10.3 IDE Support............................................... 48 i 11 Syntax 69 11.1 Specification............................................... 69 11.2 Scenario................................................. 69 11.3 Tags.................................................... 69 11.4 Concept.................................................. 70 11.5 Steps................................................... 70 11.6 Parameters................................................ 70 11.7 Special Parameters............................................ 70 11.8 Comments................................................ 71 11.9 Images.................................................. 71 11.10 Links................................................... 71 12 Plugins 73 12.1 Required Plugins............................................. 73 12.2 Language/Reporting Plugins....................................... 73 12.3 IDE plugins................................................ 75 12.4 Build Tools................................................ 75 13 Language Features 77 13.1 Step implementations.......................................... 77 13.2 Execution hooks............................................. 79 13.3 Data Store................................................ 83 13.4 Taking Custom Screenshots....................................... 86 13.5 Custom messages in reports....................................... 87 13.6 Enum as Step parameter......................................... 88 13.7 Continue on Failure........................................... 88 14 Reports 91 14.1 HTML Reports.............................................. 91 14.2 XML Report............................................... 92 14.3 Spectacle................................................. 93 14.4 Flash................................................... 96 15 Configuration 97 15.1 Global.................................................. 97 15.2 Local (Project level)........................................... 98 15.3 Environments............................................... 98 15.4 Language Plugin............................................. 100 15.5 HTTP Proxy............................................... 101 15.6 Build tools................................................ 102 16 Troubleshooting 109 16.1 Logs................................................... 109 16.2 Gauge Installation............................................ 109 16.3 Plugin installation............................................ 110 16.4 Execution................................................. 111 16.5 Intellij idea plugin............................................ 111 17 Examples 113 17.1 Basic................................................... 113 17.2 Web Application............................................. 113 18 HOWTOs 115 18.1 Integrating Gauge with CI/CD tools................................... 115 18.2 Gauge tests on docker.......................................... 122 ii 19 FAQs 125 19.1 Installation................................................ 125 19.2 Execution................................................. 126 19.3 IDE.................................................... 126 19.4 JS FAQs................................................. 128 19.5 Python FAQs............................................... 129 20 Errors 131 20.1 GAUGE-VS-001 : Gauge API Not Started............................... 131 20.2 GAUGE-VS-002 : Incompatible Gauge Version installed........................ 131 20.3 GAUGE-VS-003 : Unable to read Gauge version............................ 132 21 Welcome 133 iii iv Gauge Documentation, Release 0.9.8 Here is the recommended installation steps for all OS. Contents 1 Gauge Documentation, Release 0.9.8 2 Contents CHAPTER 1 Windows 1.1 Using Chocolatey You can install Gauge using Chocolatey as well. choco install gauge If you’re upgrading to a newer version, then use the command: choco upgrade gauge 3 Gauge Documentation, Release 0.9.8 4 Chapter 1. Windows CHAPTER 2 MacOS The following command installs Gauge. For this to work, you will need to install homebrew. If you have brew installed then all you need to run is this command; it will download and install Gauge. This requires you to be connected to the Internet. brew update brew install gauge 5 Gauge Documentation, Release 0.9.8 6 Chapter 2. MacOS CHAPTER 3 Linux 3.1 On Debian, Ubuntu Add Gauge’s GPG key, URL to repository list and install Gauge. sudo apt-key adv --keyserver hkp://pool.sks-keyservers.net --recv-keys 023EDB0B echo deb https://dl.bintray.com/gauge/gauge-deb stable main | sudo tee -a /etc/apt/ ,!sources.list sudo apt-get update sudo apt-get install gauge 3.2 On RHEL, Fedora, CentOS Create file /etc/yum.repos.d/gauge-stable.repo with the following content: [gauge-stable] name=gauge-stable baseurl=http://dl.bintray.com/gauge/gauge-rpm/gauge-stable gpgcheck=0 enabled=1 You can use this command to do it in one step: echo -e "[gauge-stable]\nname=gauge-stable\nbaseurl=http://dl.bintray.com/gauge/gauge- ,!rpm/gauge-stable\ngpgcheck=0\nenabled=1" | sudo tee /etc/yum.repos.d/gauge-stable. ,!repo 3.2.1 Install Install on Fedora: 7 Gauge Documentation, Release 0.9.8 sudo dnf install gauge Install on CentOS/RHEL: sudo yum install gauge Having trouble with installation? Head over to our Installation FAQ’s. 8 Chapter 3. Linux CHAPTER 4 Alternate Methods 4.1 Offline Installation 4.1.1 Windows/MacOS You can download the Gauge archive. This is a zip file. Extract it to a folder and add this to your system path. Check the Language runner to install language runner plugins. 4.1.2 Linux Download the zip file. Choose the archive file appropriate for your installation. And run the command below to install Gauge. unzip gauge-$VERSION-$OS.$ARCH.zip ./install.sh Gauge can be installed at custom location by using GAUGE_PREFIX env. Example :- GAUGE_PREFIX=my/custom/location ./install.sh Gauge Plugins also can be installed along with gauge ( requires Internet). Set GAUGE_PLUGINS ( comma separated list of plugins) env to install plugins. Example :- GAUGE_PLUGINS=java,xml-report ./install.sh 9 Gauge Documentation, Release 0.9.8 4.2 Nightly installation Nightly releases are latest development snapshots of Gauge. They have the latest features being developed, but are unstable. If you want to try out Gauge nightly, do this: 4.2.1 Windows/MacOS Based on your system requirement, you can download the Gauge archive. This is a zip file. Extract it to a folder and add this to your system path. 4.2.2 Linux On Debian, Ubuntu Add Gauge’s GPG key: sudo apt-key adv --keyserver hkp://pool.sks-keyservers.net --recv-keys 023EDB0B Run this command to add URL to repository list: echo deb https://dl.bintray.com/gauge/gauge-deb nightly main | sudo tee -a /etc/apt/ ,!sources.list Install Gauge sudo apt-get update sudo apt-get install gauge On RHEL, Fedora, CentOS create /etc/yum.repos.d/gauge-nightly.repo with the following content: [gauge-nightly] name=gauge-nightly baseurl=http://dl.bintray.com/gauge/gauge-rpm/gauge-nightly gpgcheck=0 enabled=1 You can use this command to do it in one step: echo -e "[gauge-nightly]\nname=gauge-nightly\nbaseurl=http://dl.bintray.com/gauge/ ,!gauge-rpm/gauge-nightly\ngpgcheck=0\nenabled=1" | sudo tee /etc/yum.repos.d/gauge- ,!nightly.repo Install on Fedora: sudo dnf install gauge Install on CentOS/RHEL: sudo yum install gauge Having trouble with installation? Head over to our Installation FAQ’s. 10 Chapter 4. Alternate Methods CHAPTER 5 Plugins 5.1 Language runner 5.1.1C# gauge install csharp 5.1.2 Java gauge install java 5.1.3 Javascript gauge install js 5.1.4 Python gauge install python 5.1.5 Ruby gauge install ruby One can use IDEs to create the projects and run specifications, for this example, we are using the command line options. 11 Gauge Documentation, Release 0.9.8 5.2 Reporting plugin 5.2.1 HTML Reports gauge install html-report 5.2.2 XML Reports gauge install xml-report 12 Chapter 5. Plugins CHAPTER 6 Verify your installation You can check the version of your plugin and Gauge core by executing the following command. gauge version If this enlists a version then you’re intallation and initialisation is has been successful. Your output will