Skip to content

Instantly share code, notes, and snippets.

<dependencies>
<dependency>
<groupid>junit</groupid>
<artifactid>junit</artifactid>
<version>4.11</version>
</dependency>
<dependency>
<groupid>info.cukes</groupid>
<artifactid>cucumber-java</artifactid>
<version>1.0.0</version>
Feature: Simple chat engagement
Scenario: Agent log-ins into the system
Given Site url "*****"
When Agent name "*****"
And Agent password "*****"
And Site Id "******"
And Wait "100"
Then Agent entries to the system
Scenario: Agent set herself online
public class AgentStepsDefinitions {
private static Agent agent = null;
private static Visitor visitor = null;
private static Boolean bDone = false;
//Class initilizing before the test, test = cucumber scenario
@Before
public void initialize(){
if(agent==null)
@leugenel
leugenel / 0_reuse_code.js
Last active August 29, 2015 14:11
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@RunWith(Cucumber.class)
@Cucumber.Options(format={"pretty", "html:target/cucumber"} , features = "end2end.feature")
public class Agent {
public WebDriver driver = null;
public Agent(){
driver = new FirefoxDriver();
}
//Insert fields on the log-in page
public class Visitor {
public WebDriver driver =null;
public Visitor(){
driver = new FirefoxDriver();
}
public boolean isChatEngagement() throws InterruptedException {
if(IsEngagement()==false){
//Second try
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>3.2.0.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
<version>3.2.0.RELEASE</version>
</dependency>
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans .xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd">
<context:annotation-config />
<context:component-scan base-package="bdd.liveperson.bdd"/>
Feature: Simple chat engagement
Scenario: Agent log-ins into the system
When Agent name "*******"
And Agent password "*******"
And Site Id "*******"
And Wait "100"
Then Agent entries to the system
Scenario: Agent set herself online
Given Agent inside the system
public class Agent {
@Autowired
private WebDriver adriver;
public WebDriver getAdriver() {
return adriver;
}
@Autowired
private URI asiteBase;