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 Web Assignment implemented on getting-started-with-teswiz #51

Open
wants to merge 20 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
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
Prev Previous commit
Next Next commit
BL completed as per assignment
  • Loading branch information
Mukund1 Gupta authored and Mukund1 Gupta committed Jun 16, 2023

Verified

This commit was signed with the committer’s verified signature.
martines3000 Martin Domajnko
commit c37fc3b07692def263ff1958b8d2b098592c3b9c
Original file line number Diff line number Diff line change
@@ -2,7 +2,9 @@

import com.context.TestExecutionContext;
import com.znsio.sample.e2e.entities.SAMPLE_TEST_CONTEXT;
import com.znsio.sample.e2e.screen.zomato.ZomatoScreen;
import com.znsio.sample.e2e.screen.zomato.DineOutScreen;
import com.znsio.sample.e2e.screen.zomato.HomePageScreen;
import com.znsio.sample.e2e.screen.zomato.RestaurantScreen;
import com.znsio.teswiz.entities.Platform;
import com.znsio.teswiz.runner.Runner;
import org.apache.log4j.Logger;
@@ -35,75 +37,75 @@ public ZomatoBL() {
}

public ZomatoBL launchHomePageAndValidate() {
boolean isHomePageLaunchedSuccessfully = ZomatoScreen.get().isHomePageLaunchedSuccessfully();
boolean isHomePageLaunchedSuccessfully = HomePageScreen.get().isHomePageLaunchedSuccessfully();
assertThat(isHomePageLaunchedSuccessfully).as("Url mismatch occurred, try opening the correct url for the application").isTrue();
LOGGER.info("Homepage launched successfully");
return this;
}

public ZomatoBL clickOnDiningOption() {
ZomatoScreen.get().clickOnDiningOption();
HomePageScreen.get().clickOnDiningOption();
return this;
}

public ZomatoBL verifyRedirectionToDineoutPage() {
boolean isRedirectionToDineoutPageSuccessful = ZomatoScreen.get().verifyRedirectionToDineoutPage();
boolean isRedirectionToDineoutPageSuccessful = DineOutScreen.get().verifyRedirectionToDineoutPage();
assertThat(isRedirectionToDineoutPageSuccessful).as("Load the correct page, redirection to dineout was not successful ").isTrue();
LOGGER.info("Redirected to Dine-out page successfully");
return this;
}

public ZomatoBL selectLocationForRestaurants(String location) {
ZomatoScreen.get().selectLocationForRestaurants(location);
DineOutScreen.get().selectLocationForRestaurants(location);
return this;
}

public ZomatoBL verifySelectedLocation(String location) {
boolean isCorrectLocationSelected = ZomatoScreen.get().isCorrectLocationSelected(location);
boolean isCorrectLocationSelected = DineOutScreen.get().isCorrectLocationSelected(location);
assertThat(isCorrectLocationSelected).as("Incorrect/Improper location was set").isTrue();
LOGGER.info("Selected Location is correct");
return this;
}

public ZomatoBL selectSpecificRestaurant() {
ZomatoScreen.get().selectSpecificRestaurant();
DineOutScreen.get().selectSpecificRestaurant();
return this;
}

public ZomatoBL verifySelectedRestaurant() {
boolean isCorrectRestaurantSelected = ZomatoScreen.get().isCorrectRestaurantSelected();
boolean isCorrectRestaurantSelected = RestaurantScreen.get().isCorrectRestaurantSelected();
assertThat(isCorrectRestaurantSelected).as("incorrect location set").isTrue();
LOGGER.info("Correct Restaurant is selected");
return this;
}

public ZomatoBL bookTableForGuestDayForASpecificDate() {
boolean isBookATableOptionSelected = ZomatoScreen.get().clickOnBookATable().isBookATableOptionSelected();
boolean isBookATableOptionSelected = RestaurantScreen.get().clickOnBookATable().isBookATableOptionSelected();
assertThat(isBookATableOptionSelected).as("Book a Table option not selected").isTrue();
LOGGER.info("Book a Table option successfully selected");

boolean isCorrectDateSelected = ZomatoScreen.get().selectDate().isCorrectDateSelected();
boolean isCorrectDateSelected = RestaurantScreen.get().selectDate().isCorrectDateSelected();
assertThat(isCorrectDateSelected).as("Incorrect date or no date selected").isTrue();
LOGGER.info("Correct Date selected");

boolean areCorrectNumberOfGuestsSelected = ZomatoScreen.get().selectNumberOfGuests().areCorrectNumberOfGuestsSelected();
boolean areCorrectNumberOfGuestsSelected = RestaurantScreen.get().selectNumberOfGuests().areCorrectNumberOfGuestsSelected();
assertThat(areCorrectNumberOfGuestsSelected).as("Incorrect number of guests or no guests selected").isTrue();
LOGGER.info("Correct Number of Guests selected");

// boolean isCorrectTimeSlotSelected =
ZomatoScreen.get().selectTimeSlot();
// isCorrectTimeSlotSelected();
// assertThat(isCorrectTimeSlotSelected).as("Incorrect time slot or no timeslot selected").isTrue();
boolean isCorrectTimeSlotSelected = RestaurantScreen.get().selectTimeSlot().isCorrectTimeSlotSelected();
assertThat(isCorrectTimeSlotSelected).as("Incorrect time slot or no timeslot selected").isTrue();
LOGGER.info("Correct Timeslot selected");

ZomatoScreen.get().fillGuestBasicDetails();

boolean areGuestDetailsCorrect = RestaurantScreen.get().fillGuestBasicDetails().areGuestDetailsCorrect();
assertThat(areGuestDetailsCorrect).as("Incorrect/No guest details selected").isTrue();
LOGGER.info("Correct Guest details filled");
return this;
}

public ZomatoBL verifyLoginPopUpMessage() {
boolean isCorrectRestaurantSelected = ZomatoScreen.get().isCorrectRestaurantSelected();
assertThat(isCorrectRestaurantSelected).as("incorrect location set").isTrue();
boolean isLoginPopUpMessageVisible = RestaurantScreen.get().isLoginPopUpMessageVisible();
assertThat(isLoginPopUpMessageVisible).as("Login Pop Up mesaage didn't occur").isTrue();
LOGGER.info("Login Pop up Message Occurred");
return this;
}
}