Skip to content

codingRound Automation task Completion #52

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 31 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
561637a
pushing first changes
AjayClement Jul 1, 2019
c602670
Deleted Files
AjayClement Jul 1, 2019
679551f
Flight Test Updated
AjayClement Jul 2, 2019
53b7f53
HotelBooking Test updates
AjayClement Jul 3, 2019
d748d42
Deleting Reports
AjayClement Jul 3, 2019
d4615ba
Updates(warning statements removed): FlightBookingTest,
AjayClement Jul 3, 2019
67d5403
SingnTest Updated
AjayClement Jul 3, 2019
57edf50
Retry Failed Utility
AjayClement Jul 3, 2019
8467915
ExtentReports
AjayClement Jul 3, 2019
66fbaca
dummy class added in main resources to avoid missing src/main/resources
AjayClement Jul 3, 2019
cb6a847
Pick Current date by default and plus one date by default to avoid
AjayClement Jul 3, 2019
f423496
Report listener Fix for Screenshot not appearing in html
AjayClement Jul 3, 2019
28f1f85
Delete FlightBookingTest2019-07-03 06-42-44-4244reports.html
AjayClement Jul 3, 2019
d4f0549
Adding a constant for SignInPage
AjayClement Jul 3, 2019
de35c94
Merge pull request #1 from AjayClement/codingRound/child
AjayClement Jul 3, 2019
6f5afa6
Review Comments and task completion frameWork key points
AjayClement Jul 3, 2019
64ea67f
Update HotelBookingPage.java
AjayClement Jul 3, 2019
45edd21
SignInTest Removing Unwanted imports and objects
Jul 4, 2019
2b49ec7
Review Comments file formatting changes
Jul 4, 2019
6059f10
Review comments file Updating Instructions
Jul 4, 2019
99af2f2
Review comments Adding points
AjayClement Jul 4, 2019
28c262f
HotelBookingPage Removing Commented lines
AjayClement Jul 4, 2019
cede997
Adding Instruction statement
AjayClement Jul 4, 2019
97b50d0
Merge pull request #2 from AjayClement/codingRound/child
AjayClement Jul 4, 2019
be29aac
UiCommonLibrary editing comments
AjayClement Jul 4, 2019
5c5c3e6
Merge pull request #4 from AjayClement/codingRound/childClone
AjayClement Jul 4, 2019
75d12eb
Merge pull request #5 from AjayClement/codingGround/merge
AjayClement Jul 4, 2019
f9e5727
Report Listener step log typo fix
Jul 4, 2019
374c073
removing unwanted sysout
AjayClement Jul 4, 2019
4bff0a0
Merge branch 'master' of https://github.com/AjayClement/codingRound.git
Jul 4, 2019
6f54bdd
remove sysouts
AjayClement Jul 4, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions .classpath
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" output="target/classes" path="src/main/java">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" output="target/test-classes" path="src/test/java">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
<attribute name="test" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" path="src/main/resources"/>
<classpathentry kind="src" path="src/test/resources"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="output" path="target/classes"/>
</classpath>
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
build
.idea
.gradle
.gradle
/target/
23 changes: 23 additions & 0 deletions .project
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>codingRound</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.m2e.core.maven2Builder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.m2e.core.maven2Nature</nature>
</natures>
</projectDescription>
13 changes: 13 additions & 0 deletions .settings/org.eclipse.jdt.core.prefs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=1.7
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
org.eclipse.jdt.core.compiler.release=disabled
org.eclipse.jdt.core.compiler.source=1.7
4 changes: 4 additions & 0 deletions .settings/org.eclipse.m2e.core.prefs
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
activeProfiles=
eclipse.preferences.version=1
resolveWorkspaceProjects=true
version=1
109 changes: 109 additions & 0 deletions REVIEW_COMMENTS_&_KEY_POINTS.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
Review Points And Comments:

Review Comments and Key points on the fixes and framework created are Oredered as follows:


(1) Common and Test Class Level Review on design and errors.
(2) Framework design pattern, files placing, reusability, reporting.


1. Test Class Level Review on design and errors.

(i) Common Issues:

(a). set the path for driver before initialize the same.

(b). create a common utility to launch driver and set chrome driver path.

(c). create property file to input test configuration values i.e browser name, driver path other common configuration needs before test.

