Skip to content

Commit

Permalink
init configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
Dario Vallejos committed Oct 4, 2018
0 parents commit 5443168
Show file tree
Hide file tree
Showing 18 changed files with 394 additions and 0 deletions.
66 changes: 66 additions & 0 deletions .gitignore
@@ -0,0 +1,66 @@
*.class

# Log file
*.log

# BlueJ files
*.ctxt

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

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

# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*
### JetBrains template
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839

# User-specific stuff:
.idea/
*.iml

# Sensitive or high-churn files:
.idea/**/dataSources/
.idea/**/dataSources.ids
.idea/**/dataSources.xml
.idea/**/dataSources.local.xml
.idea/**/sqlDataSources.xml
.idea/**/dynamic.xml
.idea/**/uiDesigner.xml

# Gradle:
.idea/**/gradle.xml
.idea/**/libraries

# CMake
cmake-build-debug/

# Mongo Explorer plugin:
.idea/**/mongoSettings.xml

## File-based project format:
*.iws

## Plugin-specific files:

# IntelliJ
out/

# mpeltonen/sbt-idea plugin
.idea_modules/

# JIRA plugin
atlassian-ide-plugin.xml

# Cursive Clojure plugin
.idea/replstate.xml

target/
5 changes: 5 additions & 0 deletions README.md
@@ -0,0 +1,5 @@





42 changes: 42 additions & 0 deletions extent-config.xml
@@ -0,0 +1,42 @@
<?xml version="1.0" encoding="UTF-8"?>
<extentreports>
<configuration>
<!-- report theme -->
<!-- standard, dark -->
<theme>dark</theme>

<!-- document encoding -->
<!-- defaults to UTF-8 -->
<encoding>UTF-8</encoding>

<!-- protocol for script and stylesheets -->
<!-- defaults to https -->
<protocol>https</protocol>

<!-- title of the document -->
<documentTitle>Extent</documentTitle>

<!-- report name - displayed at top-nav -->
<reportName>Automation Report</reportName>

<!-- location of charts in the test view -->
<!-- top, bottom -->
<testViewChartLocation>bottom</testViewChartLocation>

<!-- custom javascript -->
<scripts>
<![CDATA[
$(document).ready(function() {
});
]]>
</scripts>

<!-- custom styles -->
<styles>
<![CDATA[
]]>
</styles>
</configuration>
</extentreports>
75 changes: 75 additions & 0 deletions pom.xml
@@ -0,0 +1,75 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.crowdar</groupId>
<artifactId>Crowd-Root-Framework</artifactId>
<version>1.0.1</version>
</parent>

<artifactId>Example-Cucumber-Crowdar</artifactId>
<url>http://maven.apache.org</url>
<packaging>jar</packaging>
<name>Example-Cucumber-Crowdar</name>
<version>1.0.0</version>

<properties>
<crowd.project.name>Example-Cucumber-Crowdar</crowd.project.name>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<crowdar.cucumber.filter>@Smoke</crowdar.cucumber.filter>
</properties>
<profiles>
<profile>
<id>Local</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<properties>
<crowdar.cucumber.browser>CHROMEDYNAMIC</crowdar.cucumber.browser>
<crowdar.cucumber.option>src/test/resources/features --glue com/crowdar/examples --glue com/crowdar/bdd/cukes --tags ${crowdar.cucumber.filter} --tags ~@Ignore --plugin com.crowdar.report.CucumberExtentReport</crowdar.cucumber.option>
<crowdar.json.path>src/test/resources/json/</crowdar.json.path>
<crowdar.gridhub></crowdar.gridhub>
<crowdar.extent.report.path>cucumber-reports</crowdar.extent.report.path>
<crowdar.extent.report.name>CucumberExampleReport</crowdar.extent.report.name>
<crowdar.extent.host.name>LocalMachine</crowdar.extent.host.name>
<crowdar.extent.environment>Local</crowdar.extent.environment>
<crowdar.extent.user.name>User.name</crowdar.extent.user.name>
</properties>
</profile>
<profile>
<id>QA</id>
<activation>
</activation>
<properties>
<crowdar.cucumber.browser>CHROMEDYNAMIC</crowdar.cucumber.browser>
<crowdar.extent.report.path>cucumber-reports</crowdar.extent.report.path>
<crowdar.extent.report.name>comafiReport</crowdar.extent.report.name>
<crowdar.extent.host.name>Jenkins</crowdar.extent.host.name>
<crowdar.extent.environment>QA</crowdar.extent.environment>
<crowdar.extent.user.name>User.name</crowdar.extent.user.name>
<crowdar.cucumber.option>src/test/resources/features --glue com/crowdar/core --glue com/crowdar/bdd/cukes --tags ${crowdar.cucumber.filter} --tags ~@Ignore --plugin com.crowdar.report.CucumberExtentReport</crowdar.cucumber.option>
<crowdar.json.path>src/test/resources/json/</crowdar.json.path>
<crowdar.gridhub>http://192.168.0.38:4444/wd/hub</crowdar.gridhub>
</properties>
</profile>
<profile>
<id>Production</id>
<activation>
</activation>
</profile>
</profiles>
<dependencies>
<dependency>
<groupId>com.crowdar</groupId>
<artifactId>Crowd-Core-Framework</artifactId>
<version>1.0.1</version>
</dependency>
</dependencies>
<repositories>
<repository>
<id>crowdarRepo</id>
<name>crowdar-repository-s3</name>
<url>http://nexus-v3-repositories.automation.crowdaronline.com/repository/maven-s3/</url>
</repository>
</repositories>

