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
34 changes: 34 additions & 0 deletions .classpath
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<?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="test" value="true"/>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources">
<attributes>
<attribute name="test" value="true"/>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry exported="true" kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="output" path="target/classes"/>
</classpath>
24 changes: 0 additions & 24 deletions .github/workflows/maven.yml

This file was deleted.

24 changes: 1 addition & 23 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,23 +1 @@
# Compiled class file
*.class

# Log file
*.log

# BlueJ files
*.ctxt

# Mobile Tools for Java (J2ME)
.mtj.tmp/

# Package Files #
*.jar
*.war
*.nar
*.ear
*.zip
*.tar.gz
*.rar

# 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>SCRUMSeleniumCucumberTest</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>
9 changes: 9 additions & 0 deletions .settings/org.eclipse.jdt.core.prefs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
org.eclipse.jdt.core.compiler.compliance=1.5
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
org.eclipse.jdt.core.compiler.release=disabled
org.eclipse.jdt.core.compiler.source=1.5
4 changes: 4 additions & 0 deletions .settings/org.eclipse.m2e.core.prefs
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
activeProfiles=
eclipse.preferences.version=1
resolveWorkspaceProjects=true
version=1
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
<version>2.45.0</version>
<version>3.141.59</version>
</dependency>
<dependency>
<groupId>info.cukes</groupId>
Expand Down
16 changes: 8 additions & 8 deletions src/test/java/ro/sapientia/mesteri2015/SCRUMTitleTest.java
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package ro.sapientia.mesteri2015;

import org.junit.runner.RunWith;
import cucumber.api.junit.Cucumber;

@RunWith(Cucumber.class)
public class SCRUMTitleTest {
}
//package ro.sapientia.mesteri2015;
//
//import org.junit.runner.RunWith;
//import cucumber.api.junit.Cucumber;
//
//@RunWith(Cucumber.class)
//public class SCRUMTitleTest {
//}
10 changes: 10 additions & 0 deletions src/test/java/ro/sapientia/mesteri2015/add/AddProject.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package ro.sapientia.mesteri2015.add;

import org.junit.runner.RunWith;

import cucumber.api.junit.Cucumber;

@RunWith(Cucumber.class)
public class AddProject {

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
package ro.sapientia.mesteri2015.add.definition;

import static org.junit.Assert.assertEquals;

import java.util.List;
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 ProjectAddDefinition {

protected WebDriver driver;

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

@Given("^we create a new project with name \"([^\"]*)\"$")
public void we_create_a_new_project_with_name(final String elementName) throws Throwable {
driver.manage().timeouts().implicitlyWait(5, TimeUnit.SECONDS);
driver.get("http://localhost:8080/projects/");
WebElement addButton = driver.findElement(By.id("add-button"));
addButton.click();
WebElement titleTextBox = driver.findElement(By.id("project-name"));
titleTextBox.clear();
titleTextBox.sendKeys(elementName);

WebElement searchButton = driver.findElement(By.id("add-project-button"));
searchButton.click();
driver.manage().timeouts().implicitlyWait(5, TimeUnit.SECONDS);
}

@When("^we load the projects url$")
public void we_load_the_project_url() throws Throwable {
driver.manage().timeouts().implicitlyWait(5, TimeUnit.SECONDS);
driver.get("http://localhost:8080/projects");
}

@Then("^project name is \"([^\"]*)\"$")
public void hozzaadott_projekt_neve_talal(String expectedProjectName) throws Throwable {
driver.manage().timeouts().implicitlyWait(5, TimeUnit.SECONDS);
List<WebElement> projectNames = driver.findElements(By.id("project-name-owner"));
for (WebElement webEl: projectNames) {
if (webEl.getText().contains(expectedProjectName)) {
assertEquals(expectedProjectName + " -", webEl.getText());
break;
}
}
}

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

import org.junit.runner.RunWith;

import cucumber.api.junit.Cucumber;

@RunWith(Cucumber.class)
public class DeleteMissingProject {

}
10 changes: 10 additions & 0 deletions src/test/java/ro/sapientia/mesteri2015/delete/DeleteProject.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package ro.sapientia.mesteri2015.delete;

import org.junit.runner.RunWith;

import cucumber.api.junit.Cucumber;

@RunWith(Cucumber.class)
public class DeleteProject {

}
10 changes: 10 additions & 0 deletions src/test/java/ro/sapientia/mesteri2015/delete/DeleteStory.java
Original file line number Diff line number Diff line change
@@ -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 {
//
//}
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
package ro.sapientia.mesteri2015.delete.defintion;

import static org.junit.Assert.assertEquals;

import java.util.List;
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;
import junit.framework.Assert;

public class MissingProjectDeleteDefinition {

protected WebDriver driver;

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

@Given("^we check the projects$")
public void we_check_the_projects() throws Throwable {
driver.manage().timeouts().implicitlyWait(5, TimeUnit.SECONDS);
driver.get("http://localhost:8080/projects/");
}

@When("^we delete the project with id \"([^\"]*)\"$")
public void we_search_for_project_with_id(final String elementName) throws Throwable {
driver.manage().timeouts().implicitlyWait(5, TimeUnit.SECONDS);
driver.get("http://localhost:8080/project/delete/" + elementName);

}

@Then("^we get a not found error$")
public void we_get_a_not_found_error() throws Throwable {
driver.manage().timeouts().implicitlyWait(5, TimeUnit.SECONDS);
WebElement element = driver.findElement(By.xpath("//h1"));
assertEquals("404", element.getText());
}

@After
public void closeBrowser() {
driver.close();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
package ro.sapientia.mesteri2015.delete.defintion;

import static org.junit.Assert.assertEquals;

import java.util.List;
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;
import junit.framework.Assert;

public class ProjectDeleteDefinition {

protected WebDriver driver;

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

@Given("^we add a new project named \"([^\"]*)\"$")
public void we_add_a_new_project_named(final String elementName) throws Throwable {
driver.manage().timeouts().implicitlyWait(5, TimeUnit.SECONDS);
driver.get("http://localhost:8080/projects/");
WebElement addButton = driver.findElement(By.id("add-button"));
addButton.click();
WebElement titleTextBox = driver.findElement(By.id("project-name"));
titleTextBox.clear();
titleTextBox.sendKeys(elementName);

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

@When("^we delete the project$")
public void we_delete_the_project() throws Throwable {
WebElement deleteLink = driver.findElement(By.id("delete-project-link"));
deleteLink.click();
WebElement deleteButton = driver.findElement(By.id("delete-project-button"));
deleteButton.click();
}

@Then("^check if \"([^\"]*)\" has been deleted$")
public void check_if_has_been_deleted(final String elementName) throws Throwable {
List<WebElement> projectContainer = driver.findElements(By.id("project-name-owner"));
for (WebElement webEl: projectContainer) {
if (webEl.getText().contains(elementName)) {
Assert.fail("Project still in existing projects list");
}
}
}

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