Skip to content

Commit 9650564

Browse files
rathr1rathr1
rathr1
authored and
rathr1
committed
Uploaded the Project
1 parent 736dd20 commit 9650564

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+1686
-0
lines changed

.classpath

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<classpath>
3+
<classpathentry kind="src" output="target/classes" path="src/main/java">
4+
<attributes>
5+
<attribute name="optional" value="true"/>
6+
<attribute name="maven.pomderived" value="true"/>
7+
</attributes>
8+
</classpathentry>
9+
<classpathentry kind="src" output="target/test-classes" path="src/test/java">
10+
<attributes>
11+
<attribute name="optional" value="true"/>
12+
<attribute name="maven.pomderived" value="true"/>
13+
</attributes>
14+
</classpathentry>
15+
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER">
16+
<attributes>
17+
<attribute name="maven.pomderived" value="true"/>
18+
</attributes>
19+
</classpathentry>
20+
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
21+
<attributes>
22+
<attribute name="maven.pomderived" value="true"/>
23+
</attributes>
24+
</classpathentry>
25+
<classpathentry kind="output" path="target/classes"/>
26+
</classpath>

.project

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<projectDescription>
3+
<name>cucumber</name>
4+
<comment></comment>
5+
<projects>
6+
</projects>
7+
<buildSpec>
8+
<buildCommand>
9+
<name>org.eclipse.jdt.core.javabuilder</name>
10+
<arguments>
11+
</arguments>
12+
</buildCommand>
13+
<buildCommand>
14+
<name>org.eclipse.m2e.core.maven2Builder</name>
15+
<arguments>
16+
</arguments>
17+
</buildCommand>
18+
</buildSpec>
19+
<natures>
20+
<nature>org.eclipse.jdt.core.javanature</nature>
21+
<nature>org.eclipse.m2e.core.maven2Nature</nature>
22+
</natures>
23+
</projectDescription>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
eclipse.preferences.version=1
2+
encoding//src/main/java=UTF-8
3+
encoding//src/test/java=UTF-8
4+
encoding/<project>=UTF-8

.settings/org.eclipse.jdt.core.prefs

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
eclipse.preferences.version=1
2+
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
3+
org.eclipse.jdt.core.compiler.compliance=1.5
4+
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
5+
org.eclipse.jdt.core.compiler.source=1.5

.settings/org.eclipse.m2e.core.prefs

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
activeProfiles=
2+
eclipse.preferences.version=1
3+
resolveWorkspaceProjects=true
4+
version=1

pom.xml

+81
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
2+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
3+
<modelVersion>4.0.0</modelVersion>
4+
5+
<groupId>cucumber</groupId>
6+
<artifactId>cucumber</artifactId>
7+
<version>0.0.1-SNAPSHOT</version>
8+
<packaging>jar</packaging>
9+
10+
<name>cucumber</name>
11+
<url>http://maven.apache.org</url>
12+
13+
<properties>
14+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
15+
</properties>
16+
17+
<dependencies>
18+
<dependency>
19+
<groupId>junit</groupId>
20+
<artifactId>junit</artifactId>
21+
<version>4.12</version>
22+
<scope>test</scope>
23+
</dependency>
24+
<dependency>
25+
<groupId>info.cukes</groupId>
26+
<artifactId>cucumber-junit</artifactId>
27+
<version>1.2.5</version>
28+
</dependency>
29+
<dependency>
30+
<groupId>info.cukes</groupId>
31+
<artifactId>cucumber-java</artifactId>
32+
<version>1.2.5</version>
33+
</dependency>
34+
<dependency>
35+
<groupId>info.cukes</groupId>
36+
<artifactId>cucumber-core</artifactId>
37+
<version>1.2.5</version>
38+
</dependency>
39+
40+
<dependency>
41+
<groupId>info.cukes</groupId>
42+
<artifactId>gherkin</artifactId>
43+
<version>2.12.2</version>
44+
<scope>provided</scope>
45+
</dependency>
46+
<dependency>
47+
<groupId>info.cukes</groupId>
48+
<artifactId>cucumber-jvm</artifactId>
49+
<version>1.2.5</version>
50+
<type>pom</type>
51+
</dependency>
52+
<dependency>
53+
<groupId>info.cukes</groupId>
54+
<artifactId>cucumber-jvm-deps</artifactId>
55+
<version>1.0.5</version>
56+
<scope>provided</scope>
57+
</dependency>
58+
<dependency>
59+
<groupId>info.cukes</groupId>
60+
<artifactId>cucumber-picocontainer</artifactId>
61+
<version>1.2.5</version>
62+
<scope>test</scope>
63+
</dependency>
64+
<dependency>
65+
<groupId>org.testng</groupId>
66+
<artifactId>testng</artifactId>
67+
<version>6.13</version>
68+
<scope>test</scope>
69+
</dependency>
70+
<dependency>
71+
<groupId>info.cukes</groupId>
72+
<artifactId>cucumber-testng</artifactId>
73+
<version>1.2.5</version>
74+
</dependency>
75+
<dependency>
76+
<groupId>com.beust</groupId>
77+
<artifactId>jcommander</artifactId>
78+
<version>1.72</version>
79+
</dependency>
80+
</dependencies>
81+
</project>
+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
package com.api.cucumber;
2+
3+
/**
4+
* Hello world!
5+
*
6+
*/
7+
public class App
8+
{
9+
public static void main( String[] args )
10+
{
11+
System.out.println( "Hello World!" );
12+
}
13+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
package com.api.cucumber;
2+
3+
public class BaseClass {
4+
5+
private String featureName;
6+
public String getFeatureName() {
7+
return featureName;
8+
}
9+
public String getScenarioName() {
10+
return scenarioName;
11+
}
12+
private String scenarioName;
13+
14+
public BaseClass() {
15+
featureName = "BDD";
16+
scenarioName = "DI";
17+
}
18+
19+
20+
21+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
Feature: User Login Feature
2+
3+
Scenario: User Login scenario
4+
Given User is at the login page of the application
5+
When User login with the following username and password
6+
| UserNameOne | PasswordOne |
7+
| UserNameTwo | PasswordTwo |
8+
| UserNameThree | PasswordThree |
9+
| UserNameFour | PasswordFour |
10+
Then User should be able to login with correct username and password
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
Feature: Post feature of facebook
2+
This will test the post functionality at the user wall
3+
4+
Background: Common step
5+
Given User should be logged in
6+
And should be present at its own wall
7+
8+
Scenario: Post a text on user wall
9+
When I type the text as "This is a sample post" in the test box
10+
And Click on Post button
11+
Then The message should get posted
12+
13+
Scenario: Post a video on user wall
14+
When User supply the Youtube link as "http://www.google.com" in the text box
15+
And Click on Post button
16+
Then Video should get posted on the user wall
17+
And The video should have proper Thumnail
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
package com.api.cucumber.hooks;
2+
3+
import cucumber.api.Scenario;
4+
import cucumber.api.java.After;
5+
import cucumber.api.java.Before;
6+
7+
public class GeneralHooks {
8+
9+
//1.Create the public method
10+
//2. Use the @Before & @After annotations with the methods
11+
//3. Specify the package in the runner
12+
//4. Inject the Scenario Object in the hook method
13+
14+
@Before
15+
public void Setup(Scenario name) {
16+
17+
System.out.println("========Before Hook===========");
18+
System.out.println("Name : " + name.getName());
19+
System.out.println("Status : " + name.getStatus());
20+
}
21+
22+
@After
23+
public void tearDown(Scenario name){
24+
System.out.println("========After Hook===========");
25+
System.out.println("Name : " + name.getName());
26+
System.out.println("Status : " + name.getStatus());
27+
}
28+
29+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
package com.api.cucumber.runner;
2+
3+
import org.junit.runner.RunWith;
4+
5+
import cucumber.api.CucumberOptions;
6+
import cucumber.api.junit.Cucumber;
7+
8+
@RunWith(Cucumber.class)
9+
@CucumberOptions(
10+
features={"src/main/java/com/api/cucumber/featurefile/PostFeature.feature"},
11+
glue = {"com.api.cucumber.stepdfn","com.api.cucumber.hooks"},
12+
monochrome = true
13+
)
14+
public class PostRunner {
15+
16+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
package com.api.cucumber.runner;
2+
3+
import cucumber.api.CucumberOptions;
4+
import cucumber.api.testng.AbstractTestNGCucumberTests;
5+
6+
7+
@CucumberOptions(
8+
features = {"src/main/java/com/api/cucumber/featurefile/Login.feature",
9+
"src/main/java/com/api/cucumber/featurefile/PostFeature.feature"},
10+
glue = {"com.api.cucumber.stepdfn"},
11+
monochrome = true
12+
)
13+
14+
public class PostTestNgRunner extends AbstractTestNGCucumberTests {
15+
16+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
package com.api.cucumber.runner;
2+
3+
import org.junit.runner.RunWith;
4+
5+
import cucumber.api.CucumberOptions;
6+
import cucumber.api.junit.Cucumber;
7+
8+
@RunWith(Cucumber.class)
9+
@CucumberOptions(
10+
features={"src/main/java/com/api/cucumber/featurefile/Login.feature"},
11+
glue = {"com.api.cucumber.stepdfn"},
12+
dryRun = false,
13+
monochrome = true
14+
)
15+
public class UserLogin {
16+
17+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
package com.api.cucumber.stepdfn;
2+
3+
import java.util.List;
4+
import java.util.Map;
5+
6+
import cucumber.api.DataTable;
7+
import cucumber.api.PendingException;
8+
import cucumber.api.java.en.Given;
9+
import cucumber.api.java.en.Then;
10+
import cucumber.api.java.en.When;
11+
12+
public class LoginStepDfn {
13+
@Given("^User is at the login page of the application$")
14+
public void user_is_at_the_login_page_of_the_application() throws Throwable {
15+
}
16+
17+
@When("^User login with the following username and password$")
18+
public void user_login_with_the_following_username_and_password(DataTable table) throws Throwable {
19+
/* List<List<String>> data= table.raw();
20+
for(List<String> str : data){
21+
for(String str1 : str){
22+
System.out.println("Data : " + str1);
23+
}
24+
}*/
25+
26+
Map<String, String> data = table.asMap(String.class, String.class);
27+
for (String key : data.keySet()) {
28+
System.out.println(String.format("Keys : %s , Value : %s", key,data.get(key)));
29+
}
30+
}
31+
32+
@Then("^User should be able to login with correct username and password$")
33+
public void user_should_be_able_to_login_with_correct_username_and_password() throws Throwable {
34+
}
35+
36+
}

0 commit comments

Comments
 (0)