There are APIs to process orders and my job is to make sure it's functioning correctly with black box testing. The API does these tasks:
- Place Order
- Fetch Order Details
- Driver to Take the Order
- Driver to Complete the Order
- Cancel Order
An order has these statuses in sequence: ASSIGNING
=> ONGOING
=> COMPLETED
or CANCELLED
-
ASSIGNING
: looking for a driver to be assigned -
ONGOING
: a driver has been assigned and working on the order -
COMPLETED
: the driver has completed the order -
CANCELLED
: the order was cancelled -
The following API's been tested:
POST | /v1/orders |
---|---|
GET | /v1/orders/{orderID} |
PUT | /v1/orders/{orderID}/take |
PUT | /v1/orders/{orderID}/cancel |
PUT | /v1/orders/{orderID}/complete |
This work is adopted using [Karate unified test automation framework](https://github.com/intuit/karate).
Please clone the project or download and follow below information to move further on execution.
STEP 1: scenarios in `e2e_orderflow.feature` - Scenario One with complete order and Scenario two with cancel order
STEP 2: there are two scenario's in `e2e_orderflow.feature` and you can choose to run one or both.
STEP 3: if you want execute scenarios then make sure there is `#` before the tags `@scenarioWithCompleteOrder` and `@ignore` for first scenario.
STEP 4: if you want execute both then make sure you repeat `STEP 3`, note in scenario you will see tags `scenarioWithCancelOrder` and `@ignore` .
STEP 5: you can use `mvn clean package compiler:testCompile surefire:test` .
An option <useSystemClassLoader>false</useSystemClassLoader>
under surefire plugin in POM can be removed. But the surefire loading issue "maven-surefire-forked-vm-terminated-issue-in-windows" with openJDK8 is not fixed, yet.
Please navigate to target
folder in project location and open cucumber-html-reports
folder and open overview-features
html file.
- Tried to keep it as simple as possible, because I want to have reusability and less maintanence.
- There might one
javascript function
with in scenario steps I might repeat or unnecessarily duplicated in both scenarios, this can be moved toreusable.js
or something like that. - And some places I have java code and I want this to be as simple as possible and keep reusing it where necessary with in scenario steps. Java is used very little.
- To validate date and time that is in response of - order placing, order assigning, order ongoing , order completed - we can use java class with method
having
simpledateformat
and other classes and that can called in scenario to test or validate the date and time. - The structure of this work - there will be calling feature and called feature, meaning all api's are in called feature (in respective files) and
calling feature
e2e_orderflow.feature
is in its package.
Due to too much time demanding and workload pressure from my regular day job, I had to skip few validations.
- Firstly, due to too much work in day job I didn't get much time to test every single requirement.
- Missed testing advance order.
- Missed testing 400 or 402, in other words when order doesn't exist we have to verify it gives necessary status code as stated in requirement.
🙏 Appreciated if someone contacts me to know much about my experience and skill set.