</project>
7 changes: 7 additions & 0 deletions src/log4j.properties
@@ -0,0 +1,7 @@
### Root Logger
log4j.rootLogger=DEBUG, Console

### Console Appender
log4j.appender.Console=org.apache.log4j.ConsoleAppender
log4j.appender.Console.layout=org.apache.log4j.PatternLayout
log4j.appender.Console.layout.ConversionPattern=%d (%t) %-5p %c: %m%n
23 changes: 23 additions & 0 deletions src/main/java/com/crowdar/examples/pages/Inicio.java
@@ -0,0 +1,23 @@
package com.crowdar.examples.pages;

import com.crowdar.bdd.cukes.SharedDriver;
import org.openqa.selenium.By;
import org.openqa.selenium.WebElement;

public class Inicio extends PageBaseExamples{

public WebElement inicioMenuLink(){return getWebElement(By.xpath("//a[@href='#home']"));}
public WebElement verMasLink(){return getWebElement(By.xpath("//a[@href='#brief']"));}

public Inicio(SharedDriver driver){
super(driver);
this.url = "";
}

public void navegarAlInicio(){
navigateToIt();
sleep(15000);
}


}
15 changes: 15 additions & 0 deletions src/main/java/com/crowdar/examples/pages/PageBaseExamples.java
@@ -0,0 +1,15 @@
package com.crowdar.examples.pages;

import com.crowdar.bdd.cukes.SharedDriver;
import com.crowdar.core.CucumberPageBase;
import com.crowdar.core.PageBase;

public class PageBaseExamples extends CucumberPageBase {

public PageBaseExamples(SharedDriver driver){
super(driver);
BASE_URL = "http://www.crowdar.com.ar";
}


}
36 changes: 36 additions & 0 deletions src/main/java/com/crowdar/examples/steps/InicioSteps.java
@@ -0,0 +1,36 @@
package com.crowdar.examples.steps;

import com.crowdar.bdd.cukes.SharedDriver;
import com.crowdar.core.PageSteps;
import com.crowdar.examples.pages.Inicio;
import cucumber.api.java.en.Given;
import cucumber.api.java.en.Then;
import cucumber.api.java.en.When;
import org.testng.Assert;

