Skip to content

Commit

Permalink
update with last functionalities
Browse files Browse the repository at this point in the history
  • Loading branch information
josepharul82 committed Mar 18, 2024
1 parent 3e876ce commit eef7236
Show file tree
Hide file tree
Showing 126 changed files with 2,021 additions and 926 deletions.
34 changes: 21 additions & 13 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,15 @@
<modelVersion>4.0.0</modelVersion>
<groupId>fr.axa.automation.webengine</groupId>
<artifactId>webengine-parent</artifactId>
<version>3.0.11</version>
<version>3.1.14</version>
<packaging>pom</packaging>
<name>webengine-parent</name>

<distributionManagement>
<repository>
<id>github</id>
<name>GitHub Packages</name>
<url>https://maven.pkg.github.com/AxaFrance/webengine-java</url>
</repository>
</distributionManagement>
<parent>
<groupId>fr.axa.socle.axafr</groupId>
<artifactId>axafr-corporate-parent</artifactId>
<version>2.0.3</version>
</parent>

<properties>
<java-source.version>1.8</java-source.version>
Expand Down Expand Up @@ -69,22 +67,24 @@
<poi.version>5.2.3</poi.version>

<jackson-core.version>2.13.2</jackson-core.version>
<maven-deploy-plugin.version>3.1.1</maven-deploy-plugin.version>
</properties>

<modules>
<module>webengine-util</module>
<module>webengine-js</module>
<module>webengine-report</module>
<module>webengine-core</module>
<module>webengine-web</module>
<module>webengine-runner</module>
<module>webengine-boot-keyword-driven</module>
<module>webengine-test-keyword-driven</module>
<module>webengine-boot-gherkin</module>
<module>webengine-test-gherkin</module>
<module>webengine-test-linear</module>
<module>webengine-report-jacoco-aggregate</module>
<module>webengine-boot-keyword-driven</module>
<module>webengine-drive-by-excel</module>
<module>webengine-cmd-line</module>
<module>webengine-report-jacoco-aggregate</module>
<module>webengine-test-linear</module>
<module>webengine-test-gherkin</module>
<module>webengine-test-keyword-driven</module>
</modules>

<dependencies>
Expand Down Expand Up @@ -461,6 +461,14 @@
</execution>
</executions>
</plugin>
<plugin>
<!-- https://mvnrepository.com/artifact/org.apache.maven.plugins/maven-deploy-plugin -->

<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<version>${maven-deploy-plugin.version}</version>

</plugin>

</plugins>
<pluginManagement>
Expand Down
3 changes: 1 addition & 2 deletions webengine-boot-gherkin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,10 @@
<parent>
<groupId>fr.axa.automation.webengine</groupId>
<artifactId>webengine-parent</artifactId>
<version>3.0.11</version>
<version>3.1.14</version>
</parent>

<artifactId>webengine-boot-gherkin</artifactId>
<version>3.0.11</version>
<packaging>jar</packaging>
<name>webengine-boot-gherkin</name>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ private static Optional<GlobalConfiguration> getConfig() throws Exception {
}

public static Optional<WebDriver> getDefaultDriver() throws WebEngineException {
return BrowserFactory.getWebDriver(Platform.WINDOWS, Browser.CHROMIUM_EDGE);
return BrowserFactory.getWebDriver(Platform.WINDOWS, Browser.CHROMIUM_EDGE,true);
}

public static void quiDriver(WebDriver webDriver) throws WebEngineException {
Expand Down
3 changes: 1 addition & 2 deletions webengine-boot-keyword-driven/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,10 @@
<parent>
<groupId>fr.axa.automation.webengine</groupId>
<artifactId>webengine-parent</artifactId>
<version>3.0.11</version>
<version>3.1.14</version>
</parent>

<artifactId>webengine-boot-keyword-driven</artifactId>
<version>3.0.11</version>
<packaging>jar</packaging>
<name>webengine-boot-keyword-driven</name>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,29 +61,21 @@ public void runTestSuite(CommandLine commandLine) throws WebEngineException, IOE
ITestSuite testSuite = TestSuiteHelper.getTestSuite();
AbstractGlobalApplicationContext globalApplicationContext = getGlobalApplicationContext(commandLine, testSuite);

loggerService.info("Start Phase initialize test suite ");
testSuiteExecutor.initialize(globalApplicationContext);
loggerService.info("End Phase initialize ");

loggerService.info("Start run test ");
if (testSuite instanceof AbstractTestSuite) {
((AbstractTestSuite) testSuite).setGlobalApplicationContext(globalApplicationContext);
}
TestSuiteReport testSuiteReport = ((ITestSuiteWebExecutor)testSuiteExecutor).run(globalApplicationContext, testSuite);
loggerService.info("End run test ");

loggerService.info("Start clean ");
testSuiteExecutor.cleanUp(globalApplicationContext);
loggerService.info("End clean ");

loggerService.info("Start report ");
Map<ReportPathKey,String> reportsPath = reportHelper.generateReports(testSuiteReport, testSuite.getClass().getSimpleName(), globalApplicationContext.getSettings().getOutputDir());
loggerService.info("End report ");

if(globalApplicationContext.getSettings().isShowReport()) {
loggerService.info("Open report ");
reportHelper.openReport(reportsPath.get(ReportPathKey.HTML_REPORT_PATH_KEY) + File.separator + "index.html");
loggerService.info("End open report ");
}
if(testSuiteReport!=null && testSuiteReport.getFailed()>0){
String errorMsg = "Test suite failed. Total number of test case :" + testSuiteReport.getNumberOfTestcase() +". Number of failed test : "+testSuiteReport.getFailed();
loggerService.error(errorMsg);
throw new WebEngineException(errorMsg);
}
}

