Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions Common/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,17 @@
<parent>
<groupId>com.ing</groupId>
<artifactId>ingenious-playwright</artifactId>
<version>2.1</version>
<version>2.2</version>
</parent>
<artifactId>Common</artifactId>
<properties>
<file.path.target.POM>${project.parent.basedir}\Resources\Engine\pom.xml</file.path.target.POM>
<file.path.source.POM>${project.parent.basedir}\pom.xml</file.path.source.POM>
<file.path.storyWriter.POM>${project.parent.basedir}\StoryWriter\pom.xml</file.path.storyWriter.POM>
<file.path.datalib.POM>${project.parent.basedir}\Datalib\pom.xml</file.path.datalib.POM>
<file.path.testdata.POM>${project.parent.basedir}\TestData - Csv\pom.xml</file.path.testdata.POM>
<file.path.engine.POM>${project.parent.basedir}\Engine\pom.xml</file.path.engine.POM>
<file.path.ide.POM>${project.parent.basedir}\IDE\pom.xml</file.path.ide.POM>
<file.path.target.POM>${project.parent.basedir}${file.separator}Resources${file.separator}Engine${file.separator}pom.xml</file.path.target.POM>
<file.path.source.POM>${project.parent.basedir}${file.separator}pom.xml</file.path.source.POM>
<file.path.storyWriter.POM>${project.parent.basedir}${file.separator}StoryWriter${file.separator}pom.xml</file.path.storyWriter.POM>
<file.path.datalib.POM>${project.parent.basedir}${file.separator}Datalib${file.separator}pom.xml</file.path.datalib.POM>
<file.path.testdata.POM>${project.parent.basedir}${file.separator}TestData - Csv${file.separator}pom.xml</file.path.testdata.POM>
<file.path.engine.POM>${project.parent.basedir}${file.separator}Engine${file.separator}pom.xml</file.path.engine.POM>
<file.path.ide.POM>${project.parent.basedir}${file.separator}IDE${file.separator}pom.xml</file.path.ide.POM>

</properties>
<build>
Expand Down
122 changes: 29 additions & 93 deletions Common/src/main/java/com/ing/parent/createParentPOM.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import org.xml.sax.SAXException;

public class createParentPOM {

public static void main(String[] args) {
try {
// Get target pom and source pom for properties
Expand All @@ -42,29 +43,28 @@ public static void main(String[] args) {
// Create a new document for the target pom.xml file
Document targetDocument = createTargetDocument(targetPath);

// Remove content under dependencies and Repositories tag from target document
removeExistingDependencies(targetDocument);
removeExistingRepositories(targetDocument);
removeExistingPluginRepositories(targetDocument);

System.out.println("TargetPath = " + targetPath);
// Remove content under dependencies,repositories and pluginRepositories tag from target document
removeExisting(targetDocument,"dependencies");
removeExisting(targetDocument,"repositories");
removeExisting(targetDocument,"pluginRepositories");

// Copy dependencies from modules pom to target pom
for (int i = 2; i < args.length; i++) {
String sourcePath = args[i];
System.out.println("------------"+sourcePath);
System.out.println("------------" + sourcePath);
Document sourceDocument = createSourceDocument(sourcePath);

// Copy repositories and pluginRepositories
if (args[i].contains("Engine")) {
//copyRepositories(sourceDocument, targetDocument);
//removeDuplicateRepositories(targetDocument);
copyPluginRepositories(sourceDocument,targetDocument);
removeDuplicatePluginRepositories(targetDocument);
copyChilds(sourceDocument, targetDocument,"repositories");
//removeDuplicates(targetDocument,"repositories","repository");
copyChilds(sourceDocument, targetDocument,"pluginRepositories");
//removeDuplicates(targetDocument,"pluginRepositories","pluginRepository");
}

// Copy dependencies
copyDependencies(sourceDocument, targetDocument);
removeDuplicateDependencies(targetDocument);
copyChilds(sourceDocument, targetDocument,"dependencies");
removeDuplicates(targetDocument,"dependencies","dependency");

// Remove engine artifact
removeEngineArtifact(targetDocument);
Expand Down Expand Up @@ -100,37 +100,21 @@ private static Document createSourceDocument(String sourcePath) throws ParserCon
return document.parse(sourcePomPath);
}

private static void removeExistingDependencies(Document targetDocument) {
NodeList dependencyList = targetDocument.getElementsByTagName("dependencies");
private static void removeExisting(Document targetDocument,String tagName) {
NodeList dependencyList = targetDocument.getElementsByTagName(tagName);
if (dependencyList.getLength() > 0) {
Node dependenciesNode = dependencyList.item(0);
while (dependenciesNode.hasChildNodes()) {
dependenciesNode.removeChild(dependenciesNode.getFirstChild());
}
}
}

private static void copyPluginRepositories(Document sourceDocument, Document targetDocument) {
Node sourcePluginRepositoriesNode = getPluginRepositoriesNode(sourceDocument);
Node targetPluginRepositoriesNode = getPluginRepositoriesNode(targetDocument);
if (sourcePluginRepositoriesNode != null && targetPluginRepositoriesNode != null) {
copyNodes(sourcePluginRepositoriesNode, targetPluginRepositoriesNode, targetDocument);
}
}

private static void copyRepositories(Document sourceDocument, Document targetDocument) {
Node sourceRepositoriesNode = getRepositoriesNode(sourceDocument);
Node targetRepositoriesNode = getRepositoriesNode(targetDocument);
if (sourceRepositoriesNode != null && targetRepositoriesNode != null) {
copyNodes(sourceRepositoriesNode, targetRepositoriesNode, targetDocument);
}
}

private static void copyDependencies(Document sourceDocument, Document targetDocument) {
Node sourceDependenciesNode = getDependenciesNode(sourceDocument);
Node targetDependenciesNode = getDependenciesNode(targetDocument);
if (sourceDependenciesNode != null && targetDependenciesNode != null) {
copyNodes(sourceDependenciesNode, targetDependenciesNode, targetDocument);
private static void copyChilds(Document sourceDocument, Document targetDocument,String tagName) {
Node sourceNode = getNodes(sourceDocument,tagName);
Node targetNode = getNodes(targetDocument,tagName);
if (sourceNode != null && targetNode != null) {
copyNodes(sourceNode, targetNode, targetDocument);
}
}

Expand All @@ -143,33 +127,13 @@ private static void copyNodes(Node sourceNode, Node targetNode, Document targetD
}
}

private static void removeDuplicateDependencies(Document targetDocument) {
Node dependenciesNode = getDependenciesNode(targetDocument);
private static void removeDuplicates(Document targetDocument, String tagName, String childTagName) {
Node dependenciesNode = getNodes(targetDocument,tagName);
if (dependenciesNode != null) {
removeDuplicateNodes(dependenciesNode, "dependency");
System.out.println("Duplicate dependency removed successfully");
removeDuplicateNodes(dependenciesNode, childTagName);
System.out.println("Duplicate removed successfully");
} else {
System.out.println("No <dependencies> section found.");
}
}

private static void removeDuplicateRepositories(Document targetDocument) {
Node repositoriesNode = getRepositoriesNode(targetDocument);
if (repositoriesNode != null) {
removeDuplicateNodes(repositoriesNode, "repository");
System.out.println("Duplicate repository removed successfully.");
} else {
System.out.println("No <repositories> section found.");
}
}

private static void removeDuplicatePluginRepositories(Document targetDocument) {
Node pluginRepositoriesNode = getPluginRepositoriesNode(targetDocument);
if (pluginRepositoriesNode != null) {
removeDuplicateNodes(pluginRepositoriesNode, "pluginRepository");
System.out.println("Duplicate plugin repository removed successfully.");
} else {
System.out.println("No <pluginRepositories> section found.");
System.out.println("No section found.");
}
}

Expand Down Expand Up @@ -214,18 +178,8 @@ private static void removeEngineArtifact(Document targetDocument) throws XPathEx
}
}

private static Node getDependenciesNode(Document doc) {
NodeList nodeList = doc.getElementsByTagName("dependencies");
return nodeList.getLength() > 0 ? nodeList.item(0) : null;
}

private static Node getRepositoriesNode(Document doc) {
NodeList nodeList = doc.getElementsByTagName("repositories");
return nodeList.getLength() > 0 ? nodeList.item(0) : null;
}

private static Node getPluginRepositoriesNode(Document doc) {
NodeList nodeList = doc.getElementsByTagName("pluginRepositories");
private static Node getNodes(Document doc, String tagName) {
NodeList nodeList = doc.getElementsByTagName(tagName);
return nodeList.getLength() > 0 ? nodeList.item(0) : null;
}

Expand All @@ -236,23 +190,5 @@ private static void saveXML(Document doc, File file) throws TransformerException
StreamResult streamResult = new StreamResult(file);
transformer.transform(domSource, streamResult);
}

private static void removeExistingRepositories(Document targetDocument) {
NodeList dependencyList = targetDocument.getElementsByTagName("repositories");
if (dependencyList.getLength() > 0) {
Node dependenciesNode = dependencyList.item(0);
while (dependenciesNode.hasChildNodes()) {
dependenciesNode.removeChild(dependenciesNode.getFirstChild());
}
}
}
private static void removeExistingPluginRepositories(Document targetDocument) {
NodeList dependencyList = targetDocument.getElementsByTagName("pluginRepositories");
if (dependencyList.getLength() > 0) {
Node dependenciesNode = dependencyList.item(0);
while (dependenciesNode.hasChildNodes()) {
dependenciesNode.removeChild(dependenciesNode.getFirstChild());
}
}
}
}

}
2 changes: 1 addition & 1 deletion Datalib/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>com.ing</groupId>
<artifactId>ingenious-playwright</artifactId>
<version>2.1</version>
<version>2.2</version>
</parent>
<artifactId>ingenious-datalib</artifactId>
<packaging>jar</packaging>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,6 @@ public static ProjectInfo create(String name) {
p.setTags(new ArrayList<>());
p.setMeta(Meta.def());
p.setData(new ArrayList<>());
p.setVersion("1.3");
return p;
}

Expand Down
41 changes: 40 additions & 1 deletion Dist/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>com.ing</groupId>
<artifactId>ingenious-playwright</artifactId>
<version>2.1</version>
<version>2.2</version>
</parent>
<artifactId>Dist</artifactId>
<packaging>pom</packaging>
Expand Down Expand Up @@ -79,6 +79,45 @@
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<version>3.0.2</version>
<executions>
<execution>
<id>copy-resources</id>
<phase>install</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<outputDirectory>${setupDir}</outputDirectory>
<includeEmptyDirs>true</includeEmptyDirs>
<resources>
<resource>
<directory>${resourceDir}</directory>
<filtering>true</filtering>
<includes>
<include>**/*.bat</include>
<include>**/*.command</include>
<include>**/*.txt</include>
<include>**/*.md</include>
</includes>
</resource>
<resource>
<directory>${resourceDir}</directory>
<filtering>false</filtering>
<excludes>
<exclude>**/*.bat</exclude>
<exclude>**/*.command</exclude>
<exclude>**/*.txt</exclude>
<exclude>**/*.md</exclude>
</excludes>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
11 changes: 5 additions & 6 deletions Engine/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>com.ing</groupId>
<artifactId>ingenious-playwright</artifactId>
<version>2.1</version>
<version>2.2</version>
</parent>
<artifactId>ingenious-engine</artifactId>
<packaging>jar</packaging>
Expand Down Expand Up @@ -256,14 +256,15 @@
<version>${ibmmq.version}</version>
</dependency>
</dependencies>
<!--

<repositories>
<repository>
<!-- <repository>
<id>confluent</id>
<url>https://packages.confluent.io/maven/</url>
</repository>
-->
</repositories>
-->

<build>
<resources>
<resource>
Expand Down Expand Up @@ -372,7 +373,6 @@
</goals>
<configuration>
<outputDirectory>${setupDir}/Engine/src</outputDirectory>
<overWriteIfNewer>true</overWriteIfNewer>
<resources>
<resource>
<directory>${project.basedir}/src</directory>
Expand All @@ -388,7 +388,6 @@
</goals>
<configuration>
<outputDirectory>${setupDir}/Engine</outputDirectory>
<overWriteIfNewer>true</overWriteIfNewer>
<resources>
<resource>
<directory>${project.basedir}</directory>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,25 @@ public void RouteFulfillSetBody() {
}
}

@Action(object = ObjectType.BROWSER, desc = "Block Request", input = InputType.NO)
public void RouteAbort() {
try {
Page.route(mockEndPoints.get(key), route -> {
try {
route.abort();
Report.updateTestLog(Action, "Route Aborted", Status.DONE);
} catch (Exception ex) {

Logger.getLogger(RequestFulfill.class.getName()).log(Level.SEVERE, null, ex);
}
});
} catch (Exception ex) {
Logger.getLogger(this.getClass().getName()).log(Level.OFF, null, ex);
Report.updateTestLog(Action, "Error while aborting the Route :" + "\n" + ex.getMessage(), Status.DEBUG);
throw new ActionException(ex);
}
}

private String handlePayloadorEndpoint(String data) throws FileNotFoundException {
String payloadstring = data;
payloadstring = handleDataSheetVariables(payloadstring);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ public void moveTo() {

private void setPageTimeOut(int sec) {
try {
mDriver.manage().timeouts().pageLoadTimeout(sec, TimeUnit.SECONDS);
mDriver.manage().timeouts().pageLoadTimeout(Duration.ofSeconds(sec));
} catch (Exception ex) {
System.out.println("Couldn't set PageTimeOut to " + sec);
}
Expand Down
2 changes: 1 addition & 1 deletion IDE/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>com.ing</groupId>
<artifactId>ingenious-playwright</artifactId>
<version>2.1</version>
<version>2.2</version>
</parent>
<artifactId>ingenious-ide</artifactId>
<packaging>jar</packaging>
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
# INGenious Playwright Studio - Test Automation for Everyone

[![Build INGenious Source Code](https://github.com/ing-bank/INGenious/actions/workflows/maven.yml/badge.svg)](https://github.com/ing-bank/INGenious/actions/workflows/maven.yml)
![Static Badge](https://img.shields.io/badge/Version-2.1-%23FF6200)
![Static Badge](https://img.shields.io/badge/Version-2.2-%23FF6200)

--------------------------------------------------------------------

<span style="color:#FF6200;width:100px">**INGenious**</span> enables easy and effective test automation for **everyone.**



Developed and perfected by <span style="color:#FF6200;width:100px">**ING Bank**</span> for over 4 years of real-world usage, **INGenious** is now open-source and available to everyone. Designed to simplify and streamline test automation, this robust solution empowers teams of all sizes to achieve efficient, high-quality testing. By joining the global testing community, ING aims to collaborate, innovate, and elevate automated testing together.
Developed and perfected by <span style="color:#FF6200;width:100px">**ING Bank**</span> for over 5 years of real-world usage, **INGenious** is now open-source and available to everyone. Designed to simplify and streamline test automation, this robust solution empowers teams of all sizes to achieve efficient, high-quality testing. By joining the global testing community, ING aims to collaborate, innovate, and elevate automated testing together.

> [!NOTE]
> It provides an easy and simple way to create highly reliable automated tests. It leverages the power of __Playwright-Java__ and combines it with a user-friendly IDE which makes it a highly effective solution.
Expand Down
Loading