forked from Zakaria/testNG
CICD
This commit is contained in:
parent
0ea536fcfa
commit
508768016e
19
.gitea/workflows/mvnCICD.yaml
Normal file
19
.gitea/workflows/mvnCICD.yaml
Normal file
@ -0,0 +1,19 @@
|
||||
name: Gitea Actions Demo
|
||||
run-name: ${{ gitea.actor }} is testing out Gitea Actions 🚀
|
||||
on: [push]
|
||||
|
||||
jobs:
|
||||
Explore-Gitea-Actions:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- run: echo "🎉 The job was automatically triggered by a ${{ gitea.event_name }} event."
|
||||
- run: echo "🐧 This job is now running on a ${{ runner.os }} server hosted by Gitea!"
|
||||
- run: echo "🔎 The name of your branch is ${{ gitea.ref }} and your repository is ${{ gitea.repository }}."
|
||||
- name: Check out repository code
|
||||
uses: actions/checkout@v4
|
||||
- run: echo "💡 The ${{ gitea.repository }} repository has been cloned to the runner."
|
||||
- run: echo "🖥️ The workflow is now ready to test your code on the runner."
|
||||
- name: List files in the repository
|
||||
run: |
|
||||
ls ${{ gitea.workspace }}
|
||||
- run: echo "🍏 This job's status is ${{ job.status }}."
|
||||
45
pom.xml
45
pom.xml
@ -13,6 +13,46 @@
|
||||
<properties>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
</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>testngGroups.xml</suiteXmlFile>
|
||||
</suiteXmlFiles>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</pluginManagement>
|
||||
</build>
|
||||
</profile>
|
||||
</profiles>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
@ -28,11 +68,6 @@
|
||||
<artifactId>selenium-java</artifactId>
|
||||
<version>4.25.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-surefire-plugin</artifactId>
|
||||
<version>3.5.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.testng</groupId>
|
||||
<artifactId>testng</artifactId>
|
||||
|
||||
2
src/data.properties
Normal file
2
src/data.properties
Normal file
@ -0,0 +1,2 @@
|
||||
browser="firefox"
|
||||
url="https://zenful.cloud/"
|
||||
14
src/test/java/zacksolutions/GlobalValues.java
Normal file
14
src/test/java/zacksolutions/GlobalValues.java
Normal file
@ -0,0 +1,14 @@
|
||||
package zacksolutions;
|
||||
|
||||
import java.io.FileInputStream;
|
||||
import java.io.IOException;
|
||||
import java.util.Properties;
|
||||
|
||||
public class GlobalValues {
|
||||
public static void main(String[] args) throws IOException {
|
||||
Properties pro = new Properties();
|
||||
FileInputStream fis = new FileInputStream("/home/ilyes/SeleniumPractice/testNG_FrameWork/src/data.properties");
|
||||
pro.load(fis);
|
||||
System.out.println(pro.getProperty("url"));
|
||||
}
|
||||
}
|
||||
@ -4,7 +4,7 @@ import org.testng.annotations.BeforeTest;
|
||||
import org.testng.annotations.Parameters;
|
||||
import org.testng.annotations.Test;
|
||||
|
||||
public class TestHomePage {
|
||||
public class HomePageTest {
|
||||
|
||||
@Parameters({ "URL" })
|
||||
@Test(groups = { "Smoke" })
|
||||
@ -2,7 +2,7 @@ package zacksolutions;
|
||||
|
||||
import org.testng.annotations.Test;
|
||||
|
||||
public class TestLoginPage {
|
||||
public class LoginPageTest {
|
||||
@Test
|
||||
public static void testCaseEleven() {
|
||||
System.out.println("Debug the eleventh case");
|
||||
@ -3,7 +3,7 @@ package zacksolutions;
|
||||
import org.testng.annotations.AfterTest;
|
||||
import org.testng.annotations.Test;
|
||||
|
||||
public class TestNGClass {
|
||||
public class NGClassTest {
|
||||
@AfterTest
|
||||
public static void testCaseOne() {
|
||||
System.out.println("Debug the firtst case ### AFTER TEST ###");
|
||||
@ -1,9 +1,8 @@
|
||||
package zacksolutions;
|
||||
|
||||
import org.testng.Assert;
|
||||
import org.testng.annotations.Test;
|
||||
|
||||
public class TestNGDiffClass {
|
||||
public class NGDiffClassTest {
|
||||
@Test
|
||||
public void testCaseSix() {
|
||||
System.out.println("Debug the sixteenth case");
|
||||
@ -27,6 +26,5 @@ public class TestNGDiffClass {
|
||||
@Test(groups = { "Smoke" })
|
||||
public static void testCaseTen() {
|
||||
System.out.println("Debug the tenth case");
|
||||
Assert.assertTrue(false);
|
||||
}
|
||||
}
|
||||
11
testng.xml
11
testng.xml
@ -3,17 +3,20 @@
|
||||
<suite name="All Test Suite">
|
||||
<test verbose="2" preserve-order="true" name="/home/ilyes/LearnSelenium/testNG_FrameWork">
|
||||
<classes>
|
||||
<class name="zacksolutions.TestNGDiffClass">
|
||||
<class name="zacksolutions.NGDiffClassTest">
|
||||
</class>
|
||||
<class name="zacksolutions.TestHomePage">
|
||||
<class name="zacksolutions.HomePageTest">
|
||||
<methods>
|
||||
<exclude name="testCaseSixteen"></exclude>
|
||||
</methods>
|
||||
</class>
|
||||
</classes>
|
||||
</test>
|
||||
<test name="DiffTest">
|
||||
<classes>
|
||||
<class name="zacksolutions.TestNGClass">
|
||||
<class name="zacksolutions.NGClassTest">
|
||||
</class>
|
||||
<class name="zacksolutions.TestLoginPage">
|
||||
<class name="zacksolutions.LoginPageTest">
|
||||
</class>
|
||||
</classes>
|
||||
</test>
|
||||
|
||||
@ -4,7 +4,7 @@
|
||||
<listeners>
|
||||
<listener class-name="zacksolutions.Listeners"></listener>
|
||||
</listeners>
|
||||
<parameter name="URL" value="zacksolutions.dev"/>
|
||||
<parameter name="URL" value="https://gitea.zacksolutions.dev"/>
|
||||
<test name="RegressionTest">
|
||||
<groups>
|
||||
<run>
|
||||
@ -12,13 +12,13 @@
|
||||
</run>
|
||||
</groups>
|
||||
<classes>
|
||||
<class name="zacksolutions.TestNGDiffClass">
|
||||
<class name="zacksolutions.NGDiffClassTest">
|
||||
</class>
|
||||
<class name="zacksolutions.TestHomePage">
|
||||
<class name="zacksolutions.HomePageTest">
|
||||
</class>
|
||||
<class name="zacksolutions.TestNGClass">
|
||||
<class name="zacksolutions.NGClassTest">
|
||||
</class>
|
||||
<class name="zacksolutions.TestLoginPage">
|
||||
<class name="zacksolutions.LoginPageTest">
|
||||
</class>
|
||||
</classes>
|
||||
</test>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user