Skip to content

Commit ed68555

Browse files
authored
Merge pull request #58 from ing-bank/fix/appiumTimeout
Updated Appium Timeout from seconds to Duration
2 parents be3634d + bec52e6 commit ed68555

File tree

14 files changed

+358
-383
lines changed

14 files changed

+358
-383
lines changed

Common/pom.xml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,17 @@
55
<parent>
66
<groupId>com.ing</groupId>
77
<artifactId>ingenious-playwright</artifactId>
8-
<version>2.1</version>
8+
<version>2.2</version>
99
</parent>
1010
<artifactId>Common</artifactId>
1111
<properties>
12-
<file.path.target.POM>${project.parent.basedir}\Resources\Engine\pom.xml</file.path.target.POM>
13-
<file.path.source.POM>${project.parent.basedir}\pom.xml</file.path.source.POM>
14-
<file.path.storyWriter.POM>${project.parent.basedir}\StoryWriter\pom.xml</file.path.storyWriter.POM>
15-
<file.path.datalib.POM>${project.parent.basedir}\Datalib\pom.xml</file.path.datalib.POM>
16-
<file.path.testdata.POM>${project.parent.basedir}\TestData - Csv\pom.xml</file.path.testdata.POM>
17-
<file.path.engine.POM>${project.parent.basedir}\Engine\pom.xml</file.path.engine.POM>
18-
<file.path.ide.POM>${project.parent.basedir}\IDE\pom.xml</file.path.ide.POM>
12+
<file.path.target.POM>${project.parent.basedir}${file.separator}Resources${file.separator}Engine${file.separator}pom.xml</file.path.target.POM>
13+
<file.path.source.POM>${project.parent.basedir}${file.separator}pom.xml</file.path.source.POM>
14+
<file.path.storyWriter.POM>${project.parent.basedir}${file.separator}StoryWriter${file.separator}pom.xml</file.path.storyWriter.POM>
15+
<file.path.datalib.POM>${project.parent.basedir}${file.separator}Datalib${file.separator}pom.xml</file.path.datalib.POM>
16+
<file.path.testdata.POM>${project.parent.basedir}${file.separator}TestData - Csv${file.separator}pom.xml</file.path.testdata.POM>
17+
<file.path.engine.POM>${project.parent.basedir}${file.separator}Engine${file.separator}pom.xml</file.path.engine.POM>
18+
<file.path.ide.POM>${project.parent.basedir}${file.separator}IDE${file.separator}pom.xml</file.path.ide.POM>
1919

2020
</properties>
2121
<build>

Common/src/main/java/com/ing/parent/createParentPOM.java

Lines changed: 29 additions & 93 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
import org.xml.sax.SAXException;
2626

