Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 49ba575cfd |
File diff suppressed because one or more lines are too long
3
Jenkinsfile
vendored
3
Jenkinsfile
vendored
@ -2,11 +2,12 @@ pipeline {
|
|||||||
agent {
|
agent {
|
||||||
label "agent_locke"
|
label "agent_locke"
|
||||||
}
|
}
|
||||||
|
|
||||||
stages {
|
stages {
|
||||||
stage('Build') {
|
stage('Build') {
|
||||||
steps {
|
steps {
|
||||||
// This runs the Maven test phase
|
// This runs the Maven test phase
|
||||||
sh 'mvn test -P Regression'
|
sh 'mvn test'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
72
pom.xml
72
pom.xml
@ -14,61 +14,7 @@
|
|||||||
<maven.compiler.target>8</maven.compiler.target>
|
<maven.compiler.target>8</maven.compiler.target>
|
||||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
</properties>
|
</properties>
|
||||||
<profiles>
|
|
||||||
<profile>
|
|
||||||
<id>Regression</id>
|
|
||||||
<build>
|
|
||||||
<pluginManagement>
|
|
||||||
<plugins>
|
|
||||||
<plugin>
|
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
|
||||||
<artifactId>maven-surefire-plugin</artifactId>
|
|
||||||
<version>3.5.0</version>
|
|
||||||
<configuration>
|
|
||||||
<suiteXmlFiles>
|
|
||||||
<suiteXmlFile>testng.xml</suiteXmlFile>
|
|
||||||
</suiteXmlFiles>
|
|
||||||
</configuration>
|
|
||||||
</plugin>
|
|
||||||
</plugins>
|
|
||||||
</pluginManagement>
|
|
||||||
</build>
|
|
||||||
</profile>
|
|
||||||
<profile>
|
|
||||||
<id>Smoke</id>
|
|
||||||
<build>
|
|
||||||
<pluginManagement>
|
|
||||||
<plugins>
|
|
||||||
<plugin>
|
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
|
||||||
<artifactId>maven-surefire-plugin</artifactId>
|
|
||||||
<version>3.5.0</version>
|
|
||||||
<configuration>
|
|
||||||
<suiteXmlFiles>
|
|
||||||
<suiteXmlFile>testCucumber.xml</suiteXmlFile>
|
|
||||||
</suiteXmlFiles>
|
|
||||||
</configuration>
|
|
||||||
</plugin>
|
|
||||||
</plugins>
|
|
||||||
</pluginManagement>
|
|
||||||
</build>
|
|
||||||
</profile>
|
|
||||||
</profiles>
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<!-- https://mvnrepository.com/artifact/com.fasterxml.jackson.core/jackson-databind -->
|
|
||||||
<dependency>
|
|
||||||
<groupId>com.fasterxml.jackson.core</groupId>
|
|
||||||
<artifactId>jackson-databind</artifactId>
|
|
||||||
<version>2.18.0</version>
|
|
||||||
</dependency>
|
|
||||||
<!-- https://mvnrepository.com/artifact/io.github.bonigarcia/webdrivermanager -->
|
|
||||||
<dependency>
|
|
||||||
<groupId>io.github.bonigarcia</groupId>
|
|
||||||
<artifactId>webdrivermanager</artifactId>
|
|
||||||
<version>5.9.2</version>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.aventstack</groupId>
|
<groupId>com.aventstack</groupId>
|
||||||
<artifactId>extentreports</artifactId>
|
<artifactId>extentreports</artifactId>
|
||||||
@ -117,22 +63,6 @@
|
|||||||
<artifactId>log4j-core</artifactId>
|
<artifactId>log4j-core</artifactId>
|
||||||
<version>2.24.0</version>
|
<version>2.24.0</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<!-- https://mvnrepository.com/artifact/io.cucumber/cucumber-java -->
|
|
||||||
<dependency>
|
|
||||||
<groupId>io.cucumber</groupId>
|
|
||||||
<artifactId>cucumber-java</artifactId>
|
|
||||||
<version>7.19.0</version>
|
|
||||||
</dependency>
|
|
||||||
<!-- https://mvnrepository.com/artifact/io.cucumber/cucumber-testng -->
|
|
||||||
<dependency>
|
|
||||||
<groupId>io.cucumber</groupId>
|
|
||||||
<artifactId>cucumber-testng</artifactId>
|
|
||||||
<version>7.19.0</version>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>io.cucumber</groupId>
|
|
||||||
<artifactId>cucumber-java</artifactId>
|
|
||||||
<version>7.14.1</version>
|
|
||||||
</dependency>
|
|
||||||
</dependencies>
|
</dependencies>
|
||||||
</project>
|
</project>
|
||||||
|
|||||||
@ -35,7 +35,7 @@
|
|||||||
<a href="#"><span class="badge badge-primary">Zenful</span></a>
|
<a href="#"><span class="badge badge-primary">Zenful</span></a>
|
||||||
</li>
|
</li>
|
||||||
<li class="m-r-10">
|
<li class="m-r-10">
|
||||||
<a href="#"><span class="badge badge-primary">Oct 26, 2024 01:35:47 AM</span></a>
|
<a href="#"><span class="badge badge-primary">Sep 29, 2024 01:21:35 AM</span></a>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
@ -81,7 +81,7 @@
|
|||||||
<div class="test-detail">
|
<div class="test-detail">
|
||||||
<p class="name">Test msg</p>
|
<p class="name">Test msg</p>
|
||||||
<p class="text-sm">
|
<p class="text-sm">
|
||||||
<span>1:35:55 AM</span> / <span>00:00:00:000</span>
|
<span>1:21:37 AM</span> / <span>00:00:00:000</span>
|
||||||
<span class="badge pass-bg log float-right">Pass</span>
|
<span class="badge pass-bg log float-right">Pass</span>
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
@ -90,8 +90,8 @@
|
|||||||
<div class="p-v-10">
|
<div class="p-v-10">
|
||||||
<div class="info">
|
<div class="info">
|
||||||
<h5 class="test-status text-pass">Test msg</h5>
|
<h5 class="test-status text-pass">Test msg</h5>
|
||||||
<span class='badge badge-success'>10.26.2024 1:35:55 AM</span>
|
<span class='badge badge-success'>09.29.2024 1:21:37 AM</span>
|
||||||
<span class='badge badge-danger'>10.26.2024 1:35:55 AM</span>
|
<span class='badge badge-danger'>09.29.2024 1:21:37 AM</span>
|
||||||
<span class='badge badge-default'>00:00:00:000</span>
|
<span class='badge badge-default'>00:00:00:000</span>
|
||||||
· <span class='uri-anchor badge badge-default'>#test-id=1</span>
|
· <span class='uri-anchor badge badge-default'>#test-id=1</span>
|
||||||
<span title='Skip to the next failed step' class='badge badge-danger pointer float-right ne ml-1'><i class="fa fa-fast-forward"></i></span>
|
<span title='Skip to the next failed step' class='badge badge-danger pointer float-right ne ml-1'><i class="fa fa-fast-forward"></i></span>
|
||||||
@ -115,13 +115,13 @@
|
|||||||
<div class="col-md-3">
|
<div class="col-md-3">
|
||||||
<div class="card"><div class="card-body">
|
<div class="card"><div class="card-body">
|
||||||
<p class="m-b-0">Started</p>
|
<p class="m-b-0">Started</p>
|
||||||
<h3>Oct 26, 2024 01:35:47 AM</h3>
|
<h3>Sep 29, 2024 01:21:35 AM</h3>
|
||||||
</div></div>
|
</div></div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-3">
|
<div class="col-md-3">
|
||||||
<div class="card"><div class="card-body">
|
<div class="card"><div class="card-body">
|
||||||
<p class="m-b-0">Ended</p>
|
<p class="m-b-0">Ended</p>
|
||||||
<h3>Oct 26, 2024 01:35:56 AM</h3>
|
<h3>Sep 29, 2024 01:21:37 AM</h3>
|
||||||
</div></div>
|
</div></div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-3">
|
<div class="col-md-3">
|
||||||
|
|||||||
@ -1,8 +0,0 @@
|
|||||||
Feature: Home page of the application
|
|
||||||
|
|
||||||
@Smoke
|
|
||||||
Scenario: Leave a comment into Zenful.cloud
|
|
||||||
Given Initialize the remote webdriver Firefox
|
|
||||||
And navigate to "https://zenful.cloud"
|
|
||||||
When User type text into the text box and hit click
|
|
||||||
Then Text is displayed "True"
|
|
||||||
@ -1,35 +0,0 @@
|
|||||||
package stepDefinition;
|
|
||||||
|
|
||||||
import io.cucumber.java.en.Given;
|
|
||||||
import io.cucumber.java.en.Then;
|
|
||||||
import io.cucumber.java.en.When;
|
|
||||||
import zacksolutions.base.Initialization;
|
|
||||||
import zacksolutions.pages.HomePage;
|
|
||||||
|
|
||||||
import java.io.IOException;
|
|
||||||
|
|
||||||
public class StepDefinition extends Initialization {
|
|
||||||
|
|
||||||
@Given("Initialize the remote webdriver Firefox")
|
|
||||||
public void initializeTheRemoteWebdriverFirefox() {
|
|
||||||
BrowserInit("firefox");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Given("navigate to {string}")
|
|
||||||
public void navigate_to(String url) {
|
|
||||||
// Write code here that turns the phrase above into concrete actions
|
|
||||||
driver.get(url);
|
|
||||||
}
|
|
||||||
@When("User type text into the text box and hit click")
|
|
||||||
public void user_type_text_into_the_text_box_and_hit_click() throws IOException, InterruptedException {
|
|
||||||
// Write code here that turns the phrase above into concrete actions
|
|
||||||
HomePage hp = new HomePage();
|
|
||||||
hp.insertText();
|
|
||||||
}
|
|
||||||
@Then("Text is displayed {string}")
|
|
||||||
public void text_is_displayed(String string) {
|
|
||||||
// Write code here that turns the phrase above into concrete actions
|
|
||||||
HomePage hp = new HomePage();
|
|
||||||
hp.textConfirmation();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,10 +0,0 @@
|
|||||||
package testNGRunner;
|
|
||||||
|
|
||||||
import io.cucumber.testng.AbstractTestNGCucumberTests;
|
|
||||||
import io.cucumber.testng.CucumberOptions;
|
|
||||||
|
|
||||||
@CucumberOptions(features = "src/main/java/features", glue = "stepDefinition", monochrome = false, plugin = { "pretty",
|
|
||||||
"html:BDDrepo/bddReports" }, tags = "@Smoke")
|
|
||||||
public class TestRunner extends AbstractTestNGCucumberTests {
|
|
||||||
|
|
||||||
}
|
|
||||||
@ -2,23 +2,19 @@ package zacksolutions.base;
|
|||||||
|
|
||||||
import java.io.FileInputStream;
|
import java.io.FileInputStream;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.net.MalformedURLException;
|
|
||||||
import java.net.URL;
|
|
||||||
import java.time.Duration;
|
import java.time.Duration;
|
||||||
import java.util.Properties;
|
import java.util.Properties;
|
||||||
import com.aventstack.extentreports.ExtentTest;
|
import com.aventstack.extentreports.ExtentTest;
|
||||||
import com.aventstack.extentreports.reporter.ExtentSparkReporter;
|
import com.aventstack.extentreports.reporter.ExtentSparkReporter;
|
||||||
import com.aventstack.extentreports.ExtentReports;
|
import com.aventstack.extentreports.ExtentReports;
|
||||||
import org.openqa.selenium.WebDriver;
|
import org.openqa.selenium.WebDriver;
|
||||||
|
import org.openqa.selenium.chrome.ChromeDriver;
|
||||||
import org.openqa.selenium.chrome.ChromeOptions;
|
import org.openqa.selenium.chrome.ChromeOptions;
|
||||||
import org.openqa.selenium.firefox.FirefoxOptions;
|
import org.openqa.selenium.firefox.FirefoxDriver;
|
||||||
import org.openqa.selenium.remote.RemoteWebDriver;
|
|
||||||
import org.testng.annotations.Parameters;
|
|
||||||
|
|
||||||
public class Initialization {
|
public class Initialization {
|
||||||
// let's set up our variables
|
// let's set up our variables
|
||||||
|
|
||||||
// private static ThreadLocal<WebDriver> driver = new ThreadLocal<>();
|
|
||||||
public static WebDriver driver;
|
public static WebDriver driver;
|
||||||
public static Properties prop;
|
public static Properties prop;
|
||||||
public static ExtentReports extent;
|
public static ExtentReports extent;
|
||||||
@ -40,8 +36,7 @@ public class Initialization {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Parameters("browser")
|
public void BrowserInit() {
|
||||||
public void BrowserInit(String browser) {
|
|
||||||
// our EXTENTREPORTS SETUP!
|
// our EXTENTREPORTS SETUP!
|
||||||
|
|
||||||
String path = System.getProperty("user.dir") + "/reports/index.html";
|
String path = System.getProperty("user.dir") + "/reports/index.html";
|
||||||
@ -52,50 +47,31 @@ public class Initialization {
|
|||||||
extent.attachReporter(spark);
|
extent.attachReporter(spark);
|
||||||
extent.setSystemInfo("Tester ID: ", "Sami");
|
extent.setSystemInfo("Tester ID: ", "Sami");
|
||||||
|
|
||||||
if (browser.equalsIgnoreCase("chrome")) {
|
// conditioning our WebDriver with an if statement
|
||||||
ChromeOptions options = new ChromeOptions();
|
String browsername = prop.getProperty("browserC");
|
||||||
try {
|
|
||||||
driver = new RemoteWebDriver(new URL("http://192.168.1.215:4444/wd/hub"), options);
|
// launching FireFox
|
||||||
} catch (MalformedURLException e) {
|
if (browsername.equalsIgnoreCase("firefox")) {
|
||||||
e.printStackTrace();
|
// System.setProperty("web-driver.gecko.driver","user.dir" +
|
||||||
// TODO: handle exception
|
// "/drivers/geckodriver");
|
||||||
}
|
// driver = new FirefoxDriver();
|
||||||
} else if (browser.equalsIgnoreCase("firefox")) {
|
driver.get(prop.getProperty("url"));
|
||||||
FirefoxOptions options = new FirefoxOptions();
|
|
||||||
try {
|
|
||||||
driver = new RemoteWebDriver(new URL("http://192.168.1.215:4444/wd/hub"), options);
|
|
||||||
} catch (MalformedURLException e) {
|
|
||||||
// TODO: handle exception
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
throw new IllegalArgumentException("Unsupported browser: " + browser);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
// launching Chrome
|
||||||
// // conditioning our WebDriver with an if statement
|
if (browsername.equalsIgnoreCase("chrome")) {
|
||||||
// String browsername = prop.getProperty("browserF");
|
// System.setProperty("web-driver.gecko.driver", "user.dir" +
|
||||||
//
|
// "/drivers/chromedriver");
|
||||||
// // launching FireFox
|
// driver = new ChromeDriver();
|
||||||
// if (browsername.equalsIgnoreCase("firefox")) {
|
ChromeOptions options = new ChromeOptions();
|
||||||
// // System.setProperty("web-driver.gecko.driver","user.dir" +
|
driver = new ChromeDriver(options);
|
||||||
// // "/drivers/geckodriver");
|
options.addArguments("--no-sandbox");
|
||||||
// // driver = new FirefoxDriver();
|
options.addArguments("--disable-dev-shm-usage");
|
||||||
// FirefoxOptions options = new FirefoxOptions();
|
options.addArguments("--headless");
|
||||||
// options.addArguments("--headless");
|
options.addArguments("--remote-debugging-port=9222");
|
||||||
// driver = new FirefoxDriver(options);
|
options.setBinary("/usr/bin/google-chrome");
|
||||||
// }
|
driver.get(prop.getProperty("url"));
|
||||||
//
|
}
|
||||||
// // launching Chrome
|
|
||||||
// if (browsername.equalsIgnoreCase("chrome")) {
|
|
||||||
// // System.setProperty("web-driver.gecko.driver", "user.dir" +
|
|
||||||
// // "/drivers/chromedriver");
|
|
||||||
// // driver = new ChromeDriver();
|
|
||||||
// ChromeOptions options = new ChromeOptions();
|
|
||||||
// options.addArguments("--headless");
|
|
||||||
// driver = new ChromeDriver(options);
|
|
||||||
// }
|
|
||||||
driver.get(prop.getProperty("url"));
|
|
||||||
driver.manage().window().maximize();
|
driver.manage().window().maximize();
|
||||||
driver.manage().deleteAllCookies();
|
driver.manage().deleteAllCookies();
|
||||||
driver.manage().timeouts().implicitlyWait(Duration.ofSeconds(5));
|
driver.manage().timeouts().implicitlyWait(Duration.ofSeconds(5));
|
||||||
|
|||||||
@ -1,36 +0,0 @@
|
|||||||
package zacksolutions.base;
|
|
||||||
|
|
||||||
import com.fasterxml.jackson.databind.JsonNode;
|
|
||||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
|
||||||
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.io.InputStream;
|
|
||||||
import java.net.HttpURLConnection;
|
|
||||||
import java.net.URL;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* JokesAPI
|
|
||||||
*/
|
|
||||||
public class JokesAPI {
|
|
||||||
|
|
||||||
private String setup;
|
|
||||||
private String punchline;
|
|
||||||
|
|
||||||
public void fetchJokes() throws IOException {
|
|
||||||
|
|
||||||
URL apiUrl = new URL("https://official-joke-api.appspot.com/jokes/random");
|
|
||||||
HttpURLConnection connection = (HttpURLConnection) apiUrl.openConnection();
|
|
||||||
connection.setRequestProperty("accept", "application/json");
|
|
||||||
InputStream responseStream = connection.getInputStream();
|
|
||||||
ObjectMapper mapper = new ObjectMapper();
|
|
||||||
JsonNode root = mapper.readTree(responseStream);
|
|
||||||
this.setup = root.path("setup").asText();
|
|
||||||
this.punchline = root.path("punchline").asText();
|
|
||||||
}
|
|
||||||
public String getSetup(){
|
|
||||||
return setup;
|
|
||||||
}
|
|
||||||
public String getPunchline(){
|
|
||||||
return punchline;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1 +1,5 @@
|
|||||||
url=https://zenful.cloud/
|
url=https://zenful.cloud/
|
||||||
|
|
||||||
|
browserC= chrome
|
||||||
|
browserF= firefox
|
||||||
|
|
||||||
|
|||||||
@ -3,46 +3,32 @@ package zacksolutions.pages;
|
|||||||
import org.openqa.selenium.WebElement;
|
import org.openqa.selenium.WebElement;
|
||||||
import org.openqa.selenium.support.FindBy;
|
import org.openqa.selenium.support.FindBy;
|
||||||
import org.openqa.selenium.support.PageFactory;
|
import org.openqa.selenium.support.PageFactory;
|
||||||
import org.openqa.selenium.support.ui.ExpectedConditions;
|
|
||||||
import org.openqa.selenium.support.ui.WebDriverWait;
|
|
||||||
import zacksolutions.base.Initialization;
|
import zacksolutions.base.Initialization;
|
||||||
import zacksolutions.base.JokesAPI;
|
|
||||||
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.time.Duration;
|
|
||||||
|
|
||||||
public class HomePage extends Initialization {
|
public class HomePage extends Initialization {
|
||||||
// Using PageFactory Object Model we get our elemets
|
//Using PageFactory Object Model we get our elemets
|
||||||
@FindBy(id = "message")
|
@FindBy(id="message")
|
||||||
WebElement message;
|
WebElement message;
|
||||||
|
|
||||||
@FindBy(css = "button[type='submit']")
|
@FindBy(css="button[type='submit']")
|
||||||
WebElement button;
|
WebElement button;
|
||||||
|
|
||||||
@FindBy(xpath = "//tbody/tr[1]/td[1]")
|
@FindBy(css="tbody tr:nth-child(1) td:nth-child(1)")
|
||||||
WebElement ConfirmText;
|
WebElement ConfirmText;
|
||||||
|
|
||||||
// Initialization
|
//Initialization
|
||||||
public HomePage() {
|
public HomePage(){
|
||||||
PageFactory.initElements(driver, this);
|
PageFactory.initElements(driver, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Actions
|
//Actions
|
||||||
public void insertText() throws InterruptedException, IOException {
|
public void insertText() throws InterruptedException {
|
||||||
JokesAPI jokesAPI = new JokesAPI();
|
test = extent.createTest("Test msg");
|
||||||
jokesAPI.fetchJokes();
|
message.sendKeys("4 8 15 16 23 42");
|
||||||
String setup = jokesAPI.getSetup();
|
button.click();
|
||||||
String punchline = jokesAPI.getPunchline();
|
extent.flush();
|
||||||
test = extent.createTest("Test msg");
|
}
|
||||||
message.sendKeys(setup + " ==> " + punchline);
|
public String textConfirmation(){
|
||||||
button.click();
|
return ConfirmText.getText();
|
||||||
extent.flush();
|
}
|
||||||
}
|
|
||||||
|
|
||||||
public void textConfirmation() {
|
|
||||||
WebDriverWait wait = new WebDriverWait(driver, Duration.ofSeconds(15)); // Adjust the timeout as needed
|
|
||||||
wait.until(ExpectedConditions.visibilityOf(ConfirmText));
|
|
||||||
String joke = ConfirmText.getText();
|
|
||||||
System.out.println(joke);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,14 +1,12 @@
|
|||||||
package zacksolutions;
|
package zacksolutions;
|
||||||
|
|
||||||
|
import org.testng.Assert;
|
||||||
import org.testng.annotations.AfterTest;
|
import org.testng.annotations.AfterTest;
|
||||||
import org.testng.annotations.BeforeTest;
|
import org.testng.annotations.BeforeTest;
|
||||||
import org.testng.annotations.Parameters;
|
|
||||||
import org.testng.annotations.Test;
|
import org.testng.annotations.Test;
|
||||||
import zacksolutions.base.Initialization;
|
import zacksolutions.base.Initialization;
|
||||||
import zacksolutions.pages.HomePage;
|
import zacksolutions.pages.HomePage;
|
||||||
|
|
||||||
import java.io.IOException;
|
|
||||||
|
|
||||||
public class HomePageTest extends Initialization {
|
public class HomePageTest extends Initialization {
|
||||||
|
|
||||||
HomePage homePage;
|
HomePage homePage;
|
||||||
@ -17,22 +15,18 @@ public class HomePageTest extends Initialization {
|
|||||||
super();
|
super();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Parameters("browser")
|
|
||||||
@BeforeTest
|
@BeforeTest
|
||||||
public void setUp(String browser) {
|
public void setUp() {
|
||||||
BrowserInit(browser);
|
BrowserInit();
|
||||||
homePage = new HomePage();
|
homePage = new HomePage();
|
||||||
System.out.println("Starting " + browser);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void TextTest() throws InterruptedException, IOException {
|
public void TextTest() throws InterruptedException {
|
||||||
HomePage hp = new HomePage();
|
HomePage hp = new HomePage();
|
||||||
hp.insertText();
|
hp.insertText();
|
||||||
/*
|
|
||||||
hp.textConfirmation();
|
hp.textConfirmation();
|
||||||
*/
|
Assert.assertEquals(hp.textConfirmation(), "4 8 15 16 23 42");
|
||||||
System.out.println("Job is done, please check this link: " + prop.getProperty("url"));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@AfterTest
|
@AfterTest
|
||||||
|
|||||||
@ -1,11 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
|
|
||||||
<suite name="All Test Suite" thread-count="1" parallel="tests">
|
|
||||||
<test name="CucumberTest">
|
|
||||||
<classes>
|
|
||||||
<class name="testNGRunner.TestRunner">
|
|
||||||
</class>
|
|
||||||
</classes>
|
|
||||||
</test>
|
|
||||||
</suite>
|
|
||||||
|
|
||||||
15
testng.xml
15
testng.xml
@ -1,19 +1,12 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
|
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
|
||||||
<suite name="All Test Suite" thread-count="1" parallel="tests">
|
<suite name="All Test Suite">
|
||||||
<test name="FireFoxTest">
|
<test verbose="2" preserve-order="true" name="/home/ilyes/SeleniumPractice/Zenful">
|
||||||
<parameter name="browser" value="firefox"/>
|
|
||||||
<classes>
|
|
||||||
<class name="zacksolutions.HomePageTest">
|
|
||||||
</class>
|
|
||||||
</classes>
|
|
||||||
</test>
|
|
||||||
<test name="ChromeTest">
|
|
||||||
<parameter name="browser" value="chrome"/>
|
|
||||||
<classes>
|
<classes>
|
||||||
<class name="zacksolutions.HomePageTest">
|
<class name="zacksolutions.HomePageTest">
|
||||||
|
<methods><include name="TextTest"/>
|
||||||
|
</methods>
|
||||||
</class>
|
</class>
|
||||||
</classes>
|
</classes>
|
||||||
</test>
|
</test>
|
||||||
</suite>
|
</suite>
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user