Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
38 changes: 38 additions & 0 deletions .classpath
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" output="target/classes" path="src/main/java">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" output="target/test-classes" path="src/test/java">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
<attribute name="test" value="true"/>
</attributes>
</classpathentry>
<classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources">
<attributes>
<attribute name="maven.pomderived" value="true"/>
<attribute name="test" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="output" path="target/classes"/>
</classpath>
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,5 @@

# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*
/target/
.settings/org.eclipse.jdt.core.prefs
23 changes: 23 additions & 0 deletions .project
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>sapi2020test</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.m2e.core.maven2Builder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.m2e.core.maven2Nature</nature>
</natures>
</projectDescription>
524 changes: 524 additions & 0 deletions Review test plan.jmx

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ 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.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);
driver.get("http://localhost:8080/");
}

Expand Down Expand Up @@ -60,7 +60,7 @@ public void I_should_get_result_in_stories_list(String expectedResult)

@After
public void closeBrowser() {
driver.quit();
//driver.quit();
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
package ro.sapientia.mesteri2015.test;

import java.util.concurrent.TimeUnit;

import org.junit.Assert;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.By;

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 StoryReviewDefinition {

protected WebDriver driver;

@Before
public void setup() {
driver = new FirefoxDriver();
}

@Given("^I open the scrum tool add page and add a new story with name \"([^\"]*)\"$")
public void I_open_the_scrum_tool_add_page_and_add_a_new_story_with_name(String storyTitle) 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(storyTitle);

WebElement addStory = driver.findElement(By.id("add-story-button"));
addStory.click();


}

@When("^I push review button navigate to the review page$")
public void I_push_review_button_navigate_to_the_review_page() throws Throwable {
WebElement reviewButton = driver.findElement(By.id("add-story-review"));
reviewButton.click();

}

@When("^I enter \"([^\"]*)\" in the review box and push tre review button$")
public void I_enter_in_the_review_box_and_push_tre_review_button(String reviewString) throws Throwable {
WebElement titleTextBox = driver.findElement(By.id("review-status"));
titleTextBox.clear();
titleTextBox.sendKeys(reviewString);

WebElement addReview = driver.findElement(By.id("review-story-button"));
addReview.click();
}

@Then("^I should get result \"([^\"]*)\" in the story view$")
public void I_should_get_result_in_the_story_view(String reviewStatus) throws Throwable {

WebElement reviewStatusField = driver.findElement(By.id("review-status"));
String result = reviewStatusField.getText();

Assert.assertEquals(result, reviewStatus);
//driver.close();
}

@After
public void closeBrowser() {
driver.quit();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
package ro.sapientia.mesteri2015.test;

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 StoryReviewDeleteDefinition {

protected WebDriver driver;

@Before
public void setup() {
driver = new FirefoxDriver();
}

@Given("^I have story with name \"([^\"]*)\" and a review.$")
public void I_have_story_with_name_and_a_review(String storyname) 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(storyname);

WebElement addStory = driver.findElement(By.id("add-story-button"));
addStory.click();

WebElement reviewButton = driver.findElement(By.id("add-story-review"));
reviewButton.click();

WebElement reviewTitleTextBox = driver.findElement(By.id("review-status"));
reviewTitleTextBox.clear();
reviewTitleTextBox.sendKeys("Approved");

WebElement addReview = driver.findElement(By.id("review-story-button"));
addReview.click();
}

@When("^I push update review button navigate to the update review page where I can delete$")
public void I_push_update_review_button_navigate_to_the_update_review_page() throws Throwable {
WebElement updateReview = driver.findElement(By.id("update-story-review"));
updateReview.click();
}

@When("^I push the delete review button.$")
public void I_push_the_delete_review_button() throws Throwable {
WebElement addButton = driver.findElement(By.id("delete-story-review"));
addButton.click();
}

@Then("^I should not see review in the story view page$")
public void I_should_not_see_review_in_the_story_view_page() throws Throwable {

try
{
WebElement calculatorTextBox = driver.findElement(By.id("review-status"));
String result = calculatorTextBox.getText();
Assert.assertNull(result);
}catch (Exception ex){

}


//driver.close();
}

@After
public void closeBrowser() {
driver.quit();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
package ro.sapientia.mesteri2015.test;

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 StoryReviewModificationDefinition {

protected WebDriver driver;

@Before
public void setup() {
driver = new FirefoxDriver();
}

@Given("^I open the scrum tool add page and set up story with review named \"([^\"]*)\" with review of \"([^\"]*)\"$")
public void I_open_the_scrum_tool_add_page_and_set_up_story_with_review_named_with_review_of(String storyname,
String reviewStatus) 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(storyname);

WebElement addStory = driver.findElement(By.id("add-story-button"));
addStory.click();

WebElement reviewButton = driver.findElement(By.id("add-story-review"));
reviewButton.click();

WebElement reviewTitleTextBox = driver.findElement(By.id("review-status"));
reviewTitleTextBox.clear();
reviewTitleTextBox.sendKeys(reviewStatus);

WebElement addReview = driver.findElement(By.id("review-story-button"));
addReview.click();

}

@When("^I push update review button navigate to the update review page$")
public void I_push_update_review_button_navigate_to_the_update_review_page() throws Throwable {
WebElement updateReview = driver.findElement(By.id("update-story-review"));
updateReview.click();

}

@When("^I navigated to the update form I should see \"([^\"]*)\" in the review status$")
public void I_navigated_to_the_update_form_I_should_see_in_the_review_status(String reviewStatus) throws Throwable {

WebElement reviewTitleTextBox = driver.findElement(By.id("review-status"));
String result = reviewTitleTextBox.getAttribute("value");
Assert.assertEquals(reviewStatus, result);

}

@When("^I enter \"([^\"]*)\" in the review box and push the update button$")
public void I_enter_in_the_review_box_and_push_the_update_button(String reviewString) throws Throwable {
WebElement titleTextBox = driver.findElement(By.id("review-status"));
titleTextBox.clear();
titleTextBox.sendKeys(reviewString);

WebElement addReview = driver.findElement(By.id("review-story-button"));
addReview.click();
}

@Then("^I should get result \"([^\"]*)\" in the story view after update$")
public void I_should_get_result_in_the_story_view(String reviewStatus) throws Throwable {
WebElement reviewStatusField = driver.findElement(By.id("review-status"));
String result = reviewStatusField.getText();

Assert.assertEquals(result, reviewStatus);
//driver.close();
}

@After
public void closeBrowser() {
driver.quit();
}
}
10 changes: 5 additions & 5 deletions src/test/resources/ro/sapientia/mesteri2015/SCRUMTitle.feature
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Feature: Check if the scrum story add
Feature: Check if the scrum story add
As Sapientia scrum tool user I want to be able to add stories

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
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
13 changes: 13 additions & 0 deletions src/test/resources/ro/sapientia/mesteri2015/StoryReview.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
Feature: Ability to review existing story

Scenario: Approved
Given I open the scrum tool add page and add a new story with name "storytoreview"
When I push review button navigate to the review page
When I enter "Approved" in the review box and push tre review button
Then I should get result "Approved" in the story view

Scenario: Rejected
Given I open the scrum tool add page and add a new story with name "Rejectedstory"
When I push review button navigate to the review page
When I enter "Rejected" in the review box and push tre review button
Then I should get result "Rejected" in the story view
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
Feature: Ability to delete review from story

Scenario: Delete a review from story
Given I have story with name "storytoreview" and a review.
When I push update review button navigate to the update review page where I can delete
When I push the delete review button.
Then I should not see review in the story view page

Scenario: Delete a review from story
Given I have story with name "storytoreviewdelete2" and a review.
When I push update review button navigate to the update review page where I can delete
When I push the delete review button.
Then I should not see review in the story view page
Loading