Friendly-Cukes
friendly-cukes is user friendly cucumber test automation framework created by tester for tester. It is a ruby-cucumber based generic automation framework for desktop and mobile web automation. It is built using Cucumber (1.3.15), page-object (1.0.2) and appium_lib (4.1.0). All you need is to install the gem and that's it, you have set with cucumber automation.
Gem requirements
The gem requires Ruby (2.0.0), ChromeDriver.exe (v2.10.267521), IEDriverServer.exe (2.45.0.0) and Appium (1.3.4.1). As of now the framework is designed to work with the proposed software setup and tested only on Windows machine.
-
Install friendly-cukes gem
gem install friendly-cukes -
Install generic cucumber framework
friendly-cukes --new test_app_namewhere
test_app_nameis the test application name This will install the generic cukes framework undertest_app_namedirectory (typefriendly-cukesfor more options) -
Then type
cd test_app_nameand start with the cucumber automation. By default the framework has some feature files for demo purpose. The cucumber run command for the default feature files is created as rake task, Typerake -Tand it will list three tasks. Run any of the task, likerake desktop_google_searchand it will start the cucumber execution -
The cucumber run command will look like
$cucumber -p profile_name --tags tag1[,tag2,...] APP=app_namewhere
-
profile_name- is the cucumber profile name present incucumber.yml -
tags- is the tag name for feature/scenario to be executed -
app_name- key name of the application (as of now I have used two different app;Google and Rubygems for demo purpose)
Example:
$cucumber -p desktop_dev_ff -t @tc_02 APP=RUBYGEMSthe above command runs scenario tag
@tc_02(fromgem_search.feature) withdesktop_dev_ff profile(fromcucumber.yml) -
-
For releasing unused profiles add
RESET_CONFIG_VALUES=yesortruein the cucumber run command and it will release all the no-longer used profiles -
For adding code coverage report, add
CODE_COVERAGE=yesortruein cucumber run command and it will create acoveragedirectory holding the code-coverage report files -
For mobile automation, use the profile (in
cucumber.yml) prefixed withmobile_Example:
$cucumber -p mobile_dev_chrome_device -t @tc_02 APP=RUBYGEMSthe above command will execute scenario with tag
@tc_02in chrome in the device attached to the machine, provided the android and appium settings are correct and theappium serveris up and running
TAF Features
Object Repository
-
all web page-objects (web elements) are grouped into modules and are placed under
object_repositorydirectory -
the
page-objectrepository modules can be encapsulated with anyPageObjectclass files -
there can be multiple repository files
-
the
page_objectsdirectory holds generic page object class methods that defines the actual script action (with the objects fromobject_repository) on web browser
Test data handling
YML files are used as test data files for faster data access and these files are stored under test_data directory under feature file directory. The test data handling is done at two levels
-
local : the scenario specific test data file should be placed under the respective feature file directory and with the file name suffixed with the scenario ID
-
global : the global test data files should be placed under test_data directory under the root feature (
desktopormobile) directory and if no local test data file is present, then it takes the global data file as default
Dynamic profile and Parallel execution
1. Dynamic profiles
-
the profile allocation for each execution ( on single or multiple machines) is done dynamically during the execution
-
based on the profile tags given in
cucumber.yml, the free profiles are auto-assigned to the currently running execution -
the profiles are configured in such a way that there can be
nnodes and each node can havemprofiles and hence the profile sample space isn x m
2. Parallel execution
-
the parallel execution parameters are given in
config.ymlbased on which the merging of custom html report files will be done -
the profiles for each parallel execution is taken from
config.ymldynamically
Custom Execution report
for each execution an unique test report directory will be created with the name test_report_<timestamp> under which by default the following exists
-
app_env.log–> holds the log for execution environment and duration details -
feature based custom log file–> holds the log based on the currently running feature – there cannnumber of feature log files -
report_<timestamp>.html–> cucumber generated html report file that holds the log for features, scenarios and steps -
report_<timestamp>.json–> cucumber generated json report file that holds the log for features, scenarios and steps and the step level durations in nano seconds -
custom_report–> the directory holds merged custom html report files -
report_home.html–> holds the summary report of the execution
Performance Report
-
the performance report component extracts the build details from cucumber generated json report files and stores in into
Syabsedatabase -
the complete execution data for each build will be stored in the DB, which can be interpreted and populated as a performance report
-
the performance report can included or excluded based on the property value of performance_report in
config.yml -
this component is also available as a standalone application bundled with the
friendly-cukesgem, typebuild-extractorand follow the commands -
this will work only if
Sybasedatabase is configured in TAF and tables are created with TAF defined relationships