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
174 changes: 174 additions & 0 deletions Project_List.jmx
Original file line number Diff line number Diff line change
@@ -0,0 +1,174 @@
<?xml version="1.0" encoding="UTF-8"?>
<jmeterTestPlan version="1.2" properties="2.8" jmeter="2.13.20180731">
<hashTree>
<TestPlan guiclass="TestPlanGui" testclass="TestPlan" testname="Project_Test_Plan" enabled="true">
<stringProp name="TestPlan.comments"></stringProp>
<boolProp name="TestPlan.functional_mode">false</boolProp>
<boolProp name="TestPlan.serialize_threadgroups">false</boolProp>
<elementProp name="TestPlan.user_defined_variables" elementType="Arguments" guiclass="ArgumentsPanel" testclass="Arguments" testname="User Defined Variables" enabled="true">
<collectionProp name="Arguments.arguments"/>
</elementProp>
<stringProp name="TestPlan.user_define_classpath"></stringProp>
</TestPlan>
<hashTree>
<ThreadGroup guiclass="ThreadGroupGui" testclass="ThreadGroup" testname="Project_List" enabled="true">
<stringProp name="ThreadGroup.on_sample_error">continue</stringProp>
<elementProp name="ThreadGroup.main_controller" elementType="LoopController" guiclass="LoopControlPanel" testclass="LoopController" testname="Loop Controller" enabled="true">
<boolProp name="LoopController.continue_forever">false</boolProp>
<stringProp name="LoopController.loops">1</stringProp>
</elementProp>
<stringProp name="ThreadGroup.num_threads">10</stringProp>
<stringProp name="ThreadGroup.ramp_time">1</stringProp>
<longProp name="ThreadGroup.start_time">1610499543000</longProp>
<longProp name="ThreadGroup.end_time">1610499543000</longProp>
<boolProp name="ThreadGroup.scheduler">false</boolProp>
<stringProp name="ThreadGroup.duration"></stringProp>
<stringProp name="ThreadGroup.delay"></stringProp>
</ThreadGroup>
<hashTree/>
<HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true">
<collectionProp name="HeaderManager.headers">
<elementProp name="" elementType="Header">
<stringProp name="Header.name">User-Agent</stringProp>
<stringProp name="Header.value">Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:85.0) Gecko/20100101 Firefox/85.0</stringProp>
</elementProp>
</collectionProp>
</HeaderManager>
<hashTree/>
<CookieManager guiclass="CookiePanel" testclass="CookieManager" testname="HTTP Cookie Manager" enabled="true">
<collectionProp name="CookieManager.cookies">
<elementProp name="JSESSIONID" elementType="Cookie" testname="JSESSIONID">
<stringProp name="Cookie.value">836514399E15F17D2076887C1A1072A5</stringProp>
<stringProp name="Cookie.domain">localhost:8080</stringProp>
<stringProp name="Cookie.path">/project/add</stringProp>
<boolProp name="Cookie.secure">true</boolProp>
<longProp name="Cookie.expires">0</longProp>
<boolProp name="Cookie.path_specified">true</boolProp>
<boolProp name="Cookie.domain_specified">true</boolProp>
</elementProp>
</collectionProp>
<boolProp name="CookieManager.clearEachIteration">false</boolProp>
</CookieManager>
<hashTree/>
<SizeAssertion guiclass="SizeAssertionGui" testclass="SizeAssertion" testname="Size Assertion" enabled="true">
<stringProp name="Assertion.test_field">SizeAssertion.response_network_size</stringProp>
<stringProp name="SizeAssertion.size">10</stringProp>
<intProp name="SizeAssertion.operator">3</intProp>
</SizeAssertion>
<hashTree/>
<ResultCollector guiclass="AssertionVisualizer" testclass="ResultCollector" testname="Assertion Results" enabled="true">
<boolProp name="ResultCollector.error_logging">false</boolProp>
<objProp>
<name>saveConfig</name>
<value class="SampleSaveConfiguration">
<time>true</time>
<latency>true</latency>
<timestamp>true</timestamp>
<success>true</success>
<label>true</label>
<code>true</code>
<message>true</message>
<threadName>true</threadName>
<dataType>true</dataType>
<encoding>false</encoding>
<assertions>true</assertions>
<subresults>true</subresults>
<responseData>false</responseData>
<samplerData>false</samplerData>
<xml>false</xml>
<fieldNames>false</fieldNames>
<responseHeaders>false</responseHeaders>
<requestHeaders>false</requestHeaders>
<responseDataOnError>false</responseDataOnError>
<saveAssertionResultsFailureMessage>false</saveAssertionResultsFailureMessage>
<assertionsResultsToSave>0</assertionsResultsToSave>
<bytes>true</bytes>
<threadCounts>true</threadCounts>
</value>
</objProp>
<stringProp name="filename"></stringProp>
</ResultCollector>
<hashTree/>
<ResultCollector guiclass="StatGraphVisualizer" testclass="ResultCollector" testname="Aggregate Graph" enabled="true">
<boolProp name="ResultCollector.error_logging">false</boolProp>
<objProp>
<name>saveConfig</name>
<value class="SampleSaveConfiguration">
<time>true</time>
<latency>true</latency>
<timestamp>true</timestamp>
<success>true</success>
<label>true</label>
<code>true</code>
<message>true</message>
<threadName>true</threadName>
<dataType>true</dataType>
<encoding>false</encoding>
<assertions>true</assertions>
<subresults>true</subresults>
<responseData>false</responseData>
<samplerData>false</samplerData>
<xml>false</xml>
<fieldNames>false</fieldNames>
<responseHeaders>false</responseHeaders>
<requestHeaders>false</requestHeaders>
<responseDataOnError>false</responseDataOnError>
<saveAssertionResultsFailureMessage>false</saveAssertionResultsFailureMessage>
<assertionsResultsToSave>0</assertionsResultsToSave>
<bytes>true</bytes>
<threadCounts>true</threadCounts>
</value>
</objProp>
<stringProp name="filename"></stringProp>
</ResultCollector>
<hashTree/>
<ResultCollector guiclass="GraphVisualizer" testclass="ResultCollector" testname="Graph Results" enabled="true">
<boolProp name="ResultCollector.error_logging">false</boolProp>
<objProp>
<name>saveConfig</name>
<value class="SampleSaveConfiguration">
<time>true</time>
<latency>true</latency>
<timestamp>true</timestamp>
<success>true</success>
<label>true</label>
<code>true</code>
<message>true</message>
<threadName>true</threadName>
<dataType>true</dataType>
<encoding>false</encoding>
<assertions>true</assertions>
<subresults>true</subresults>
<responseData>false</responseData>
<samplerData>false</samplerData>
<xml>false</xml>
<fieldNames>false</fieldNames>
<responseHeaders>false</responseHeaders>
<requestHeaders>false</requestHeaders>
<responseDataOnError>false</responseDataOnError>
<saveAssertionResultsFailureMessage>false</saveAssertionResultsFailureMessage>
<assertionsResultsToSave>0</assertionsResultsToSave>
<bytes>true</bytes>
<threadCounts>true</threadCounts>
</value>
</objProp>
<stringProp name="filename"></stringProp>
</ResultCollector>
<hashTree/>
<ConfigTestElement guiclass="HttpDefaultsGui" testclass="ConfigTestElement" testname="HTTP Request Defaults" enabled="true">
<elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" testname="User Defined Variables" enabled="true">
<collectionProp name="Arguments.arguments"/>
</elementProp>
<stringProp name="HTTPSampler.domain"></stringProp>
<stringProp name="HTTPSampler.port"></stringProp>
<stringProp name="HTTPSampler.connect_timeout"></stringProp>
<stringProp name="HTTPSampler.response_timeout"></stringProp>
<stringProp name="HTTPSampler.protocol"></stringProp>
<stringProp name="HTTPSampler.contentEncoding"></stringProp>
<stringProp name="HTTPSampler.path">/project/add</stringProp>
<stringProp name="HTTPSampler.concurrentPool">4</stringProp>
</ConfigTestElement>
<hashTree/>
</hashTree>
</hashTree>
</jmeterTestPlan>
17 changes: 8 additions & 9 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,28 +4,27 @@
<artifactId>cucumberScumSapientia</artifactId>
<version>0.0.1-SNAPSHOT</version>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.11</version>
<scope>test</scope>
</dependency>
<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>
<artifactId>cucumber-java</artifactId>
<version>1.1.2</version>
<version>1.2.5</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>info.cukes</groupId>
<artifactId>cucumber-junit</artifactId>
<version>1.1.2</version>
<version>1.2.5</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-firefox-driver</artifactId>
<version>3.141.59</version>
</dependency>
</dependencies>
</project>
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,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();
}
}
Original file line number Diff line number Diff line change
@@ -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

Original file line number Diff line number Diff line change
@@ -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();
}

}
Original file line number Diff line number Diff line change
@@ -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



Loading