DEV Community

Big Show
Big Show

Posted on

Home delivery

Launch the application using the url: http://localhost:8080/application/index.html (If not loaded, refer the Table1: Common issues and their resolutions)

Maximize the browser.

Give an implicit wait of 6 seconds.

  1. test1 test method:

Click on "Offices".

Print how many offices are present in the page in the console.

  1. test2 test method:

Click on "HomeDelivery".

Verify if "BuildOrder" button and "Where" dropdown is disabled using TestNG Soft Assertions.

Select the options from both the dropdowns using the data from Data.xls file. Check if "BuildOrder" button is enabled after selecting each option,

if enabled, write "Button is enabled"

else write "Button is disabled" in the "Button status" column. (Datads is present at /home/pg_user/Desktop/Additional Supplied Files)

  1. test30 test method:

Click on "PickUp".

Select the "Bengaluru" City dropdown and "Koramangala" Where dropdan

Give "9876543210" as contact number.

Click on "Coffee" Radio button.

Iterate through the web table in the application and check if the below names are present in the Name column:

Name

Black Coffee

Cappuccino

Espresso

If yes print "Mentioned coffee is in stock" in the console.

Select cupSize as "Small" for Black Coffee using id locator.

Fill Quantity Required as "10" using xpath locator.

Click on Add to Cart

Click on "No" in Have a promo code? and click on Place Order.

Take a screenshot and save it as "Image.PNG" and save it at /home/pg,user/Desktop/AdditionalSuppliedFiles/Screenshots folder.

  1. Use After Method annotated tearDown method named as afterMethod) to

Quit the driver

Top comments (0)