2727
public class createParentPOM {
28+
2829
public static void main(String[] args) {
2930
try {
3031
// Get target pom and source pom for properties
@@ -42,29 +43,28 @@ public static void main(String[] args) {
4243
// Create a new document for the target pom.xml file
4344
Document targetDocument = createTargetDocument(targetPath);
4445

45-
// Remove content under dependencies and Repositories tag from target document
46-
removeExistingDependencies(targetDocument);
47-
removeExistingRepositories(targetDocument);
48-
removeExistingPluginRepositories(targetDocument);
49-
46+
System.out.println("TargetPath = " + targetPath);
47+
// Remove content under dependencies,repositories and pluginRepositories tag from target document
48+
removeExisting(targetDocument,"dependencies");
49+
removeExisting(targetDocument,"repositories");
50+
removeExisting(targetDocument,"pluginRepositories");
5051

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

5758
// Copy repositories and pluginRepositories
5859
if (args[i].contains("Engine")) {
59-
//copyRepositories(sourceDocument, targetDocument);
60-
//removeDuplicateRepositories(targetDocument);
61-
copyPluginRepositories(sourceDocument,targetDocument);
62-
removeDuplicatePluginRepositories(targetDocument);
60+
copyChilds(sourceDocument, targetDocument,"repositories");
61+
//removeDuplicates(targetDocument,"repositories","repository");
62+
copyChilds(sourceDocument, targetDocument,"pluginRepositories");
63+
//removeDuplicates(targetDocument,"pluginRepositories","pluginRepository");
6364
}
64-
6565
// Copy dependencies
66-
copyDependencies(sourceDocument, targetDocument);
67-
removeDuplicateDependencies(targetDocument);
66+
copyChilds(sourceDocument, targetDocument,"dependencies");
67+
removeDuplicates(targetDocument,"dependencies","dependency");
6868

6969
// Remove engine artifact
7070
removeEngineArtifact(targetDocument);
@@ -100,37 +100,21 @@ private static Document createSourceDocument(String sourcePath) throws ParserCon
100100
return document.parse(sourcePomPath);
101101
}
102102

103-
private static void removeExistingDependencies(Document targetDocument) {
104-
NodeList dependencyList = targetDocument.getElementsByTagName("dependencies");
103+
private static void removeExisting(Document targetDocument,String tagName) {
104+
NodeList dependencyList = targetDocument.getElementsByTagName(tagName);
105105
if (dependencyList.getLength() > 0) {
106106
Node dependenciesNode = dependencyList.item(0);
107107
while (dependenciesNode.hasChildNodes()) {
108108
dependenciesNode.removeChild(dependenciesNode.getFirstChild());
109109
}
110110
}
111111
}
112-
113-
private static void copyPluginRepositories(Document sourceDocument, Document targetDocument) {
114-
Node sourcePluginRepositoriesNode = getPluginRepositoriesNode(sourceDocument);
115-
Node targetPluginRepositoriesNode = getPluginRepositoriesNode(targetDocument);
116-
if (sourcePluginRepositoriesNode != null && targetPluginRepositoriesNode != null) {
117-
copyNodes(sourcePluginRepositoriesNode, targetPluginRepositoriesNode, targetDocument);
118-
}
119-
}
120112

121-
private static void copyRepositories(Document sourceDocument, Document targetDocument) {
122-
Node sourceRepositoriesNode = getRepositoriesNode(sourceDocument);
123-
Node targetRepositoriesNode = getRepositoriesNode(targetDocument);
124-
if (sourceRepositoriesNode != null && targetRepositoriesNode != null) {
125-
copyNodes(sourceRepositoriesNode, targetRepositoriesNode, targetDocument);
126-
}
127-
}
128-
129-
private static void copyDependencies(Document sourceDocument, Document targetDocument) {
130-
Node sourceDependenciesNode = getDependenciesNode(sourceDocument);
131-
Node targetDependenciesNode = getDependenciesNode(targetDocument);
132-
if (sourceDependenciesNode != null && targetDependenciesNode != null) {
133-
copyNodes(sourceDependenciesNode, targetDependenciesNode, targetDocument);
113+
private static void copyChilds(Document sourceDocument, Document targetDocument,String tagName) {
114+
Node sourceNode = getNodes(sourceDocument,tagName);
115+
Node targetNode = getNodes(targetDocument,tagName);
116+
if (sourceNode != null && targetNode != null) {
117+
copyNodes(sourceNode, targetNode, targetDocument);
134118
}
135119
}
136120

@@ -143,33 +127,13 @@ private static void copyNodes(Node sourceNode, Node targetNode, Document targetD
143127
}
144128
}
145129

146-
private static void removeDuplicateDependencies(Document targetDocument) {
147-
Node dependenciesNode = getDependenciesNode(targetDocument);
130+
private static void removeDuplicates(Document targetDocument, String tagName, String childTagName) {
131+
Node dependenciesNode = getNodes(targetDocument,tagName);
148132
if (dependenciesNode != null) {
149-
removeDuplicateNodes(dependenciesNode, "dependency");
150-
System.out.println("Duplicate dependency removed successfully");
133+
removeDuplicateNodes(dependenciesNode, childTagName);
134+
System.out.println("Duplicate removed successfully");
151135
} else {
152-
System.out.println("No <dependencies> section found.");
153-
}
154-
}
155-
156-
private static void removeDuplicateRepositories(Document targetDocument) {
157-
Node repositoriesNode = getRepositoriesNode(targetDocument);
158-
if (repositoriesNode != null) {
159-
removeDuplicateNodes(repositoriesNode, "repository");
160-
System.out.println("Duplicate repository removed successfully.");
161-
} else {
162-
System.out.println("No <repositories> section found.");
163-
}
164-
}
165-
166-
private static void removeDuplicatePluginRepositories(Document targetDocument) {
167-
Node pluginRepositoriesNode = getPluginRepositoriesNode(targetDocument);
168-
if (pluginRepositoriesNode != null) {
169-
removeDuplicateNodes(pluginRepositoriesNode, "pluginRepository");
170-
System.out.println("Duplicate plugin repository removed successfully.");
171-
} else {
172-
System.out.println("No <pluginRepositories> section found.");
136+
System.out.println("No section found.");
173137
}
174138
}
175139

@@ -214,18 +178,8 @@ private static void removeEngineArtifact(Document targetDocument) throws XPathEx
214178
}
215179
}
216180

217-
private static Node getDependenciesNode(Document doc) {
218-
NodeList nodeList = doc.getElementsByTagName("dependencies");
219-
return nodeList.getLength() > 0 ? nodeList.item(0) : null;
220-
}
221-
222-
private static Node getRepositoriesNode(Document doc) {
223-
NodeList nodeList = doc.getElementsByTagName("repositories");
224-
return nodeList.getLength() > 0 ? nodeList.item(0) : null;
225-
}
226-
227-
private static Node getPluginRepositoriesNode(Document doc) {
228-
NodeList nodeList = doc.getElementsByTagName("pluginRepositories");
181+
private static Node getNodes(Document doc, String tagName) {
182+
NodeList nodeList = doc.getElementsByTagName(tagName);
229183
return nodeList.getLength() > 0 ? nodeList.item(0) : null;
230184
}
231185

@@ -236,23 +190,5 @@ private static void saveXML(Document doc, File file) throws TransformerException
236190
StreamResult streamResult = new StreamResult(file);
237191
transformer.transform(domSource, streamResult);
238192
}
239-
240-
private static void removeExistingRepositories(Document targetDocument) {
241-
NodeList dependencyList = targetDocument.getElementsByTagName("repositories");
242-
if (dependencyList.getLength() > 0) {
243-
Node dependenciesNode = dependencyList.item(0);
244-
while (dependenciesNode.hasChildNodes()) {
245-
dependenciesNode.removeChild(dependenciesNode.getFirstChild());
246-
}
247-
}
248-
}
249-
private static void removeExistingPluginRepositories(Document targetDocument) {
250-
NodeList dependencyList = targetDocument.getElementsByTagName("pluginRepositories");
251-
if (dependencyList.getLength() > 0) {
252-
Node dependenciesNode = dependencyList.item(0);
253-
while (dependenciesNode.hasChildNodes()) {
254-
dependenciesNode.removeChild(dependenciesNode.getFirstChild());
255-
}
256-
}
257-
}
258-
}
193+
194+
}

Datalib/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<parent>
55
<groupId>com.ing</groupId>
66
<artifactId>ingenious-playwright</artifactId>
7-
<version>2.1</version>
7+
<version>2.2</version>
88
</parent>
99
<artifactId>ingenious-datalib</artifactId>
1010
<packaging>jar</packaging>

Datalib/src/main/java/com/ing/datalib/model/ProjectInfo.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,6 @@ public static ProjectInfo create(String name) {
178178
p.setTags(new ArrayList<>());
179179
p.setMeta(Meta.def());
180180
p.setData(new ArrayList<>());
181-
p.setVersion("1.3");
182181
return p;
183182
}
184183

Dist/pom.xml

Lines changed: 40 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<parent>
55
<groupId>com.ing</groupId>
66
<artifactId>ingenious-playwright</artifactId>
7-
<version>2.1</version>
7+
<version>2.2</version>
88
</parent>
99
<artifactId>Dist</artifactId>
1010
<packaging>pom</packaging>
@@ -79,6 +79,45 @@
7979
</execution>
8080
</executions>
8181
</plugin>
82+
<plugin>
83+
<artifactId>maven-resources-plugin</artifactId>
84+
<version>3.0.2</version>
85+
<executions>
86+
<execution>
87+
<id>copy-resources</id>
88+
<phase>install</phase>
89+
<goals>
90+
<goal>copy-resources</goal>
91+
</goals>
92+
<configuration>
93+
<outputDirectory>${setupDir}</outputDirectory>
94+
<includeEmptyDirs>true</includeEmptyDirs>
95+
<resources>
96+
<resource>
97+
<directory>${resourceDir}</directory>
98+
<filtering>true</filtering>
99+
<includes>
100+
<include>**/*.bat</include>
101+
<include>**/*.command</include>
102+
<include>**/*.txt</include>
103+
<include>**/*.md</include>
104+
</includes>
105+
</resource>
106+
<resource>
107+
<directory>${resourceDir}</directory>
108+
<filtering>false</filtering>
109+
<excludes>
110+
<exclude>**/*.bat</exclude>
111+
<exclude>**/*.command</exclude>
112+
<exclude>**/*.txt</exclude>
113+
<exclude>**/*.md</exclude>
114+
</excludes>
115+
</resource>
116+
</resources>
117+
</configuration>
118+
</execution>
119+
</executions>
120+
</plugin>
82121
</plugins>
83122
</build>
84123
</project>

Engine/pom.xml

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<parent>
66
<groupId>com.ing</groupId>
77
<artifactId>ingenious-playwright</artifactId>
8-
<version>2.1</version>
8+
<version>2.2</version>
99
</parent>
1010
<artifactId>ingenious-engine</artifactId>
1111
<packaging>jar</packaging>
@@ -256,14 +256,15 @@
256256
<version>${ibmmq.version}</version>
257257
</dependency>
258258
</dependencies>
259-
<!--
259+
260260
<repositories>
261-
<repository>
261+
<!-- <repository>
262262
<id>confluent</id>
263263
<url>https://packages.confluent.io/maven/</url>
264264
</repository>
265+
-->
265266
</repositories>
266-
-->
267+
267268
<build>
268269
<resources>
269270
<resource>
@@ -372,7 +373,6 @@
372373
</goals>
373374
<configuration>
374375
<outputDirectory>${setupDir}/Engine/src</outputDirectory>
375-
<overWriteIfNewer>true</overWriteIfNewer>
376376
<resources>
377377
<resource>
378378
<directory>${project.basedir}/src</directory>
@@ -388,7 +388,6 @@
388388
</goals>
389389
<configuration>
390390
<outputDirectory>${setupDir}/Engine</outputDirectory>
391-
<overWriteIfNewer>true</overWriteIfNewer>
392391
<resources>
393392
<resource>
394393
<directory>${project.basedir}</directory>

Engine/src/main/java/com/ing/engine/commands/browser/RequestFulfill.java

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,25 @@ public void RouteFulfillSetBody() {
5454
}
5555
}
5656

57+
@Action(object = ObjectType.BROWSER, desc = "Block Request", input = InputType.NO)
58+
public void RouteAbort() {
59+
try {
60+
Page.route(mockEndPoints.get(key), route -> {
61+
try {
62+
route.abort();
63+
Report.updateTestLog(Action, "Route Aborted", Status.DONE);
64+
} catch (Exception ex) {
65+
66+
Logger.getLogger(RequestFulfill.class.getName()).log(Level.SEVERE, null, ex);
67+
}
68+
});
69+
} catch (Exception ex) {
70+
Logger.getLogger(this.getClass().getName()).log(Level.OFF, null, ex);
71+
Report.updateTestLog(Action, "Error while aborting the Route :" + "\n" + ex.getMessage(), Status.DEBUG);
72+
throw new ActionException(ex);
73+
}
74+
}
75+
5776
private String handlePayloadorEndpoint(String data) throws FileNotFoundException {
5877
String payloadstring = data;
5978
payloadstring = handleDataSheetVariables(payloadstring);

Engine/src/main/java/com/ing/engine/commands/mobile/Basic.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ public void moveTo() {
170170

171171
private void setPageTimeOut(int sec) {
172172
try {
173-
mDriver.manage().timeouts().pageLoadTimeout(sec, TimeUnit.SECONDS);
173+
mDriver.manage().timeouts().pageLoadTimeout(Duration.ofSeconds(sec));
174174
} catch (Exception ex) {
175175
System.out.println("Couldn't set PageTimeOut to " + sec);
176176
}

IDE/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<parent>
55
<groupId>com.ing</groupId>
66
<artifactId>ingenious-playwright</artifactId>
7-
<version>2.1</version>
7+
<version>2.2</version>
88
</parent>
99
<artifactId>ingenious-ide</artifactId>
1010
<packaging>jar</packaging>

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
# INGenious Playwright Studio - Test Automation for Everyone
22

33
[![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)
4-
![Static Badge](https://img.shields.io/badge/Version-2.1-%23FF6200)
4+
![Static Badge](https://img.shields.io/badge/Version-2.2-%23FF6200)
55

66
--------------------------------------------------------------------
77

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

1010

1111

12-
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.
12+
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.
1313

1414
> [!NOTE]
1515
> 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.

0 commit comments

Comments
 (0)