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>
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,4 @@

# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*
/target/
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>
6 changes: 6 additions & 0 deletions .settings/org.eclipse.jdt.core.prefs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
org.eclipse.jdt.core.compiler.compliance=1.5
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
org.eclipse.jdt.core.compiler.release=disabled
org.eclipse.jdt.core.compiler.source=1.5
478 changes: 478 additions & 0 deletions Thread Group.jmx

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public void I_should_get_result_in_new_stories_list(String expectedResult) throw
// Verify that result of 2+2 is 4
Assert.assertEquals(result, expectedResult);
//Assert.assertNotSame(result, expectedResult);
driver.close();
//driver.close();
}

@After
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public void I_should_get_result_in_stories_list(String expectedResult)
// Verify that result of 2+2 is 4
Assert.assertEquals(result, expectedResult);

driver.close();
//driver.close();
}

@After
Expand Down
10 changes: 10 additions & 0 deletions src/test/java/ro/sapientia/mesteri2020/daily/DailyTest.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package ro.sapientia.mesteri2020.daily;

import org.junit.runner.RunWith;

import cucumber.api.junit.Cucumber;

@RunWith(Cucumber.class)
public class DailyTest {

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
package ro.sapientia.mesteri2020.daily.definition;

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

protected WebDriver driver;

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

@Given("^I open the tool and navigate to the daily add page$")
public void I_open_the_scrum_tool_add_page() throws Throwable {
driver.manage().timeouts().implicitlyWait(5, TimeUnit.SECONDS);
driver.get("http://localhost:8080/daily/list");

WebElement addButton = driver.findElement(By.id("add-button"));
addButton.click();
}

@When("^I enter \"([^\"]*)\" in the title textbox, \"([^\"]*)\" in the date textbox, \"([^\"]*)\" in the duration textbox and I push the add button$")
public void I_enter_in_the_title_textbox_in_the_date_textbox_in_the_duration_textbox_and_I_push_the_add_button(String title, String date, String duration) throws Throwable {


WebElement titleTextBox = driver.findElement(By.id("daily-title"));
titleTextBox.clear();
titleTextBox.sendKeys(title);

WebElement durationTextBox = driver.findElement(By.id("daily-duration"));
durationTextBox.clear();
durationTextBox.sendKeys(duration);

WebElement dateTextBox = driver.findElement(By.id("daily-datee"));
dateTextBox.clear();
dateTextBox.sendKeys(date);

WebElement addDailyButton = driver.findElement(By.id("add-daily-button"));
addDailyButton.click();
}

@Then("^I should get result \"([^\"]*)\" title \"([^\"]*)\" date \"([^\"]*)\" duration on view page$")
public void I_should_get_result_title_date_duration_on_view_page(String expectedTitle, String expectedDate, String expectedDuration) throws Throwable {
WebElement title = driver.findElement(By.id("daily-title"));
String result = title.getText();

Assert.assertEquals(result, expectedTitle);

WebElement date = driver.findElement(By.id("daily-datee"));
String datee = date.getText();

Assert.assertEquals(datee, "Date: " + expectedDate);

WebElement duration = driver.findElement(By.id("daily-duration"));
String durationn = duration.getText();

Assert.assertEquals(durationn, "Duration: " + expectedDuration);
}

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

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
package ro.sapientia.mesteri2020.daily.definition;

import static org.junit.Assert.assertEquals;

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

protected WebDriver driver;

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

@Given("^I open the tool and create a daily with title \"([^\"]*)\", duration \"([^\"]*)\", date \"([^\"]*)\"$")
public void I_open_the_tool_and_create_a_daily_with_title_duration_date(String expectedTitle, String expectedDuration, String expectedDate) throws Throwable {
driver.manage().timeouts().implicitlyWait(5, TimeUnit.SECONDS);
driver.get("http://localhost:8080/daily/list");

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

WebElement titleTextBox = driver.findElement(By.id("daily-title"));
titleTextBox.clear();
titleTextBox.sendKeys(expectedTitle);

WebElement durationTextBox = driver.findElement(By.id("daily-duration"));
durationTextBox.clear();
durationTextBox.sendKeys(expectedDuration);

WebElement dateTextBox = driver.findElement(By.id("daily-datee"));
dateTextBox.clear();
dateTextBox.sendKeys(expectedDate);

WebElement addDailyButton = driver.findElement(By.id("add-daily-button"));
addDailyButton.click();

WebElement title = driver.findElement(By.id("daily-title"));
String result = title.getText();

Assert.assertEquals(result, expectedTitle);

WebElement date = driver.findElement(By.id("daily-datee"));
String datee = date.getText();

Assert.assertEquals(datee, "Date: " + expectedDate);

WebElement duration = driver.findElement(By.id("daily-duration"));
String durationn = duration.getText();

Assert.assertEquals(durationn, "Duration: " + expectedDuration);
}

@When("^I press delete button$")
public void I_press_delete_button() throws Throwable {
WebElement updateButton = driver.findElement(By.id("delete-daily-link"));
updateButton.click();
}

@When("^I confirm delete$")
public void I_confirm_delete() throws Throwable {
WebElement deleteButton = driver.findElement(By.id("delete-daily-button"));
deleteButton.click();
}


//abban az esetben ha ures listaval kezdunk ^_^
@Then("^I puufff its deleted$")
public void I_puufff_its_deleted() throws Throwable {
WebElement container = driver.findElement(By.id("daily-list"));
assertEquals("No entries found.",container.getText());
}

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

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
package ro.sapientia.mesteri2020.daily.definition;

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 DailyUpdateDefinition {
protected WebDriver driver;

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


@Given("^I open the tool and navigate to an existing daily with title \"([^\"]*)\", duration \"([^\"]*)\", date \"([^\"]*)\"$")
public void I_open_the_tool_and_navigate_to_an_existing_daily_with_title_duration_date(String expectedTitle, String expectedDuration, String expectedDate) throws Throwable {
driver.manage().timeouts().implicitlyWait(5, TimeUnit.SECONDS);
driver.get("http://localhost:8080/daily/list");

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

WebElement titleTextBox = driver.findElement(By.id("daily-title"));
titleTextBox.clear();
titleTextBox.sendKeys(expectedTitle);

WebElement durationTextBox = driver.findElement(By.id("daily-duration"));
durationTextBox.clear();
durationTextBox.sendKeys(expectedDuration);

WebElement dateTextBox = driver.findElement(By.id("daily-datee"));
dateTextBox.clear();
dateTextBox.sendKeys(expectedDate);

WebElement addDailyButton = driver.findElement(By.id("add-daily-button"));
addDailyButton.click();

WebElement title = driver.findElement(By.id("daily-title"));
String result = title.getText();

Assert.assertEquals(result, expectedTitle);

WebElement date = driver.findElement(By.id("daily-datee"));
String datee = date.getText();

Assert.assertEquals(datee, "Date: " + expectedDate);

WebElement duration = driver.findElement(By.id("daily-duration"));
String durationn = duration.getText();

Assert.assertEquals(durationn, "Duration: " + expectedDuration);
}

@When("^I press update button$")
public void I_press_update_button() throws Throwable {
WebElement updateButton = driver.findElement(By.id("update-button"));
updateButton.click();
}

@When("^Check title to be \"([^\"]*)\", duration \"([^\"]*)\", date \"([^\"]*)\"$")
public void Check_title_to_be_duration_date(String expectedTitle, String expectedDuration, String expectedDate) throws Throwable {
WebElement title = driver.findElement(By.id("daily-title"));
String result = title.getAttribute("value");

Assert.assertEquals(result, expectedTitle);

WebElement date = driver.findElement(By.id("daily-datee"));
String datee = date.getAttribute("value");

Assert.assertEquals(datee, expectedDate);

WebElement duration = driver.findElement(By.id("daily-duration"));
String durationn = duration.getAttribute("value");

Assert.assertEquals(durationn, expectedDuration);
}

@When("^I change title to \"([^\"]*)\" and press update$")
public void I_change_title_to_and_press_update(String title) throws Throwable {
WebElement titleTextBox = driver.findElement(By.id("daily-title"));
titleTextBox.clear();
titleTextBox.sendKeys(title);

WebElement updateButton = driver.findElement(By.id("update-daily-button"));
updateButton.click();
}

@Then("^I should get result \"([^\"]*)\" title \"([^\"]*)\" date \"([^\"]*)\" duration after update$")
public void I_should_get_result_title_date_duration_after_update(String expectedTitle, String expectedDate, String expectedDuration) throws Throwable {
WebElement title = driver.findElement(By.id("daily-title"));
String result = title.getText();

Assert.assertEquals(result, expectedTitle);

WebElement date = driver.findElement(By.id("daily-datee"));
String datee = date.getText();

Assert.assertEquals(datee, "Date: " + expectedDate);

WebElement duration = driver.findElement(By.id("daily-duration"));
String durationn = duration.getText();

Assert.assertEquals(durationn, "Duration: " + expectedDuration);
}

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

}
Loading