Skip to content

Instantly share code, notes, and snippets.

@wa1one
Created August 9, 2019 07:46
Show Gist options
  • Save wa1one/b1efa0b4ad2122c9240d7456d0791b67 to your computer and use it in GitHub Desktop.
Save wa1one/b1efa0b4ad2122c9240d7456d0791b67 to your computer and use it in GitHub Desktop.
# Environment settings
1. Install Java [JDK](http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html)
2. Install Intellij [IDE](https://www.jetbrains.com/idea/)
3. Install Gradle build system. [More details](https://gradle.org/install/)
4. Open project with tests in IDE
5. Open in IDE *File* -> *Project Structure* set project SDK. Click *New* -> + *JDK*. Set path to installed JDK
6. Open in IDE *File* -> *Settings* -> *Plugins*. Search plugin "*Cucumber for Java*". IDE displayed "No plugins found". Click "Search in repositories". Click *Install*
7. At **HooksWeb** change ip and port of application
8. At **HooksWeb** change all path on your path
- Runtime.getRuntime().exec(..
9. Refresh project with tests.
# To run tests from command line
1. Open folder with project
2. Open file build.greadle by text redactor
3. Select in 25 row build.gradle feature you need to test, for example:
-- 'src/main/resources/' - means all features from resources will run
--'src/main/resources/Console.feature' - means only Console.feature will run
4. Save your changes
5. Run TSHMI on http://localhost:8000
6. In folder with tests project open console (cmd or Git Bash)
7. Execute ***gradle cucumber***
# Passing arguments from command line
to pass IP address:
-Dip - IP (default=172.31.239.158)
to pass port:
-Dport - port (default=8444)
to reboot unit before start:
-Dreboot - bool (default=false)
Example: gradle cucumber -Dip=111.111.111 -Dport=8081 -Dreboot=true
# FOR run cucumber tests on Ubuntu 18.04:
## Environment settings
1. Install Git
* we should start out by running general OS and package updates. On Ubuntu we�~@~Yll do this by running:
**$ apt-get update**;
* install Git:
**$ sudo apt install git**;
* check git version:
**$ git --version**;
@wa1one
Copy link
Author

wa1one commented Aug 9, 2019

Install the default JDK

  • execute the following command to install OpenJDK:
    $ sudo apt install default-jre;
    $ sudo apt install default-jdk
  • check java version:
    $ java -version;
  • setting the JAVA_HOME Environment Variable:
    • Use the update-alternatives command:
      $ sudo update-alternatives --config java;
    • Copy the path from your preferred installation. Then open /etc/environment using nano or your favorite text editor:
      $ sudo nano /etc/environment
    • At the end of this file, add the following line, making sure to replace the highlighted path with your own copied path: -->
      JAVA_HOME="/usr/lib/jvm/java-11-openjdk-amd64/"
    • Modifying this file will set the JAVA_HOME path for all users on your system. Save the file and exit the editor.
      Important: delete "bin/java" from the end of the path!
    • example: /usr/lib/jvm/java-11-openjdk-amd64/
    • Now reload this file to apply the changes to your current session:
      $ source /etc/environment
    • Verify that the environment variable is set:
      $ echo $JAVA_HOME;
  1. Install Gradle
  • Start by downloading the Gradle Binary-only zip file in the /tmp directory using the following wget command:
    $ wget https://services.gradle.org/distributions/gradle-5.2.1-bin.zip -P /tmp;
  • Once the download is completed, extract the zip file in the /opt/gradle directory:-->
    $ sudo unzip -d /opt/gradle /tmp/gradle-5.2.1-bin.zip
  • Verify that the Gradle files are extracted by listing the /opt/gradle/gradle-5.0 directory: -->
    $ ls /opt/gradle/gradle-5.2.1;
  • Setup environment variables:
    • open your text editor and create a new file named gradle.sh inside of the /etc/profile.d/ directory.:
      $ sudo nano /etc/profile.d/gradle.sh
    • Paste the following configuration:
      export GRADLE_HOME=/opt/gradle/gradle-5.2.1
      export PATH=${GRADLE_HOME}/bin:${PATH}
    • Save and close the file. This script will be sourced at shell startup.
    • Make the script executable by typing:
      $ sudo chmod +x /etc/profile.d/gradle.sh
    • Load the environment variables using the source command:
      $ source /etc/profile.d/gradle.sh
  • Check gradle version:
    $ gradle -v;
  1. Install cucumber
  • In folder with tests project open console (cmd or Git Bash): -->
    $ sudo apt-get install cucumber

@wa1one
Copy link
Author

wa1one commented Aug 9, 2019

  1. Install the default JDK
  • execute the following command to install OpenJDK:
    $ sudo apt install default-jre;
    $ sudo apt install default-jdk
  • check java version:
    $ java -version;
  • setting the JAVA_HOME Environment Variable:
    • Use the update-alternatives command:
      $ sudo update-alternatives --config java;
    • Copy the path from your preferred installation. Then open /etc/environment using nano or your favorite text editor:
      $ sudo nano /etc/environment
    • At the end of this file, add the following line, making sure to replace the highlighted path with your own copied path: -->
      JAVA_HOME="/usr/lib/jvm/java-11-openjdk-amd64/"
    • Modifying this file will set the JAVA_HOME path for all users on your system. Save the file and exit the editor.
      Important: delete "bin/java" from the end of the path!
    • example: /usr/lib/jvm/java-11-openjdk-amd64/
    • Now reload this file to apply the changes to your current session:
      $ source /etc/environment
    • Verify that the environment variable is set:
      $ echo $JAVA_HOME;
  1. Install Gradle
  • Start by downloading the Gradle Binary-only zip file in the /tmp directory using the following wget command:
    $ wget https://services.gradle.org/distributions/gradle-5.2.1-bin.zip -P /tmp;
  • Once the download is completed, extract the zip file in the /opt/gradle directory:-->
    $ sudo unzip -d /opt/gradle /tmp/gradle-5.2.1-bin.zip
  • Verify that the Gradle files are extracted by listing the /opt/gradle/gradle-5.0 directory: -->
    $ ls /opt/gradle/gradle-5.2.1;
  • Setup environment variables:
    • open your text editor and create a new file named gradle.sh inside of the /etc/profile.d/ directory.:
      $ sudo nano /etc/profile.d/gradle.sh
    • Paste the following configuration:
      export GRADLE_HOME=/opt/gradle/gradle-5.2.1
      export PATH=${GRADLE_HOME}/bin:${PATH}
    • Save and close the file. This script will be sourced at shell startup.
    • Make the script executable by typing:
      $ sudo chmod +x /etc/profile.d/gradle.sh
    • Load the environment variables using the source command:
      $ source /etc/profile.d/gradle.sh
  • Check gradle version:
    $ gradle -v;
  1. Install cucumber
  • In folder with tests project open console (cmd or Git Bash): -->
    $ sudo apt-get install cucumber

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment