AT Framework User Guide
AT Framework User Guide
RSD - AT Framework
TNQ Tech 1
User Guide : AT Framework
COPYRIGHT NOTICE
These materials are confidential and proprietary to TNQ Tech, Journals and no part of these
materials should be reproduced, published in any form by any means, electronic or
mechanical including photocopy or any information storage or retrieval system nor should
the materials be disclosed to third parties without the express written authorization of TNQ
Tech,
Document History
TNQ Tech 2
User Guide : AT Framework
Table of Contents
1. Introduction .............................................................................................................................. 4
1.1 Purpose ....................................................................................................................... 4
1.2 Scope ........................................................................................................................... 4
2. System Overview ...................................................................................................................... 4
3. Setup & Configuration .............................................................................................................. 5
3.1 Ensure the Required Tools Are Installed ...................................................................... 5
3.2 Project Structure .......................................................................................................... 5
3.3 Configure Cucumber Feature Files ............................................................................... 6
3.4 Create Step Definitions ................................................................................................. 6
3.5 Create TestNG Configuration File .................................................................................. 8
3.6 Test Runner Class …...................................................................................................... 9
4. Functional Requirements …..................................................................................................... 10
4.1 Test Execution ………................................................................................................. 10
4.2 Test Case Design …..................................................................................................... 10
5. Run Configuration .................................................................................................................... 11
5.1 Add TestNG Plugin ...................................................................................................... 11
5.2 Create a TestNG Configuration ................................................................................... 11
5.3 Parallel Execution Configuration ................................................................................. 11
5.4 Cucumber Runner Configuration ................................................................................ 12
6. Logging ..................................................................................................................................... 12
7. Reporting .................................................................................................................................. 13
7.1 Report Configuration .................................................................................................. 13
7.2 Report Configuration XML .......................................................................................... 14
7.3 Report View ................................................................................................................ 16
TNQ Tech 3
User Guide : AT Framework
1. Introduction
1.1 Purpose
The purpose of this document is to outline the functional requirements of the automation
framework. This framework will automate test scenarios for both web and API testing, ensuring
faster feedback loops and consistent quality across the software development lifecycle.
1.2 Scope
This document provides detailed requirements for the framework, which will be used by
developers, QA engineers, and other stakeholders.
2. System Overview
TNQ Tech 4
User Guide : AT Framework
Before configuring the project, ensure that the following tools are installed:
To integrate Cucumber with Rest Assured and TestNG, you need to organize the project
into specific folders for feature files, step definitions, test cases, and utilities. The
following structure is commonly used:
TNQ Tech 5
User Guide : AT Framework
/src/test/java
Cucumber feature files describe the behavior of the API or web services you are testing.
Place your .feature files in the /src/test/resources/features/ directory.
Step definitions map the steps in the feature file to Java code. Place these in the
src/test/java/tnq.nimble.pms.definitions/ directory.
TNQ Tech 6
User Guide : AT Framework
package tnq.nimble.pms.definitions;
import io.cucumber.java.en.Given;
import io.cucumber.java.en.Then;
import io.cucumber.java.en.When;
import tnq.nimble.pms.common.UIWrapperMethods;
import tnq.nimble.pms.context.FrameworkContext;
import tnq.nimble.pms.hooks.ExtentReportManager;
import tnq.nimble.pms.pageObjects.HomePage;
import tnq.nimble.pms.pageObjects.LoginPage;
import tnq.nimble.pms.pagefactory.PageFactoryManager;
import org.testng.Assert;
import java.io.IOException;
public class LoginPageDefinitions {
//PMSTestSetUp setUp;
FrameworkContext context;
public LoginPage loginPage;
public HomePage homePage;
public UIWrapperMethods common;
public LoginPageDefinitions(FrameworkContext context) throws IOException {
this.context = context;
loginPage = PageFactoryManager.getLoginPage(context);
homePage= PageFactoryManager.getHomePage(context);
}
@Given("User is on Home page")
public void loginTest() throws IOException {
try {
loginPage.openurl();
ExtentReportManager.logStepPass("User is on Home page Opened");
} catch (Exception e) {
ExtentReportManager.logStepError("Failed to Open homepage", e);
}
}
@When("User enters username as {string} and password as {string}")
public void goToHomePage(String userName, String passWord) {
try {
loginPage.login(userName, passWord);
ExtentReportManager.logStepPass("Login Sucessfully");
}catch (Exception e) {
ExtentReportManager.logStepError("Login Failed", e);
}
}
@Then("User should be able to login successfully")
public void verifyLogin() {
Assert.assertTrue(homePage.getHomePageText().contains("PRODUCTIVITY"));
}
}
TNQ Tech 7
User Guide : AT Framework
Example of nimble-pms-ui-qa-runner.xml:
TNQ Tech 8
User Guide : AT Framework
The TestRunner class executes the Cucumber scenarios using TestNG. Place this file under
src/test/java/tnq.nimble.pms.runner/.
package tnq.nimble.pms.runner;
import io.cucumber.testng.AbstractTestNGCucumberTests;
import io.cucumber.testng.CucumberOptions;
import tnq.nimble.pms.utilshandler.ReportingUtils;
import org.testng.annotations.AfterSuite;
import org.testng.annotations.DataProvider;
/**
* https://extentreports.com/docs/versions/4/java/cucumber4.html
* @author Elango Saminathan
*
*/
@CucumberOptions(
tags = "@QA",
features = "src/test/resources/features",
glue = { "tnq.nimble.pms.definitions",
"tnq.nimble.pms.hooks" },
plugin = {"pretty",
"json:target/cucumber.json",
"html:target/cucumber-report.html",
"junit:target/cucumber-report.xml",
"com.aventstack.extentreports.cucumber.adapter.ExtentCucumberAdapter:",
"timeline:test-output-thread/"
},
monochrome = false,
dryRun = false
)
public class PMSRunnerQA extends AbstractTestNGCucumberTests {
@AfterSuite
public void generateReport(){
ReportingUtils.generateJVMReport();
}
TNQ Tech 9
User Guide : AT Framework
4. Functional Requirements
● The framework should support the execution of automated test cases for web UI
and API layers.
● Tests should be executable on multiple browsers (Chrome, Firefox).
● API tests should support common RESTful operations like GET, POST, PUT, DELETE.
● The framework should support the execution of both regression and sanity tests
through tagging/grouping of test cases.
● The framework able to execute tests in parallel.
● The framework should follow a Page Object Model (POM) for UI test automation
to improve maintainability.
● For API testing, the framework should provide a RESTful methods (e.g.,
APIWrapperMethod classes to handle API calls).
● The framework should support data-driven testing by allowing test data to be
loaded from external sources (Text, JSON).
TNQ Tech 10
User Guide : AT Framework
5. Run Configuration
TNQ Tech 11
User Guide : AT Framework
"com.aventstack.extentreports.cucumber.adapter.ExtentCucumberAdapter:",
"timeline:test-output-thread/"
},
monochrome = false,
dryRun = false,
parallel = true
)
6. Logging
Detailed logging should be available for all tests. Place this file under logs/main.log
Example of logs/main.log
TNQ Tech 12
User Guide : AT Framework
7. Reporting
7.1 Report Configuration
Create an extent.properties file in the src/test/resources folder to
configure the output and appearance of the Extent Reports:
#Report Name
extent.reporter.spark.start=true
extent.reporter.spark.out=Reports/PMS_Report.html
#PDF Report
extent.reporter.pdf.start=true
extent.reporter.pdf.out=PDFReport/ExtentPdf.pdf
#Report Template
extent.reporter.spark.config=src/test/resources/extent-config.xml
#extent.reporter.pdf.additional.config=src/main/resources/pdf-config.yaml
extent.reporter.pdf.title=Automation Test Report # PDF Title
extent.reporter.pdf.author=QA Team # Author of the report
extent.reporter.pdf.subject=Test Execution Summary # PDF subject
# Customization options
extent.reporter.pdf.theme=STANDARD # STANDARD or DARK theme
extent.reporter.pdf.fontName=Arial # Font name
extent.reporter.pdf.fontSize=12 # Font size
extent.reporter.pdf.pageNumbers=true # Include page numbers
(true/false)
# Metadata options
extent.reporter.pdf.keywords=Automation,Testing,PDF # Keywords for the
report
extent.reporter.pdf.company=Your Company Name # Company name for the
report
#FolderName
basefolder.name=ExtentReports/PMSReport_
basefolder.datetimepattern=d_MMM_YY HH_mm_ss
#Screenshot
screenshot.dir=/Screenshots/
screenshot.rel.path=../Screenshots/
TNQ Tech 13
User Guide : AT Framework
# Encrpt Image
extent.reporter.spark.base64imagesrc=true
extent.reporter.spark.vieworder=dashboard,test,category,exception,author,devic
e,log
#System.info
systeminfo.os=Window
systeminfo.Engineer=Elango Saminathan
systeminfo.Build= 1.1
systeminfo.Project = PMS
systeminfo.Browser = Chrome
systeminfo.AppName= NimbleReport
TNQ Tech 14
User Guide : AT Framework
<displayPassedSteps>false</displayPassedSteps>
<!-- custom javaScript -->
<scripts>
<![CDATA[
$(document).ready(function() {
});
]]>
</scripts>
<!-- custom styles -->
<scripts>
<![CDATA[
]]>
</scripts>
</configuration>
</extentreports>
TNQ Tech 15
User Guide : AT Framework
TestSteps
TNQ Tech 16
User Guide : AT Framework
Tags
PDF Report
TNQ Tech 17