Skip to content

A publicly available Mavenised, testng based Java example project that has sample codes to showcase local & perfecto cloud based Appium & selenium tests.

License

Notifications You must be signed in to change notification settings

PerfectoMobileSA/PerfectoJavaSample

Repository files navigation

Sample Java Project

CircleCI status

This sample project is designed to get you up and running within few simple steps.

Begin with installing the dependencies below, and continue with the Getting Started procedure below.

Dependencies

There are several prerequisite de pendencies you should install on your machine prior to starting to work with this project:

Eclipse users should also install:

  1. Maven Plugin

  2. TestNG Plugin

IntelliJ IDEA users should also install:

  1. Maven Plugin for IDEA

TestNG Plugin is built-in in the IntelliJ IDEA, from version 7 onwards.

Optional Installations

  • For source control management, you can install git.
  • To be able to interact with a real device from Perfecto cloud directly from your IDE, and use Perfecto Reporting, install Perfecto CQ Lab Plugin for your IDE.

Downloading the Sample Project

  • Clone the repository.

  • After downloading and unzipping the project to your computer, open it from your IDE by choosing the folder containing the pom.xml


Getting Started

  • Local Appium prerequisite: Local Appium Server should be running at http://127.0.0.1 , port: 4723

Running sample as is

  • Options to provide Perfecto cloud details:

     A. Open the application.properties, uncomment the properties and provide value.

     B. Pass following parameters as maven properties:


        a. `-Dperfecto.cloud.name=<>` (Required if not provided in option A)
        b. `-Dperfecto.security.token=<>` (Required if not provided in option A)
        c. `-Dreportium.job.name=<>` (Optional)
        d. `-Dreportium.job.number=<>` (Optional)

Note: Refer to official documentation on how to execute from eclipse / IntelliJ.

  • Run pom.xml with the below maven goals & properties when:

    a. If credentials are provided using application.properties:

      clean
      install
    

             b. If credentials are passed as parameters:

      clean
      install
      -Dperfecto.cloud.name=${cloudName}
      -Dperfecto.security.token=${securityToken}
      -DtestngXmlFile=testng_perfecto.xml
    

  • Maven will automatically kick start the parallel execution of different examples inside perfecto package in parallel if -DtestngXmlFile=testng.xml is passed as maven properties, if you want to run only perfecto scripts just pass this: -DtestngXmlFile=testng_perfecto.xml as maven properties. (this is the default behaviour)

  • CI dashboard integration can be performed by supplying the below properties to top-level Maven Targets:

      clean
      install
      -Dperfecto.cloud.name=${cloudName}
      -DtestngXmlFile=testng_perfecto.xml
      -Dperfecto.security.token=${securityToken}
      -Dreportium.job.name=${JOB_NAME} 
      -Dreportium.job.number=${BUILD_NUMBER} 
      -Dreportium-job-branch=${GIT_BRANCH} 
      -Dreportium.tags=${myTag}
    

About

A publicly available Mavenised, testng based Java example project that has sample codes to showcase local & perfecto cloud based Appium & selenium tests.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 7

Languages