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
Show file tree
Hide file tree
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
changed Scenario steps from imperative to declarative, also changed m…
…ethods name accordingly
  • Loading branch information
Mukund1 Gupta authored and Mukund1 Gupta committed Jun 21, 2023
commit fee220a16d44a857ed65a5fe4dc2f77fc3276f4b
36 changes: 18 additions & 18 deletions src/test/java/com/znsio/sample/e2e/steps/ZomatoSteps.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,42 +26,42 @@ public void launchApplicationHomePage() {
new ZomatoBL(SAMPLE_TEST_CONTEXT.ME, Runner.getPlatform()).launchHomePageAndValidate();
}

@When("I click on dining option")
@When("I select dining option")
public void clickOnDiningOption() {
new ZomatoBL(SAMPLE_TEST_CONTEXT.ME, Runner.getPlatform()).clickOnDiningOption();
new ZomatoBL(SAMPLE_TEST_CONTEXT.ME, Runner.getPlatform()).selectDiningOption();
}

@Then("I should be redirected to dine-out page")
public void verifyRedirectionToDineoutPage() {
new ZomatoBL(SAMPLE_TEST_CONTEXT.ME, Runner.getPlatform()).verifyRedirectionToDineoutPage();
}

@When("I select location as {string}")
public void selectLocationForRestaurants(String location) {
new ZomatoBL(SAMPLE_TEST_CONTEXT.ME, Runner.getPlatform()).selectLocationForRestaurants(location);
@When("I select a specific location")
public void selectLocationForRestaurant() {
new ZomatoBL(SAMPLE_TEST_CONTEXT.ME, Runner.getPlatform()).selectLocationForRestaurant();
}

@Then("I should get location selected as {string}")
public void verifySelectedLocation(String location) {
new ZomatoBL(SAMPLE_TEST_CONTEXT.ME, Runner.getPlatform()).verifySelectedLocation(location);
@Then("the same location should be displayed")
public void verifySelectedLocationWithLocationDisplayed() {
new ZomatoBL(SAMPLE_TEST_CONTEXT.ME, Runner.getPlatform()).verifySelectedLocationWithLocationDisplayed();
}

@When("I select restaurant number 3 from results")
public void selectSpecificRestaurant() {
new ZomatoBL(SAMPLE_TEST_CONTEXT.ME, Runner.getPlatform()).selectSpecificRestaurant();
@When("I choose a restaurant from selected location")
public void chooseSpecificRestaurant() {
new ZomatoBL(SAMPLE_TEST_CONTEXT.ME, Runner.getPlatform()).chooseRestaurantFromSelectedLocation();
}

@Then("I should get same restaurant which was selected")
public void verifySelectedRestaurant() {
new ZomatoBL(SAMPLE_TEST_CONTEXT.ME, Runner.getPlatform()).verifySelectedRestaurant();
@Then("the same restaurant should be displayed")
public void verifySelectedRestaurantWithRestaurantDisplayed() {
new ZomatoBL(SAMPLE_TEST_CONTEXT.ME, Runner.getPlatform()).verifySelectedRestaurantWithRestaurantDisplayed();
}

@When("I try to book a table for 4 guests on a date day after tomorrow")
public void bookTableForGuestDayForASpecificDate() {
new ZomatoBL(SAMPLE_TEST_CONTEXT.ME, Runner.getPlatform()).bookTableForGuestDayForASpecificDate();
@When("I try to book a table")
public void bookATableOnASpecificDateAndTimeForGuests() {
new ZomatoBL(SAMPLE_TEST_CONTEXT.ME, Runner.getPlatform()).bookATableOnASpecificDateAndTimeForGuests();
}

@Then("I should get login pop up message")
@Then("a login pop-up message should be displayed")
public void verifyLoginPopUpMessage() {
new ZomatoBL(SAMPLE_TEST_CONTEXT.ME, Runner.getPlatform()).verifyLoginPopUpMessage();
}
Expand Down
14 changes: 7 additions & 7 deletions src/test/resources/com/znsio/sample/e2e/features/zomato.feature
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ Feature: Book a dinner reservation without login in Zomato web application
# PLATFORM=web TAG=zomato CONFIG=./configs/zomato_local_config.properties ./gradlew clean run
Scenario: Without login try to book dinner reservation in Zomato web application
Given I successfully launch homepage of Zomato web application
When I click on dining option
When I select dining option
Then I should be redirected to dine-out page
When I select location as "New Delhi, Delhi, India"
Then I should get location selected as "New Delhi, Delhi, India"
When I select restaurant number 3 from results
Then I should get same restaurant which was selected
When I try to book a table for 4 guests on a date day after tomorrow
Then I should get login pop up message
When I select a specific location
Then the same location should be displayed
When I choose a restaurant from selected location
Then the same restaurant should be displayed
When I try to book a table
Then a login pop-up message should be displayed