This starter kit is designed to get you up and running using the Quantum framework (powered by QAF) within few simple steps, and enable you to start writing your tests using simple [Cucumber] (https://cucumber.io/).
Begin with installing the dependencies below, and continue with the Getting Started procedure below.
There are several prerequisite dependencies you should install on your machine prior to starting to work with Quantum:
Eclipse users should also install:
IntelliJ IDEA users should also install:
TestNG Plugin is built-in in the IntelliJ IDEA, from version 7 onwards.
- 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.
Download the Quantum-Started-Kit repository.
After downloading and unzipping the project to your computer, open it from your IDE by choosing the folder containing the pom.xml file (Quantum-Starter-Kit-master, you might consider renaming it).
Look here to understand the project layout, and find your way in it.
TAL - ASK YAACOV TO UPDATE THE CURRENT STRUCTURE
This procedure leads you through the various Quantum framework's aspects:
- Running one of the samples in the Quantum project as is.
- Parallel execution of all Quantum samples.
- Diversifying test execution by manipulating test suites.
- Viewing test execution results
- Advanced Quantum features
Run a single Quantum sample from the samples provided in the Starter Kit.
The samples are located under the src/main/resources/scenarios folder.
-
Configure yout cloud and credentials in the _appication.properties_ file (under the top _resources/_ folder).
-
Run your test via the right-click menu while hovering on the TestNG.xml file in the project pane (on the left).
The sample opens device browser at Google, searches for Perfecto Mobile, enters the site, and searches for Perfecto Object Spy.
To run all samples in parallel, you need to configure the TestNG.xml file, which is located under the src/test/resources/config/ folder.
-
For each of the test suites (enclosed within <test>...</test>), set the _enabled_ property value to **_true_**.
-
Run your test as before.
This results in running 2 additional samples, both searching terms in Perfecto Community; one uses hard coded search terms, and the other retrieves them from an external input file.
You can set each of the test suites to run on a different type of device, and to include different scenarios. For that, you need to manipulate the contents of the various test suites in the TestNG.xml file. Modify only the test suites not related to the Google sample we started with.
- Replace the current tag in the community samples, so that in the CommunityExample.feature sample all tags are @sampletag, and in the CommunityDataDrivenExample.feature sample - @sampletagdd.
You may of course use other values, or leave the tags as is, but use these tag values for demonstration's sake. - In the TestNG.xml file, set the tag parameter value in one suite to @sampletag, and in the other - to @sampletagdd.
That means, that the first test suite runs the CommunityExample sample, and the second - the CommunityDataDrivenExample sample. - To vary the devices used for each of the test suites, replace the capability parameter ("driver.capabilities.someCapability") in both suites with
<parameter name="driver.capabilities.platformName" value="Android"/>
.
Set the value to "iOS" in the second test suite.
By that, you specify that the CommunityExample sample will run on an Android device (randomly allocated), and the CommunityDataDrivenExample sample - on an iOS device.
Note: Generally, you can use any of the numerous device selection capabilities. - Run your test in the same manner as before.
You can follow your test execution on Perfecto Dashboard and see the three samples running on the specified device types.
All the previous executions were recorded, and may be viewed in Perfecto execution center, Reporting.
Let's proceed to naming your tests, so you can easily detect them in Perfecto Reporting and drill down to examine them in more detail.
- In each of the feature files (the samples), set the Feature line at the top to
Feature: community search sample
- Run your test as before.
- To view the test execution report within Perfecto Reporting:
- Enter your CQ Lab at https://.perfectomobile.com.
- Select the Reporting tab, and click the link to Perfecto Reporting (on the right).
- Login using your CQ Lab credentials.
All the last execution tests are listed in the Reporting execution center. The feature name you set in the sample before, appears as the test name on the left.
- To drill down into any of the specific test executions, click the test to view its Single Test Report for more execution details.
Quantum has additional features to allow better customization to your specific application:
- Create your own [Object Repository](Object Repository) file to match your application objects.
- Create a [[customized steps|Creating customized steps]] file to ease performing actions common in your application operation.
- Write tests using either BDD or Java.
- Configure the [TestNG.xml](Quantum TestNG File) to filter the tests to execute and the devices used in the test.
Configuration of the [application properties](The application.properties file) and the [TestNG.xml file](Quantum TestNG File), as well as creating object definitions in the [Object Repository](Object Repository) and [[creating customized steps|Creating customized steps]], require knowledge of Java, TestNG, and XPath.
ℹ️ The Perfecto plugin enables access to real devices and desktop Web sessions in the CQ Lab, as well as easy-to-use Object Spy for mapping the application objects in the [Object Repository](Object Repository).