Expand Down
3 changes: 1 addition & 2 deletions webengine-cmd-line/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,10 @@
<parent>
<groupId>fr.axa.automation.webengine</groupId>
<artifactId>webengine-parent</artifactId>
<version>3.0.11</version>
<version>3.1.14</version>
</parent>

<artifactId>webengine-cmd-line</artifactId>
<version>3.0.11</version>
<packaging>jar</packaging>
<name>webengine-cmd-line</name>

Expand Down
10 changes: 8 additions & 2 deletions webengine-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,10 @@
<parent>
<groupId>fr.axa.automation.webengine</groupId>
<artifactId>webengine-parent</artifactId>
<version>3.0.11</version>
<version>3.1.14</version>
</parent>

<artifactId>webengine-core</artifactId>
<version>3.0.11</version>
<packaging>jar</packaging>
<name>webengine-core</name>

Expand All @@ -21,6 +20,13 @@
<version>${project.parent.version}</version>
</dependency>

<dependency>
<groupId>fr.axa.automation.webengine</groupId>
<artifactId>webengine-js</artifactId>
<version>${project.parent.version}</version>
</dependency>


<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ protected AbstractTestSuiteExecutor(ITestCaseExecutor testCaseExecutor, ILocalTe
}

public Object initialize(AbstractGlobalApplicationContext globalApplicationContext) {
loggerService.info("Start Phase initialize test suite ");
runLocalTesting(globalApplicationContext);
loggerService.info("End Phase initialize ");
return null;
}

Expand All @@ -32,7 +34,9 @@ private void runLocalTesting(AbstractGlobalApplicationContext globalApplicationC
}

public void cleanUp(Object object) {
loggerService.info("Start clean ");
stopLocalTesting();
loggerService.info("End clean ");
}

private void stopLocalTesting() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,7 @@ public class WebengineConfiguration {
String name;
String platformName = null;
String browserName = null;
String browserVersion = null;
List<String> browserOptionList;
String outputDir;
AppiumConfiguration appiumConfiguration;
}

25 changes: 21 additions & 4 deletions webengine-drive-by-excel/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,10 @@
<parent>
<groupId>fr.axa.automation.webengine</groupId>
<artifactId>webengine-parent</artifactId>
<version>3.0.11</version>
<version>3.1.14</version>
</parent>

<artifactId>webengine-drive-by-excel</artifactId>
<version>3.0.11</version>
<packaging>jar</packaging>
<name>webengine-drive-by-excel</name>