(d). it is better to have test case executed via testNG xml while using testNG, hence it should be configured right.

(e). Should try to keep the implementation for tests abstract/ hidden and reusable and add provision for further updates of the same
which would assure maintainability.

(f). Assert every validation and report with screenshot for failed step/every step if possible. Since, html results
can be easily edited and hence for show casing tests to client is one step ahead if the tests have proper
evidences.

(g). Must avoid using thread.sleep (hard wait of any type). Instead use explicit waits.

(h). should follow a proper design pattern across the tests for efficient testing i.e page factory for example.

(i). Always the tests must NOT be placed/developed in the main src folder, it should be placed in the test src folder
the main should only have common utils.

(j) The classes should not be developed in "default package" it should be developed in a properly created
package with correct naming conventions.

(k) The drivers can be placed in a separate relevant folder which can make the framework presentable.

(l) Important of all a framework or automation is about reusabilty which requires reusable library for all
the tests.


(ii)FlightBookingTest:

(a).Use explicit waits.

(b).Update the chrome driver to latest for supporting latest chrome versions. It can cause errors during execution.
such that the chrome driver which was already there caused exception when sending text to 'from' text box
which got fixed after updating the chrome driver.

(c).Xpath Id for the To(destination) text box was not correct i.e the actual value for the attribute id is 'ToTag'
but in script the vale was'toTag' hence it throws 'NoSuchElementException.

(d).The date picker xpath is hard coded to pick a date and not flexible which is not good for a locator. Should change the
xpath in such a way that it can take any date from the user. write a common method.

(e).Assesrtion should be done specifically whether Bangalore to New Delhi flights are shown and not just 'searchSummary' text
so that what gets Asserted will completley validate the scenario.


(ii)HotelBookingtest:

(a). This class has pagefactory pattern implemented for finding elements which was missing "PageFactory.initElements()" this method
will implicitly call the findElement method from behind without which the script fails.

(b). Date picker must be automated for any inputs from the user and should be reusable.


(iii)SignInTest:

(a). Identify whether an element is within a frame i.e "SignIn" button is an element located within a frame
because of which the element cannot be identified unless switched to that frame.



Key Points of the framework developed and fixed

2 Framework design pattern, files placing, reusability, reporting.

(a). An automation framework must follow a design pattern with correct usage of OOP's concepts
for better understanding, readability and reusability.

The fixes made to the task does not only resolve the issues but also follows a strong "Page Abstraction/Page Factory Pattern"
with "LoadableComponent" implemented for every page i.e "FlightBookingPage.class", "HotelBookingPage.class",
"SearchSummaryPage.class", "SignInPage.class".


(b). Common Reusable Library "UiCommons" is used which was not present.

(c). "DriverFactory"class is implemented for initializing driver and closing the same which can be used across
tests.

(d). Input/output utilities created to read test configuration properties from ".properties" file.

(e). Listener class implemented for running failed tests again, the number of times as user specified.

(f). Listener class implemented for intuitive reporting with html that has screenshots attached within the html report page.

(g). TestNG xml included for running as TestNG suite.

(h). Proper assertion done for validation.


**Run the tests using TestNg.xml present as suite to generate reports and retry failed.
**The results will be generated in "ExtentReports" folder within the project, to view the same please,refresh the project


File renamed without changes.
File renamed without changes.
Binary file renamed chromedriver.exe → drivers/chromedriver_win.exe
100755 → 100644
Binary file not shown.
64 changes: 38 additions & 26 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -1,28 +1,40 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<groupId>com.testvagrant.codingRound</groupId>
<artifactId>codoingRound</artifactId>
<version>1.0-SNAPSHOT</version>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.11</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
<version>3.6.0</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<version>6.11</version>
<scope>compile</scope>
</dependency>
</dependencies>
<project
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<groupId>com.testvagrant.codingRound</groupId>
<artifactId>codoingRound</artifactId>
<version>1.0-SNAPSHOT</version>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.11</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
<version>3.6.0</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<version>6.11</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.6</version>
</dependency>
<dependency>
<groupId>com.relevantcodes</groupId>
<artifactId>extentreports</artifactId>
<version>2.41.2</version>
</dependency>
</dependencies>
</project>
89 changes: 0 additions & 89 deletions src/main/java/FlightBookingTest.java

This file was deleted.

Loading