Skip to content
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

[Zomato assignement] Book a Table functionality on getting started with teswiz #48

Open
wants to merge 11 commits into
base: main
Choose a base branch
from

Conversation

MedhaGupta-Ril
Copy link
Contributor

@MedhaGupta-Ril MedhaGupta-Ril commented Jun 16, 2023

Problem: Verify user can book a table on Zomato

  1. Go to Zomato home page
  2. Select the Dining option
  3. Choose a pre-defined location
  4. Choose the 3rd restaurant from the list of available restaurants based on the location chosen
  5. Go to Book a table option from the Restaurant page
  6. Choose (Today’s date + 2) for the booking
  7. Select number of Guest as 4
  8. Choose a dinner time slot
  9. Enter the required guest details. (You can add the dummy details here)
  10. Proceed with booking and verify you’re getting the login screen

Expectations: We expect the following outcome

  1. Use your judgement to put logical assertions and visual validations wherever applicable
  2. The assignment should be completed by 4 PM IST on June 16th
  3. You have to present the demo for your assignment which should cover:
  4. PR for the work completed
    -Local execution report for the working test
    -ReportPortal report of your execution, if applicable

# CONFIG=./configs/zomato_local_config.properties TAG="@zomato" PLATFORM=web ./gradlew run
@web @single-user
Scenario: User should be able to book a table
Given I, as a user should be on the zomato home page and able to select the "NCR" location

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Given I, as a User have set the location to "NCR" on the home page

@Given("I, as a user should be on the zomato home page and able to select the {string} location")
public void iAsAUserShouldBeOnTheZomatoHomePageAndAbleToSelectTheLocation(String cityName) {
LOGGER.info(String.format(
"iAsAUserShouldBeOnTheZomatoHomePageAndAbleToSelectTheLocation - Persona:'%s', Platform: '%s'",

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

refactor method name according to the below comment on feature file

"iAsAUserShouldBeOnTheZomatoHomePageAndAbleToSelectTheLocation - Persona:'%s', Platform: '%s'",
SAMPLE_TEST_CONTEXT.ME, Runner.getPlatform()));
Drivers.createDriverFor(SAMPLE_TEST_CONTEXT.ME, Runner.getPlatform(), context);
new ZomatoBL(SAMPLE_TEST_CONTEXT.ME, Runner.getPlatform()).selectDiningLocation(cityName);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rename ZomatoBL to ZomatoHomePageBL


@Then("I am able to view login option")
public void iAmAbleToViewLoginOption() {
new ZomatoBL(SAMPLE_TEST_CONTEXT.ME, Runner.getPlatform()).verifyLoginOption();

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rename verifyLoginOption() to LoginPopUpWindow()

private static final Logger LOGGER = Logger.getLogger(SCREEN_NAME);
private final Driver driver;
private final Visual visually;
private final By byRestaurantNameXpath = By.xpath("((//img[@alt='Restaurant Card'])[3]//following::h4)[1]");

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no indexes in locators

@Override
public DiningOutScreen selectDineOutOption() {
driver.waitTillElementIsVisible(byDineOutXpath);
driver.findElement(byDineOutXpath).click();

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

line no 46 and 45 can be combined

public ZomatoBL bookATable(int guestCount, int aheadDays) {
LOGGER.info(String.format("bookATable(): book a table with %d number of guest and %d days ahead date", guestCount, aheadDays));

String restaurantName = DiningOutScreen.get().getRestaurantName();

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should be part of DineOutBL


String restaurantName = DiningOutScreen.get().getRestaurantName();

assertThat(DiningOutScreen.get().selectRestaurant().isRestaurantNameVisible(restaurantName))

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you can create variable for DiningOutScreen object and reuse it in the line no 55 and 57


public ZomatoBL verifyLoginOption() {
LOGGER.info("verifyLoginOption(): verify login option");
RestaurantDetailScreen.get().verifyLogin();

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should be part on ResturantDetailsBL

@MedhaGupta-Ril MedhaGupta-Ril changed the title Zomato assignement [Zomato assignement] Book a Table functionality on getting started with teswiz Jun 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants