Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
RameshBabuPrudhvi committed Aug 4, 2021
2 parents 8e83c1d + 59323f6 commit 0fb35eb
Show file tree
Hide file tree
Showing 27 changed files with 111 additions and 73 deletions.
8 changes: 0 additions & 8 deletions .github/workflows/dependabot.yml

This file was deleted.

38 changes: 17 additions & 21 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<groupId>io.github.selcukes</groupId>
<artifactId>selcukes-parent</artifactId>
<packaging>pom</packaging>
<version>0.0.7-SNAPSHOT</version>
<version>1.2.3-SNAPSHOT</version>

<modules>
<module>selcukes-commons</module>
Expand All @@ -16,37 +16,36 @@
<module>selcukes-testng</module>
<module>selcukes-reports</module>
<module>selcukes-server</module>
<module>selcukes-junit</module>

<module>selcukes-junit</module>
</modules>

<name>selcukes-java</name>
<description>selcukes-framework</description>
<url>https://github.com/selcukes/selcukes-java</url>
<inceptionYear>2020</inceptionYear>
<inceptionYear>2021</inceptionYear>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>1.8</java.version>
<java.version>11</java.version>

<commons.io.version>2.7</commons.io.version>
<lombok.version>1.18.12</lombok.version>
<jackson.version>2.11.0</jackson.version>
<apache-http.version>5.0.1</apache-http.version>
<commons.io.version>2.11.0</commons.io.version>
<lombok.version>1.18.20</lombok.version>
<jackson.version>2.12.3</jackson.version>
<apache-http.version>5.1</apache-http.version>
<commons-compress.version>1.21</commons-compress.version>
<jsoup.version>1.13.1</jsoup.version>
<cucumber-reporting.version>5.3.1</cucumber-reporting.version>
<jsoup.version>1.14.1</jsoup.version>
<cucumber-reporting.version>5.5.4</cucumber-reporting.version>
<recorder.version>0.7.7.0</recorder.version>

<cucumber.version>6.7.0</cucumber.version>
<cucumber.version>6.10.4</cucumber.version>
<selenium.version>3.141.59</selenium.version>
<appium.version>7.2.0</appium.version>
<testng.version>7.3.0</testng.version>
<appium.version>7.5.1</appium.version>
<testng.version>7.4.0</testng.version>

<maven-javadoc-plugin.version>3.0.1</maven-javadoc-plugin.version>
<maven-source-plugin.version>2.2.1</maven-source-plugin.version>
<maven-gpg-plugin.version>1.6</maven-gpg-plugin.version>
<maven-javadoc-plugin.version>3.3.0</maven-javadoc-plugin.version>
<maven-source-plugin.version>3.2.1</maven-source-plugin.version>
<maven-gpg-plugin.version>3.0.1</maven-gpg-plugin.version>
<nexus-staging-maven-plugin.version>1.6.8</nexus-staging-maven-plugin.version>

<maven.compiler.source>${java.version}</maven.compiler.source>
Expand Down Expand Up @@ -249,10 +248,7 @@
<artifactId>maven-javadoc-plugin</artifactId>
<version>${maven-javadoc-plugin.version}</version>
<configuration>
<!-- Javadoc fix for java 11+ -->
<source>8</source>
<javadocVersion>${java.version}</javadocVersion>
<doclint>none</doclint>
<encoding>UTF-8</encoding>
</configuration>
<executions>
<execution>
Expand Down
2 changes: 1 addition & 1 deletion selcukes-commons/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>selcukes-parent</artifactId>
<groupId>io.github.selcukes</groupId>
<version>0.0.7-SNAPSHOT</version>
<version>1.2.3-SNAPSHOT</version>
</parent>

<modelVersion>4.0.0</modelVersion>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
package io.github.selcukes.commons.logging;

import java.util.logging.Level;
import java.util.logging.LogRecord;

public class SelcukesColorFormatter extends SelcukesLoggerFormatter {
private static final String COLOR_RESET = "\u001b[0m";
private static final String COLOR_SEVERE = "\u001b[91m";
private static final String COLOR_WARNING = "\u001b[93m";
private static final String COLOR_INFO = "\u001b[32m";
private static final String COLOR_CONFIG = "\u001b[94m";
private static final String COLOR_FINE = "\u001b[36m";
private static final String COLOR_FINER = "\u001b[35m";
private static final String COLOR_FINEST = "\u001b[90m";

private String getColoredMessage(Level level, String message) {
String prefix;
if (level == Level.SEVERE)
prefix = COLOR_SEVERE;
else if (level == Level.WARNING)
prefix = COLOR_WARNING;
else if (level == Level.INFO)
prefix = COLOR_INFO;
else if (level == Level.CONFIG)
prefix = COLOR_CONFIG;
else if (level == Level.FINE)
prefix = COLOR_FINE;
else if (level == Level.FINER)
prefix = COLOR_FINER;
else if (level == Level.FINEST)
prefix = COLOR_FINEST;
else
prefix = COLOR_SEVERE;

return prefix + message + COLOR_RESET;
}

@Override
public String format(LogRecord logRecord) {
String message = super.format(logRecord);
return getColoredMessage(logRecord.getLevel(), message);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,14 @@

public class SelcukesLoggerFormatter extends Formatter {

public String format(LogRecord record) {
public String format(LogRecord logRecord) {
StringBuilder builder = new StringBuilder(1000);
builder.append(DateHelper.get().timeStamp(record.getMillis())).append(" - ");
builder.append("[").append(getLevel(record)).append("] - ");
builder.append("[").append(record.getSourceClassName()).append(".");
builder.append(record.getSourceMethodName()).append(":").append(getLineNumber(record)).append("] - ");
builder.append(formatMessage(record));
Throwable throwable = record.getThrown();
builder.append(DateHelper.get().timeStamp(logRecord.getMillis())).append(" - ");
builder.append("[").append(getLevel(logRecord)).append("] - ");
builder.append("[").append(logRecord.getSourceClassName()).append(".");
builder.append(logRecord.getSourceMethodName()).append(":").append(getLineNumber(logRecord)).append("] - ");
builder.append(formatMessage(logRecord));
Throwable throwable = logRecord.getThrown();
if (null != throwable) {
builder.append('\n').append(ExceptionHelper.getStackTrace(throwable));
}
Expand All @@ -41,8 +41,8 @@ public String format(LogRecord record) {
return builder.toString();
}

public String getLevel(LogRecord record) {
String level = record.getLevel().getName();
public String getLevel(LogRecord logRecord) {
String level = logRecord.getLevel().getName();
switch (level) {
case "SEVERE":
level = "ERROR";
Expand Down Expand Up @@ -72,8 +72,8 @@ private StackTraceElement getCallerStackFrame(final String callerName) {
return callerFrame;
}

private String getLineNumber(LogRecord record) {
final StackTraceElement callerFrame = getCallerStackFrame(record.getSourceClassName());
private String getLineNumber(LogRecord logRecord) {
final StackTraceElement callerFrame = getCallerStackFrame(logRecord.getSourceClassName());

if (callerFrame != null) {

Expand Down
2 changes: 1 addition & 1 deletion selcukes-commons/src/main/resources/selcukes-logback.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ java.util.logging.FileHandler.level: FINE
# Limit the message that are printed on the console to INFO and above.
java.util.logging.ConsoleHandler.level: FINE
#java.util.logging.ConsoleHandler.formatter : java.util.logging.SimpleFormatter
java.util.logging.ConsoleHandler.formatter: io.github.selcukes.commons.logging.SelcukesLoggerFormatter
java.util.logging.ConsoleHandler.formatter: io.github.selcukes.commons.logging.SelcukesColorFormatter
2 changes: 1 addition & 1 deletion selcukes-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>selcukes-parent</artifactId>
<groupId>io.github.selcukes</groupId>
<version>0.0.7-SNAPSHOT</version>
<version>1.2.3-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,5 @@
public enum DeviceType {
BROWSER,
WINDOWS,
MOBILE;
MOBILE
}
6 changes: 3 additions & 3 deletions selcukes-junit/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@
<parent>
<artifactId>selcukes-parent</artifactId>
<groupId>io.github.selcukes</groupId>
<version>0.0.7-SNAPSHOT</version>
<version>1.2.3-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

<artifactId>selcukes-junit</artifactId>
<properties>
<junit.jupiter.version>5.7.0</junit.jupiter.version>
<cucumber.version>6.7.0</cucumber.version>
<junit.jupiter.version>5.7.2</junit.jupiter.version>
<cucumber.version>6.10.4</cucumber.version>
</properties>
<dependencies>
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,8 @@
package io.github.selcukes.junit.tests;

import io.cucumber.junit.platform.engine.Cucumber;
import org.junit.jupiter.api.Test;

@Cucumber
class CucumberRunner {
@Test
public void test() {

}
}
3 changes: 2 additions & 1 deletion selcukes-junit/src/test/resources/junit-platform.properties
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
junit.jupiter.extensions.autodetection.enabled=true
junit.jupiter.extensions.autodetection.enabled=true
cucumber.publish.quiet=true
2 changes: 1 addition & 1 deletion selcukes-junit/src/test/resources/sample.feature
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Feature: Sample Guess the word
Feature: Sample Guess the word Demo

@ex
Scenario: Maker starts a game
Expand Down
2 changes: 1 addition & 1 deletion selcukes-reports/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>selcukes-parent</artifactId>
<groupId>io.github.selcukes</groupId>
<version>0.0.7-SNAPSHOT</version>
<version>1.2.3-SNAPSHOT</version>
</parent>

<modelVersion>4.0.0</modelVersion>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@

public enum NotifierType {
SLACK,
TEAMS;
TEAMS
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@

public enum RecorderType {
MONTE,
FFMPEG;
FFMPEG
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,5 @@
public enum TestType {
CUCUMBER,
TESTNG,
JUNIT;
JUNIT
}
Original file line number Diff line number Diff line change
Expand Up @@ -118,12 +118,14 @@ public ScreenPlay sendNotification(String message) {
return this;
}


@Override
public void attachLogs() {
if (isAttachable()) {
String infoLogs = loggerListener.getLogRecords(Level.INFO)
.map(LogRecord::getMessage)
.collect(Collectors.joining("<br/> --> ", "<br/> Logs: <br/> --> ", "<br/> --End Of Logs--"));
.collect(Collectors.joining("</li><li>", "<ul><li> ",
"</li></ul><br/>"));
write(infoLogs);
}
stopReadingLogs();
Expand All @@ -134,7 +136,8 @@ public void attachLogs(Level level) {
if (isAttachable()) {
String logs = loggerListener.getLogRecords(level)
.map(LogRecord::getMessage)
.collect(Collectors.joining("<br/> --> ", "<br/> Logs: <br/> --> ", "<br/> --End Of Logs--"));
.collect(Collectors.joining("</li><li>", "<ul><li> ",
"</li></ul><br/>"));
write(logs);
}
stopReadingLogs();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,13 @@ protected String getFullHeight() {
}

protected int getFullWidth() {
return (int) executeJS("return window.innerWidth");
Long fullWidth = (Long) executeJS("return window.innerWidth");
return fullWidth.intValue();
}

protected int getWindowHeight() {
return (int) executeJS("return window.innerHeight");
Long windowHeight = (Long) executeJS("return window.innerHeight");
return windowHeight.intValue();
}


Expand Down
2 changes: 1 addition & 1 deletion selcukes-reports/src/main/resources/selcukes-logback.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ java.util.logging.FileHandler.level: FINE
# Limit the message that are printed on the console to INFO and above.
java.util.logging.ConsoleHandler.level: FINE
#java.util.logging.ConsoleHandler.formatter : java.util.logging.SimpleFormatter
java.util.logging.ConsoleHandler.formatter: io.github.selcukes.commons.logging.SelcukesLoggerFormatter
java.util.logging.ConsoleHandler.formatter: io.github.selcukes.commons.logging.SelcukesColorFormatter
2 changes: 1 addition & 1 deletion selcukes-reports/src/main/resources/selcukes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ isProxy: false
baseUrl:
remoteGridUrl:
videoRecording: false
ffmpegPath:
ffmpegPath: D:\\MyProject\support\video\ffmpeg\bin\
watermarkStatus: true
recorderType: FFMPEG
notification: false
Expand Down
2 changes: 1 addition & 1 deletion selcukes-server/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>selcukes-parent</artifactId>
<groupId>io.github.selcukes</groupId>
<version>0.0.7-SNAPSHOT</version>
<version>1.2.3-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>selcukes-server</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion selcukes-testng/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>selcukes-parent</artifactId>
<groupId>io.github.selcukes</groupId>
<version>0.0.7-SNAPSHOT</version>
<version>1.2.3-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>selcukes-testng</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,13 @@ public void perform() {
String features = getProperty("selcukes.features");
Pattern pattern = Pattern.compile("\\$\\{(.+?)\\}");
Matcher matcher = pattern.matcher(features);
StringBuffer stringBuffer = new StringBuffer();
StringBuilder stringBuilder = new StringBuilder();

while (matcher.find()) {
matcher.appendReplacement(stringBuffer, getProperty(matcher.group(1)));
matcher.appendReplacement(stringBuilder, getProperty(matcher.group(1)));
}
matcher.appendTail(stringBuffer);
features = stringBuffer.toString();
matcher.appendTail(stringBuilder);
features = stringBuilder.toString();

String glue = getProperty("selcukes.glue");
String tag = getProperty("selcukes.tags");
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
io.github.selcukes.testng.listeners.SuiteListener
io.github.selcukes.testng.listeners.SuiteListener
io.github.selcukes.testng.listeners.AnnotationTransformer
2 changes: 1 addition & 1 deletion webdriver-binaries/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>selcukes-parent</artifactId>
<groupId>io.github.selcukes</groupId>
<version>0.0.7-SNAPSHOT</version>
<version>1.2.3-SNAPSHOT</version>
</parent>

<modelVersion>4.0.0</modelVersion>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,10 @@ private static File uncompress(InputStream inputStream, File destination, Archiv
if (entry.isDirectory()) {
FileHelper.createDirectory(entryDestination);
} else {
FileHelper.createDirectory(entryDestination.getParentFile());
if (entryDestination.getParent() != null) {
FileHelper.createDirectory(entryDestination.getParentFile());
}

FileOutputStream fos = new FileOutputStream(entryDestination);
IOUtils.copy(inputStream, fos);
fos.close();
Expand Down
Loading

0 comments on commit 0fb35eb

Please sign in to comment.