Expand Down Expand Up @@ -147,7 +146,7 @@
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>unpack</id>
<id>unpack-report</id>
<phase>generate-resources</phase>
<goals>
<goal>unpack</goal>
Expand All @@ -165,9 +164,27 @@
</artifactItems>
</configuration>
</execution>
<execution>
<id>unpack-js</id>
<phase>generate-resources</phase>
<goals>
<goal>unpack</goal>
</goals>
<configuration>
<artifactItems>
<artifactItem>
<groupId>fr.axa.automation.webengine</groupId>
<artifactId>webengine-js</artifactId>
<version>${project.parent.version}</version>
<type>jar</type>
<includes>js/**</includes>
<outputDirectory>${basedir}/src/main/resources/</outputDirectory>
</artifactItem>
</artifactItems>
</configuration>
</execution>
</executions>
</plugin>

</plugins>
</build>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,6 @@ public static void main(String[] args) {
public void run(String... args) throws Exception {
loggerService.info("***************Start automation***************");
loggerService.info("Temporary directory : "+System.getProperty("java.io.tmpdir"));
// java -jar drive-by-excel.jar "-data:file.xls"
// java -jar drive-by-excel.jar -Dspring.profiles.active=properties-chrome "-data:file.xls" "-tc:firsttestcase[-dataColumName:jdd-rec-auto;jdd-rec-moto] ; testcase2[-dataColumName:jdd-rec-moto]" "-browser:Chrome" "-platform:Android"
// java -jar drive-by-excel.jar "-data:file.xls" "-tc:firsttestcase, testcase2[-dataColumName:jdd-rec-moto]"
// java -jar drive-by-excel.jar "-data:file.xls" "-tc:firsttestcase, testcase2[-indexColumn:5]"
// java -jar drive-by-excel.jar "-data:file.xls" "-tc:firsttestcase, testcase2[-letterColumn:F]"
// "-data:C:\\work\\projet-git\\ExcelToJavaObjectConverter\\Test-1.xlsx" "-tc:devis-auto" "-platform:Windows" "-browser:ChromiumEdge"

bootProject.runFromFramework(args);
loggerService.info("***************End automation***************");
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package fr.axa.automation.webengine.boot;

import fr.axa.automation.webengine.api.ITestSuiteNoCodeExecutor;
import fr.axa.automation.webengine.argument.ArgumentOption;
import fr.axa.automation.webengine.checking.chain.IChecking;
import fr.axa.automation.webengine.checking.chain.impl.AbstractChecking;
Expand All @@ -12,6 +11,7 @@
import fr.axa.automation.webengine.checking.runner.impl.CheckingRunner;
import fr.axa.automation.webengine.core.ITestSuiteExecutor;
import fr.axa.automation.webengine.exception.WebEngineException;
import fr.axa.automation.webengine.executor.ITestSuiteNoCodeExecutor;
import fr.axa.automation.webengine.executor.TestSuiteNoCodeExecutor;
import fr.axa.automation.webengine.generated.TestSuiteReport;
import fr.axa.automation.webengine.global.AbstractGlobalApplicationContext;
Expand Down Expand Up @@ -66,43 +66,33 @@ protected List<ArgumentOption> getArgumentOptionProjet() {
@Override
public void runFromFramework(String... args) throws Exception {
loggerService.info("Arguments : "+ ArgumentParser.removeOptionFromArguments(args,ArgumentOption.KEEPASS_PASSWORD));
TestSuiteReport testSuiteReport = null;
try{
CommandLine commandLine = getCommandLine(getArgumentOptionFramework(), args);
AbstractGlobalApplicationContext globalApplicationContext = getGlobalApplicationContext(commandLine);
TestSuiteDataNoCode testSuiteData = getTestSuiteData(globalApplicationContext);
checkInput(globalApplicationContext,testSuiteData);

loggerService.info("Start Phase initialize test suite ");
testSuiteExecutor.initialize(globalApplicationContext);
loggerService.info("End Phase initialize ");

loggerService.info("Start run test ");

TestSuiteReport testSuiteReport = ((ITestSuiteNoCodeExecutor) testSuiteExecutor).run(globalApplicationContext, testSuiteData);
loggerService.info("End run test ");

loggerService.info("Start clean ");
testSuiteReport = ((ITestSuiteNoCodeExecutor) testSuiteExecutor).run(globalApplicationContext, testSuiteData);
testSuiteExecutor.cleanUp(globalApplicationContext);
loggerService.info("End clean ");

loggerService.info("Start report ");
testSuiteReport.getTestResults().get(0).setLog("Arguments : "+ArgumentParser.removeOptionFromArguments(args,ArgumentOption.KEEPASS_PASSWORD));
Map<ReportPathKey,String> reportsPath = reportHelper.generateReports(testSuiteReport, "", globalApplicationContext.getSettings().getOutputDir());
loggerService.info("End report ");

if(globalApplicationContext.getSettings().isShowReport()) {
loggerService.info("Open report ");
reportHelper.openReport(reportsPath.get(ReportPathKey.HTML_REPORT_PATH_KEY) + File.separator + "index.html");
loggerService.info("End open report ");
}
if (((SettingsNoCode)globalApplicationContext.getSettings()).isDeleteTempFile()){
loggerService.info("Delete temp file ");
((TestSuiteNoCodeExecutor) testSuiteExecutor).deleteTempFile(((SettingsNoCode) globalApplicationContext.getSettings()).getDataTestFileName());
loggerService.info("End delete temp file ");
}
}catch (Exception e){
loggerService.info("Error during execution of the automate. You can see more details in the file log");
loggerService.error("Error during execution of the automate. You can see more details in the file log",e);
ApplicationDesktop.openFile(LoggerAppender.getFileAppender());
}
if(testSuiteReport!=null && testSuiteReport.getFailed()>0){
String errorMsg = "Test suite failed. Total number of test case :" + testSuiteReport.getNumberOfTestcase() +". Number of failed test : "+testSuiteReport.getFailed();
loggerService.error(errorMsg);
ApplicationDesktop.openFile(LoggerAppender.getFileAppender());
throw new Exception(errorMsg);
}
}

Expand Down
Loading

0 comments on commit eef7236

Please sign in to comment.