mirror of
https://github.com/Mueller-Patrick/Betterzon.git
synced 2026-04-26 23:30:11 +00:00
BETTERZON-21: Adding .feature for searching Product and began work on stepdefs file
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
package stepdefs;
|
||||
|
||||
import cucumber.api.PendingException;
|
||||
import cucumber.api.java.en.And;
|
||||
import cucumber.api.java.en.Given;
|
||||
import cucumber.api.java.en.Then;
|
||||
import cucumber.api.java.en.When;
|
||||
|
||||
public class SearchProduct {
|
||||
@Given("^the user is on the landing page$")
|
||||
public void the_user_is_on_the_landing_page() throws Exception {
|
||||
}
|
||||
|
||||
@When("^the user enters the search term \"([^\"]*)\" and clicks search$")
|
||||
public void the_user_enters_the_search_term_and_clicks_search(String arg0) throws Exception {
|
||||
}
|
||||
|
||||
@Then("^the user should see the error page \"([^\"]*)\"$")
|
||||
public void the_user_should_see_the_error_page(String arg0) throws Exception {
|
||||
}
|
||||
|
||||
@And("^the user is not logged in$")
|
||||
public void the_user_is_not_logged_in() throws Exception {
|
||||
}
|
||||
|
||||
@And("^the user is logged in$")
|
||||
public void the_user_is_logged_in() throws Exception {
|
||||
}
|
||||
}
|
||||
@@ -9,4 +9,4 @@ Feature: Guess the word
|
||||
Scenario: Breaker joins a game
|
||||
Given the Maker has started a game with the word "silky"
|
||||
When the Breaker joins the Maker's game
|
||||
Then the Breaker must guess a word with 5 characters
|
||||
Then the Breaker must guess a word with 5 characters
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
Feature: Search a Product
|
||||
|
||||
Scenario: User searches for unknown product
|
||||
Given the user is on the landing page
|
||||
When the user enters the search term "iPhone 13" and clicks search
|
||||
Then the user should see the error page "No products found"
|
||||
|
||||
Scenario: User is not logged in, searches for known product
|
||||
Given the user is on the landing page
|
||||
And the user is not logged in
|
||||
When the user enters the search term "iPhone 12" and clicks search
|
||||
Then the user should see a list of products
|
||||
When the user clicks on the first product
|
||||
Then the user should see the product detail page
|
||||
And the set price alarm box should show "Log in to continue"
|
||||
|
||||
Scenario: User is logged in, searches for known product
|
||||
Given the user is on the landing page
|
||||
And the user is logged in
|
||||
When the user enters the search term "iPhone 12" and clicks search
|
||||
Then the user should see a list of products
|
||||
When the user clicks on the first product
|
||||
Then the user should see the product detail page
|
||||
And the set price alarm box should show "Set price alarm"
|
||||
When the user sets a price alarm
|
||||
Then the user should receive an email confirming the price alarm
|
||||
Reference in New Issue
Block a user