diff --git a/Project_List.jmx b/Project_List.jmx new file mode 100644 index 0000000..ce59abc --- /dev/null +++ b/Project_List.jmx @@ -0,0 +1,174 @@ + + + + + + false + false + + + + + + + + continue + + false + 1 + + 10 + 1 + 1610499543000 + 1610499543000 + false + + + + + + + + User-Agent + Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:85.0) Gecko/20100101 Firefox/85.0 + + + + + + + + 836514399E15F17D2076887C1A1072A5 + localhost:8080 + /project/add + true + 0 + true + true + + + false + + + + SizeAssertion.response_network_size + 10 + 3 + + + + false + + saveConfig + + + true + true + true + + true + true + true + true + false + true + true + false + false + false + false + false + false + false + false + 0 + true + true + + + + + + + false + + saveConfig + + + true + true + true + + true + true + true + true + false + true + true + false + false + false + false + false + false + false + false + 0 + true + true + + + + + + + false + + saveConfig + + + true + true + true + + true + true + true + true + false + true + true + false + false + false + false + false + false + false + false + 0 + true + true + + + + + + + + + + + + + + + + /project/add + 4 + + + + + diff --git a/pom.xml b/pom.xml index 0158847..c49e5a0 100644 --- a/pom.xml +++ b/pom.xml @@ -4,28 +4,27 @@ cucumberScumSapientia 0.0.1-SNAPSHOT - - junit - junit - 4.11 - test - org.seleniumhq.selenium selenium-java - 2.45.0 + 3.141.59 info.cukes cucumber-java - 1.1.2 + 1.2.5 test info.cukes cucumber-junit - 1.1.2 + 1.2.5 test + + org.seleniumhq.selenium + selenium-firefox-driver + 3.141.59 + \ No newline at end of file diff --git a/src/test/java/ro/sapientia/mesteri2015/delete/DeleteStory.java b/src/test/java/ro/sapientia/mesteri2015/delete/DeleteStory.java new file mode 100644 index 0000000..659d389 --- /dev/null +++ b/src/test/java/ro/sapientia/mesteri2015/delete/DeleteStory.java @@ -0,0 +1,10 @@ +package ro.sapientia.mesteri2015.delete; + +import org.junit.runner.RunWith; + +import cucumber.api.junit.Cucumber; + +@RunWith(Cucumber.class) +public class DeleteStory { + +} diff --git a/src/test/java/ro/sapientia/mesteri2015/delete/defintion/StoryDeleteDefinition.java b/src/test/java/ro/sapientia/mesteri2015/delete/defintion/StoryDeleteDefinition.java new file mode 100644 index 0000000..3330e84 --- /dev/null +++ b/src/test/java/ro/sapientia/mesteri2015/delete/defintion/StoryDeleteDefinition.java @@ -0,0 +1,62 @@ +package ro.sapientia.mesteri2015.delete.defintion; + +import static org.junit.Assert.assertEquals; + +import java.util.concurrent.TimeUnit; + +import org.openqa.selenium.By; +import org.openqa.selenium.WebDriver; +import org.openqa.selenium.WebElement; +import org.openqa.selenium.firefox.FirefoxDriver; + +import cucumber.api.java.After; +import cucumber.api.java.Before; +import cucumber.api.java.en.Given; +import cucumber.api.java.en.Then; +import cucumber.api.java.en.When; + +public class StoryDeleteDefinition { + + protected WebDriver driver; + + @Before + public void setup() { + driver = new FirefoxDriver(); + } + + @Given("^letrehozunk 1 uj \"([^\"]*)\" element$") + public void letrehozunk_uj_delete_element(final String elementName) throws Throwable { + driver.manage().timeouts().implicitlyWait(5, TimeUnit.SECONDS); + driver.get("http://localhost:8080/"); + WebElement addButton = driver.findElement(By.id("add-button")); + addButton.click(); + WebElement titleTextBox = driver.findElement(By.id("story-title")); + titleTextBox.clear(); + titleTextBox.sendKeys(elementName); + WebElement descriptionTextBox = driver.findElement(By.id("story-description")); + descriptionTextBox.clear(); + descriptionTextBox.sendKeys(elementName); + + WebElement searchButton = driver.findElement(By.id("add-story-button")); + searchButton.click(); + } + + @When("^megnyomjuk a delete gombot es meg egyszer a delete gombot$") + public void megnyomjuk_a_delete_gombot_es_meg_egyszer_a_delete_gombot() throws Throwable { + WebElement deleteLink = driver.findElement(By.id("delete-story-link")); + deleteLink.click(); + WebElement deleteButton = driver.findElement(By.id("delete-story-button")); + deleteButton.click(); + } + + @Then("^elem eltunik$") + public void elem_eltunik() throws Throwable { + WebElement storyContainer = driver.findElement(By.id("story-list")); + assertEquals("No entries found.",storyContainer.getText()); + } + + @After + public void closeBrowser() { + driver.close(); + } +} diff --git a/src/test/java/ro/sapientia/mesteri2015/project/SCRUMProjectAdd.feature b/src/test/java/ro/sapientia/mesteri2015/project/SCRUMProjectAdd.feature new file mode 100644 index 0000000..700933a --- /dev/null +++ b/src/test/java/ro/sapientia/mesteri2015/project/SCRUMProjectAdd.feature @@ -0,0 +1,8 @@ +Feature: Check if the scrum project add + As Sapientia scrum tool user I want to be able to add projects + + Scenario: Add a new project with title and description + Given I open the add project page + When I enter "title1" in the title textbox and I enter the "description1" in the description textbox and I push the add project button + Then I should get the result "title1" and "description1" in projects list + \ No newline at end of file diff --git a/src/test/java/ro/sapientia/mesteri2015/project/SCRUMProjectAddStepDefinition.java b/src/test/java/ro/sapientia/mesteri2015/project/SCRUMProjectAddStepDefinition.java new file mode 100644 index 0000000..2df284f --- /dev/null +++ b/src/test/java/ro/sapientia/mesteri2015/project/SCRUMProjectAddStepDefinition.java @@ -0,0 +1,67 @@ +package ro.sapientia.mesteri2015.project; + +import java.util.concurrent.TimeUnit; + +import org.junit.Assert; +import org.openqa.selenium.By; +import org.openqa.selenium.WebDriver; +import org.openqa.selenium.WebElement; +import org.openqa.selenium.firefox.FirefoxDriver; + +import cucumber.api.java.After; +import cucumber.api.java.Before; +import cucumber.api.java.en.Given; +import cucumber.api.java.en.Then; +import cucumber.api.java.en.When; + +public class SCRUMProjectAddStepDefinition { + + protected WebDriver driver; + + @Before + public void setup() { + driver = new FirefoxDriver(); + } + + @Given("^I open the add project page$") + public void i_open_the_add_project_page() throws Throwable { + driver.manage().timeouts().implicitlyWait(5, TimeUnit.SECONDS); + driver.get("http://localhost:8080/project/add"); + } + + + + @When("^I enter \"([^\"]*)\" in the title textbox and I enter the \"([^\"]*)\" in the description textbox and I push the add project button$") + public void i_enter_in_the_title_textbox_and_I_enter_the_in_the_description_textbox_and_I_push_the_add_project_button(String title, String description) throws Throwable { + WebElement addButton = driver.findElement(By.id("add-button")); + addButton.click(); + + WebElement projecttitleTextBox = driver.findElement(By.id("epic-title")); + projecttitleTextBox.clear(); + projecttitleTextBox.sendKeys(title); + WebElement descriptionTextBox = driver.findElement(By.id("epic-description")); + descriptionTextBox.clear(); + descriptionTextBox.sendKeys(description); + + WebElement addProjectButton = driver.findElement(By.id("add-epic-button")); + addProjectButton.click(); + } + + + + @Then("^I should get the result \"([^\"]*)\"and\"([^\"]*)\" in projects list$") + public void i_should_get_the_result_with_the_title_and_description_in_projects_list(String titleResult, String descriptionResult) throws Throwable { + WebElement projectTitleTextBox = driver.findElement(By.id("epic-title")); + WebElement projectDescriptionTextBox = driver.findElement(By.id("epic-description")); + String p1 = projectTitleTextBox.getText(); + String p2 = projectDescriptionTextBox.getText(); + Assert.assertEquals(p1, titleResult); + Assert.assertEquals(p2, descriptionResult); + } + + @After + public void closeBrowser() { + driver.close(); + } + +} \ No newline at end of file diff --git a/src/test/java/ro/sapientia/mesteri2015/project/SCRUMProjectDelete.feature b/src/test/java/ro/sapientia/mesteri2015/project/SCRUMProjectDelete.feature new file mode 100644 index 0000000..b85b892 --- /dev/null +++ b/src/test/java/ro/sapientia/mesteri2015/project/SCRUMProjectDelete.feature @@ -0,0 +1,10 @@ +Feature: Check deleting a project works + As Sapientia scrum tool user I want to be able to delete projects + + Scenario: Delete a new project + Given Add a new project and delete it + When I click the delete button + Then The project disappears + + + \ No newline at end of file diff --git a/src/test/java/ro/sapientia/mesteri2015/project/SCRUMProjectDeleteStepDefinition.java b/src/test/java/ro/sapientia/mesteri2015/project/SCRUMProjectDeleteStepDefinition.java new file mode 100644 index 0000000..f21d387 --- /dev/null +++ b/src/test/java/ro/sapientia/mesteri2015/project/SCRUMProjectDeleteStepDefinition.java @@ -0,0 +1,61 @@ +package ro.sapientia.mesteri2015.project; + +import static org.junit.Assert.assertEquals; + +import java.util.concurrent.TimeUnit; + +import org.junit.Assert; +import org.openqa.selenium.By; +import org.openqa.selenium.WebDriver; +import org.openqa.selenium.WebElement; +import org.openqa.selenium.firefox.FirefoxDriver; + +import cucumber.api.java.After; +import cucumber.api.java.Before; +import cucumber.api.java.en.Given; +import cucumber.api.java.en.Then; +import cucumber.api.java.en.When; + +public class SCRUMProjectDeleteStepDefinition { + + protected WebDriver driver; + + @Before + public void setup() { + driver = new FirefoxDriver(); + } + + @Given("^I add a new project and delete it$") + public void i_add_a_new_project_and_delete_it(final String elementName) throws Throwable { + driver.manage().timeouts().implicitlyWait(5, TimeUnit.SECONDS); + driver.get("http://localhost:8080/project/list"); + WebElement addButton = driver.findElement(By.id("add-button")); + addButton.click(); + WebElement titleTextBox = driver.findElement(By.id("epic-title")); + titleTextBox.clear(); + titleTextBox.sendKeys(elementName); + WebElement descriptionTextBox = driver.findElement(By.id("epic-description")); + descriptionTextBox.clear(); + descriptionTextBox.sendKeys(elementName); + + WebElement searchButton = driver.findElement(By.id("add-epic-button")); + searchButton.click(); + } + + @When("^I click the delete button$") + public void i_click_the_delete_button() throws Throwable { + WebElement deleteLink = driver.findElement(By.id("delete-epic-link")); + deleteLink.click(); + } + + @Then("^The project disappears$") + public void the_project_disappears() throws Throwable { + WebElement storyContainer = driver.findElement(By.id("project-list")); + assertEquals("No entries found.",storyContainer.getText()); + } + + @After + public void closeBrowser() { + driver.close(); + } +} \ No newline at end of file diff --git a/src/test/java/ro/sapientia/mesteri2015/project/SCRUMProjectTest.java b/src/test/java/ro/sapientia/mesteri2015/project/SCRUMProjectTest.java new file mode 100644 index 0000000..8d91089 --- /dev/null +++ b/src/test/java/ro/sapientia/mesteri2015/project/SCRUMProjectTest.java @@ -0,0 +1,9 @@ +package ro.sapientia.mesteri2015.project; + +import org.junit.runner.RunWith; + +import cucumber.api.junit.Cucumber; + +@RunWith(Cucumber.class) +public class SCRUMProjectTest { +} diff --git a/src/test/java/ro/sapientia/mesteri2015/test/SCRUMTitleStepDefinition.java b/src/test/java/ro/sapientia/mesteri2015/test/SCRUMTitleStepDefinition.java index df5d926..5568c02 100644 --- a/src/test/java/ro/sapientia/mesteri2015/test/SCRUMTitleStepDefinition.java +++ b/src/test/java/ro/sapientia/mesteri2015/test/SCRUMTitleStepDefinition.java @@ -25,7 +25,6 @@ public void setup() { @Given("^I open the scrum tool add page$") public void I_open_the_scrum_tool_add_page() throws Throwable { - // Set implicit wait of 10 seconds and launch google driver.manage().timeouts().implicitlyWait(5, TimeUnit.SECONDS); driver.get("http://localhost:8080/"); } @@ -36,12 +35,10 @@ public void I_enter_in_the_title_textbox_and_I_push_the_add_button( WebElement addButton = driver.findElement(By.id("add-button")); addButton.click(); - // Write term in google textbox WebElement titleTextBox = driver.findElement(By.id("story-title")); titleTextBox.clear(); titleTextBox.sendKeys(additionTerms); - // Click on searchButton WebElement searchButton = driver.findElement(By.id("add-story-button")); searchButton.click(); } @@ -52,7 +49,6 @@ public void I_should_get_result_in_stories_list(String expectedResult) WebElement calculatorTextBox = driver.findElement(By.id("story-title")); String result = calculatorTextBox.getText(); - // Verify that result of 2+2 is 4 Assert.assertEquals(result, expectedResult); driver.close(); @@ -60,7 +56,7 @@ public void I_should_get_result_in_stories_list(String expectedResult) @After public void closeBrowser() { - driver.quit(); + //driver.quit(); } } diff --git a/src/test/resources/ro/sapientia/mesteri2015/SCRUMTitle.feature b/src/test/resources/ro/sapientia/mesteri2015/SCRUMTitle.feature index 3e5cd5f..0d14dcd 100644 --- a/src/test/resources/ro/sapientia/mesteri2015/SCRUMTitle.feature +++ b/src/test/resources/ro/sapientia/mesteri2015/SCRUMTitle.feature @@ -4,4 +4,9 @@ Feature: Check if the scrum story add Scenario: Title1 Given I open the scrum tool add page When I enter "title1" in the title textbox and I push the add button - Then I should get result "title1" in stories list \ No newline at end of file + Then I should get result "title1" in stories list + + Scenario: Title4 + Given I open the scrum tool add page + When I enter "title4" in the title textbox and I push the add button + Then I should get result "title4" in stories list \ No newline at end of file diff --git a/src/test/resources/ro/sapientia/mesteri2015/delete/StoryDelete.feature b/src/test/resources/ro/sapientia/mesteri2015/delete/StoryDelete.feature new file mode 100644 index 0000000..409cd3a --- /dev/null +++ b/src/test/resources/ro/sapientia/mesteri2015/delete/StoryDelete.feature @@ -0,0 +1,11 @@ +Feature: Egy elem torlese + +Scenario: Toroljunk le egy uj elemet + Given letrehozunk 1 uj "alma" element + When megnyomjuk a delete gombot es meg egyszer a delete gombot + Then elem eltunik + +Scenario: Toroljunk le egy uj elemet + Given letrehozunk 1 uj "korte" element + When megnyomjuk a delete gombot es meg egyszer a delete gombot + Then elem eltunik \ No newline at end of file diff --git a/target/classes/META-INF/MANIFEST.MF b/target/classes/META-INF/MANIFEST.MF index 4172621..dfcad30 100644 --- a/target/classes/META-INF/MANIFEST.MF +++ b/target/classes/META-INF/MANIFEST.MF @@ -1,5 +1,5 @@ Manifest-Version: 1.0 Built-By: sapi -Build-Jdk: 11.0.9 +Build-Jdk: 11.0.9.1 Created-By: Maven Integration for Eclipse diff --git a/target/classes/META-INF/maven/CucumberScrumSapientia/cucumberScumSapientia/pom.properties b/target/classes/META-INF/maven/CucumberScrumSapientia/cucumberScumSapientia/pom.properties index 585074e..a5b31bb 100644 --- a/target/classes/META-INF/maven/CucumberScrumSapientia/cucumberScumSapientia/pom.properties +++ b/target/classes/META-INF/maven/CucumberScrumSapientia/cucumberScumSapientia/pom.properties @@ -1,5 +1,5 @@ #Generated by Maven Integration for Eclipse -#Thu Nov 12 19:29:30 EET 2020 +#Wed Jan 13 02:00:06 EET 2021 m2e.projectLocation=/home/sapi/git/sapi02 m2e.projectName=SCRUMSeleniumCucumberTest groupId=CucumberScrumSapientia diff --git a/target/classes/META-INF/maven/CucumberScrumSapientia/cucumberScumSapientia/pom.xml b/target/classes/META-INF/maven/CucumberScrumSapientia/cucumberScumSapientia/pom.xml index 0158847..c49e5a0 100644 --- a/target/classes/META-INF/maven/CucumberScrumSapientia/cucumberScumSapientia/pom.xml +++ b/target/classes/META-INF/maven/CucumberScrumSapientia/cucumberScumSapientia/pom.xml @@ -4,28 +4,27 @@ cucumberScumSapientia 0.0.1-SNAPSHOT - - junit - junit - 4.11 - test - org.seleniumhq.selenium selenium-java - 2.45.0 + 3.141.59 info.cukes cucumber-java - 1.1.2 + 1.2.5 test info.cukes cucumber-junit - 1.1.2 + 1.2.5 test + + org.seleniumhq.selenium + selenium-firefox-driver + 3.141.59 + \ No newline at end of file diff --git a/target/test-classes/ro/sapientia/mesteri2015/SCRUMTitle.feature b/target/test-classes/ro/sapientia/mesteri2015/SCRUMTitle.feature index 3e5cd5f..0d14dcd 100644 --- a/target/test-classes/ro/sapientia/mesteri2015/SCRUMTitle.feature +++ b/target/test-classes/ro/sapientia/mesteri2015/SCRUMTitle.feature @@ -4,4 +4,9 @@ Feature: Check if the scrum story add Scenario: Title1 Given I open the scrum tool add page When I enter "title1" in the title textbox and I push the add button - Then I should get result "title1" in stories list \ No newline at end of file + Then I should get result "title1" in stories list + + Scenario: Title4 + Given I open the scrum tool add page + When I enter "title4" in the title textbox and I push the add button + Then I should get result "title4" in stories list \ No newline at end of file diff --git a/target/test-classes/ro/sapientia/mesteri2015/delete/StoryDelete.feature b/target/test-classes/ro/sapientia/mesteri2015/delete/StoryDelete.feature new file mode 100644 index 0000000..409cd3a --- /dev/null +++ b/target/test-classes/ro/sapientia/mesteri2015/delete/StoryDelete.feature @@ -0,0 +1,11 @@ +Feature: Egy elem torlese + +Scenario: Toroljunk le egy uj elemet + Given letrehozunk 1 uj "alma" element + When megnyomjuk a delete gombot es meg egyszer a delete gombot + Then elem eltunik + +Scenario: Toroljunk le egy uj elemet + Given letrehozunk 1 uj "korte" element + When megnyomjuk a delete gombot es meg egyszer a delete gombot + Then elem eltunik \ No newline at end of file diff --git a/target/test-classes/ro/sapientia/mesteri2015/project/SCRUMProjectAdd.feature b/target/test-classes/ro/sapientia/mesteri2015/project/SCRUMProjectAdd.feature new file mode 100644 index 0000000..700933a --- /dev/null +++ b/target/test-classes/ro/sapientia/mesteri2015/project/SCRUMProjectAdd.feature @@ -0,0 +1,8 @@ +Feature: Check if the scrum project add + As Sapientia scrum tool user I want to be able to add projects + + Scenario: Add a new project with title and description + Given I open the add project page + When I enter "title1" in the title textbox and I enter the "description1" in the description textbox and I push the add project button + Then I should get the result "title1" and "description1" in projects list + \ No newline at end of file diff --git a/target/test-classes/ro/sapientia/mesteri2015/project/SCRUMProjectDelete.feature b/target/test-classes/ro/sapientia/mesteri2015/project/SCRUMProjectDelete.feature new file mode 100644 index 0000000..b85b892 --- /dev/null +++ b/target/test-classes/ro/sapientia/mesteri2015/project/SCRUMProjectDelete.feature @@ -0,0 +1,10 @@ +Feature: Check deleting a project works + As Sapientia scrum tool user I want to be able to delete projects + + Scenario: Delete a new project + Given Add a new project and delete it + When I click the delete button + Then The project disappears + + + \ No newline at end of file