From e79d0f7188ed38a0ef948d9952b08923c1b930aa Mon Sep 17 00:00:00 2001 From: Patrick <50352812+Mueller-Patrick@users.noreply.github.com> Date: Thu, 5 Nov 2020 11:59:06 +0100 Subject: [PATCH] BETTERZON-21: Adding cucumber tests for Price Alarms --- .../src/test/java/stepdefs/PriceAlarm.java | 55 +++++++++++++++++++ .../src/test/resource/priceAlarms.feature | 20 +++++++ 2 files changed, 75 insertions(+) create mode 100644 CucumberTests/src/test/java/stepdefs/PriceAlarm.java create mode 100644 CucumberTests/src/test/resource/priceAlarms.feature diff --git a/CucumberTests/src/test/java/stepdefs/PriceAlarm.java b/CucumberTests/src/test/java/stepdefs/PriceAlarm.java new file mode 100644 index 0000000..1173e23 --- /dev/null +++ b/CucumberTests/src/test/java/stepdefs/PriceAlarm.java @@ -0,0 +1,55 @@ +package stepdefs; + +import cucumber.api.java.en.Given; +import cucumber.api.java.en.Then; +import cucumber.api.java.en.When; + +public class PriceAlarm { + @Given("^the user has at least (\\d+) price alarm set$") + public void the_user_has_at_least_price_alarm_set(int arg1) throws Exception { + } + + @When("^the user clicks on the profile icon$") + public void the_user_clicks_on_the_profile_icon() throws Exception { + } + + @Then("^the profile details popup should open$") + public void the_profile_details_popup_should_open() throws Exception { + } + + @When("^the user clicks on price alarms$") + public void the_user_clicks_on_price_alarms() throws Exception { + } + + @Then("^the price alarm list should open$") + public void the_price_alarm_list_should_open() throws Exception { + } + + @Then("^the price alarm list should contain at least (\\d+) entry$") + public void the_price_alarm_list_should_contain_at_least_entry(int arg1) throws Exception { + } + + @Then("^the price alarm list should contain a maximum of (\\d+) entries per page$") + public void the_price_alarm_list_should_contain_a_maximum_of_entries_per_page(int arg1) throws Exception { + } + + @Given("^the user is on the price alarm list page$") + public void the_user_is_on_the_price_alarm_list_page() throws Exception { + } + + @When("^the user clicks on the \"([^\"]*)\" button next to a price alarm$") + public void the_user_clicks_on_the_button_next_to_a_price_alarm(String arg1) throws Exception { + } + + @Then("^a popup should open asking the user to confirm the removal$") + public void a_popup_should_open_asking_the_user_to_confirm_the_removal() throws Exception { + } + + @When("^the user confirms the removal of the price alarm$") + public void the_user_confirms_the_removal_of_the_price_alarm() throws Exception { + } + + @Then("^the price alarm should be removed from the database$") + public void the_price_alarm_should_be_removed_from_the_database() throws Exception { + } +} diff --git a/CucumberTests/src/test/resource/priceAlarms.feature b/CucumberTests/src/test/resource/priceAlarms.feature new file mode 100644 index 0000000..0d2a79b --- /dev/null +++ b/CucumberTests/src/test/resource/priceAlarms.feature @@ -0,0 +1,20 @@ +Feature: Price Alarms + + Scenario: Show a list of price alarms + Given the user is on the landing page + And the user is logged in + And the user has at least 1 price alarm set + When the user clicks on the profile icon + Then the profile details popup should open + When the user clicks on price alarms + Then the price alarm list should open + And the price alarm list should contain at least 1 entry + And the price alarm list should contain a maximum of 20 entries per page + + Scenario: Remove a price alarm + Given the user is on the price alarm list page + And the user is logged in + When the user clicks on the "remove" button next to a price alarm + Then a popup should open asking the user to confirm the removal + When the user confirms the removal of the price alarm + Then the price alarm should be removed from the database