mirror of
https://github.com/Mueller-Patrick/Betterzon.git
synced 2024-11-22 14:23:57 +00:00
BETTERZON-21: Adding .feature for searching Product and began work on stepdefs file
This commit is contained in:
parent
8833bed232
commit
482474d10d
|
@ -3,9 +3,12 @@
|
||||||
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
||||||
<exclude-output />
|
<exclude-output />
|
||||||
<content url="file://$MODULE_DIR$">
|
<content url="file://$MODULE_DIR$">
|
||||||
|
<sourceFolder url="file://$MODULE_DIR$/e2e" isTestSource="true" />
|
||||||
|
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
|
||||||
<excludeFolder url="file://$MODULE_DIR$/dist" />
|
<excludeFolder url="file://$MODULE_DIR$/dist" />
|
||||||
<excludeFolder url="file://$MODULE_DIR$/tmp" />
|
<excludeFolder url="file://$MODULE_DIR$/tmp" />
|
||||||
</content>
|
</content>
|
||||||
|
<orderEntry type="jdk" jdkName="14" jdkType="JavaSDK" />
|
||||||
<orderEntry type="sourceFolder" forTests="false" />
|
<orderEntry type="sourceFolder" forTests="false" />
|
||||||
</component>
|
</component>
|
||||||
</module>
|
</module>
|
29
CucumberTests/src/test/java/stepdefs/SearchProduct.java
Normal file
29
CucumberTests/src/test/java/stepdefs/SearchProduct.java
Normal file
|
@ -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
|
Scenario: Breaker joins a game
|
||||||
Given the Maker has started a game with the word "silky"
|
Given the Maker has started a game with the word "silky"
|
||||||
When the Breaker joins the Maker's game
|
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
|
||||||
|
|
26
CucumberTests/src/test/resource/searchProduct.feature
Normal file
26
CucumberTests/src/test/resource/searchProduct.feature
Normal file
|
@ -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
|
Loading…
Reference in New Issue
Block a user