-
Notifications
You must be signed in to change notification settings - Fork 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
[Zomato assignement] Book a Table functionality on getting started with teswiz #48
base: main
Are you sure you want to change the base?
Conversation
# 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 |
There was a problem hiding this comment.
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'", |
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
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(); |
There was a problem hiding this comment.
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]"); |
There was a problem hiding this comment.
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(); |
There was a problem hiding this comment.
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(); |
There was a problem hiding this comment.
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)) |
There was a problem hiding this comment.
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(); |
There was a problem hiding this comment.
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
Problem: Verify user can book a table on Zomato
Expectations: We expect the following outcome
-Local execution report for the working test
-ReportPortal report of your execution, if applicable