public class InicioSteps extends PageSteps {

private Inicio inicio;

public InicioSteps(SharedDriver driver){
super(driver);
inicio = new Inicio(driver);
}

@Given("El cliente esta en la pagina de crowdar")
public void elClienteEstaEnLaPaginaDeCrowdar(){
inicio.navegarAlInicio();
}

@When("El cliente presiona el menu (.*)")
public void elClientePresionaElMenu(String menu){
switch (menu){
case "Inicio" : inicio.inicioMenuLink().click();
}
}

@Then("El cliente observa la informacion relevante sobre crowdar")
public void elClienteObservaLaInformacionRelevanteSobreCrowdar(){
Assert.assertTrue(inicio.verMasLink().isDisplayed(),"Error el Link ver mas no es mostrado en el inicio");
}
}
20 changes: 20 additions & 0 deletions src/main/resources/config.properties
@@ -0,0 +1,20 @@
crowdar.extent.report.document.title = "Example"
crowdar.extent.report.encoding = UTF-8
crowdar.extent.report.protocol = HTTP
crowdar.extent.report.theme = Dark
crowdar.extent.report.timestampformat = mm/dd/yyyy hh:mm:ss a
crowdar.extent.report.path = cucumber-report
crowdar.extent.report.name = example
crowdar.extent.host.name = Machine
crowdar.extent.environment = ${crowdar.extent.host.name}
crowdar.extent.user.name = ${crowdar.extent.user.name}
crowdar.cucumber.browser = ${crowdar.cucumber.browser}
fluent.wait.request.frequency.in.millis= 500
wait.timeout.in.seconds = 20
wait.script.timeout = 55
wait.implicit.timeout = 2
date.format = MM/dd/yyyy
complete.date.pattern = MM/dd/yyyy hh:mm aa

#

1 change: 1 addition & 0 deletions src/main/resources/cucumber.properties
@@ -0,0 +1 @@
cucumber.options = ${crowdar.cucumber.option}
7 changes: 7 additions & 0 deletions src/test/java/CrowdTestNgRunner.java
@@ -0,0 +1,7 @@
import com.crowdar.bdd.cukes.TestNgRunner;
import org.testng.annotations.AfterSuite;

public class CrowdTestNgRunner extends TestNgRunner {


}
43 changes: 43 additions & 0 deletions src/test/java/com/crowdar/examples/testng/StepDefinitions.java
@@ -0,0 +1,43 @@
package com.crowdar.examples.testng;

import com.crowdar.bdd.cukes.SharedDriver;
import com.crowdar.core.PageSteps;
import cucumber.api.java.en.Given;
import cucumber.api.java.en.Then;
import cucumber.api.java.en.When;
import org.junit.Assert;


public class StepDefinitions extends PageSteps {

public StepDefinitions(SharedDriver driver) {
super(driver);
}

@Given("^I am on the \"([^\"]*)\" page on URL \"([^\"]*)\"$")
public void i_am_on_the_page_on_URL(String arg1, String arg2) throws Throwable {
getDriver().get("http://www.google.com");
Thread.sleep(10000l);
}

@When("^I fill in \"([^\"]*)\" with \"([^\"]*)\"$")
public void i_fill_in_with(String arg1, String arg2) throws Throwable {
System.out.println("step2---------------------");
}

@When("^I click on the \"([^\"]*)\" button$")
public void i_click_on_the_button(String arg1) throws Throwable {
System.out.println("step3---------------------");
}

@Then("^I should see \"([^\"]*)\" message$")
public void i_should_see_message(String arg1) throws Throwable {
System.out.println("step4---------------------");
}

@Then("^I should see the \"([^\"]*)\" button$")
public void i_should_see_the_button(String arg1) throws Throwable {
System.out.println("step5---------------------");
Assert.fail();
}
}
34 changes: 34 additions & 0 deletions src/test/java/com/crowdar/integration/tests/ZapiTests.java
@@ -0,0 +1,34 @@
package com.crowdar.integration.tests;

import java.net.URISyntaxException;
import java.util.HashMap;
import java.util.Map;

import com.crowdar.zapi.collaborator.ZapiBuilder;
import com.crowdar.zapi.jenkins.reporter.ZfjReporter;
import com.crowdar.zapi.model.ZapiTestCase;
import org.json.JSONException;
import org.testng.annotations.Test;

import com.fasterxml.jackson.core.JsonProcessingException;

public class ZapiTests {

@Test
public void testPerformReport() throws JSONException, URISyntaxException, JsonProcessingException {

ZfjReporter reporter = ZapiBuilder.buildZapiReporterWithNewCycleForEachBuild();
Map<ZapiTestCase,Boolean> scenarios = new HashMap<ZapiTestCase, Boolean>();


scenarios.put(new ZapiTestCase("Test 1 ------------"),true);
scenarios.put(new ZapiTestCase("Test 2 ------------"),true);
scenarios.put(new ZapiTestCase("Test 3 ------------"),true);
scenarios.put(new ZapiTestCase("Test 4 ------------"),true);
scenarios.put(new ZapiTestCase("Test 5 ------------"),false);
reporter.perform(1,scenarios);



}
}
Empty file.

0 comments on commit 5443168

Please sign in to comment.