Skip to content
This repository has been archived by the owner on Sep 28, 2021. It is now read-only.

Commit

Permalink
se agrega pruebas con klov
Browse files Browse the repository at this point in the history
  • Loading branch information
marti1125 committed Sep 3, 2018
1 parent a64cb45 commit 1018dd1
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 5 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,5 @@
hs_err_pid*

*.iml
.idea
.idea
target
12 changes: 12 additions & 0 deletions browsertest/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,18 @@
<artifactId>selenium-java</artifactId>
<version>3.14.0</version>
</dependency>

<dependency>
<groupId>com.aventstack</groupId>
<artifactId>extentreports</artifactId>
<version>3.1.5</version>
</dependency>

<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<version>6.14.3</version>
</dependency>
</dependencies>

<build>
Expand Down
2 changes: 1 addition & 1 deletion browsertest/src/test/java/com/web/RunCucumberTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@
import org.junit.runner.RunWith;

@RunWith(Cucumber.class)
@CucumberOptions(plugin = {"pretty"})
@CucumberOptions(plugin = {"pretty"}, glue = {"com.web"})
public class RunCucumberTest {
}
18 changes: 18 additions & 0 deletions browsertest/src/test/java/com/web/Stepdefs.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package com.web;

import com.aventstack.extentreports.ExtentReports;
import com.aventstack.extentreports.reporter.KlovReporter;
import cucumber.api.java.After;
import cucumber.api.java.Before;
import cucumber.api.java.en.Given;
Expand All @@ -15,11 +17,26 @@
public class Stepdefs {

private WebDriver driver;
public static ExtentReports extentReports;

@Before
public void initWebDriver() {
System.setProperty("webdriver.gecko.driver", "/Users/willyaguirre/Documents/opensource/geckodriver");
driver = new FirefoxDriver();

KlovReporter klovReporter = new KlovReporter();

klovReporter.initMongoDbConnection("localhost", 27017);

klovReporter.setProjectName("SWTESTACADEMY");

klovReporter.setReportName("1.4");

klovReporter.setKlovUrl("http://localhost:9000");

extentReports = new ExtentReports();
extentReports.attachReporter(klovReporter);

}

@Given("^I am on the Google search page$")
Expand Down Expand Up @@ -51,6 +68,7 @@ public Boolean apply(WebDriver d) {
@After()
public void closeBrowser() {
driver.quit();
extentReports.flush();
}

}
6 changes: 3 additions & 3 deletions pruebas/src/test/java/com/pruebas/Stepdefs.java
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package com.pruebas;

import cucumber.api.PendingException;
import cucumber.api.java.en.Given;
import cucumber.api.java.en.When;
import cucumber.api.java.en.Then;
import static org.junit.Assert.*;
import cucumber.api.java.en.When;

import static org.junit.Assert.assertEquals;

class IsItFriday {
static String isItFriday(String today) {
Expand Down

0 comments on commit 1018dd1

Please sign in to comment.