Skip to content

Commit 994933d

Browse files
committed
Merge branch 'release/v1.13.0'
2 parents ad99f6b + dd63939 commit 994933d

File tree

20 files changed

+1262
-233
lines changed

20 files changed

+1262
-233
lines changed

.mergify.yml

Lines changed: 20 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
1-
pull_request_rules:
2-
- name: "rebase unreviewed non-release PRs"
1+
queue_rules:
2+
- name: default
33
conditions:
4-
- "head~=^(?!(release|hotfix)).*$"
5-
- "#approved-reviews-by=0"
4+
- "#approved-reviews-by>=1"
65
- "#changes-requested-reviews-by=0"
76
- "-draft"
7+
8+
pull_request_rules:
9+
- name: "rebase non-release PRs"
10+
conditions:
11+
- "head~=^(?!(release|hotfix)).*$"
812
actions:
913
rebase:
1014

@@ -13,37 +17,38 @@ pull_request_rules:
1317
- "head~=^(?!(release|hotfix)).*$"
1418
- "#approved-reviews-by>=1"
1519
- "#changes-requested-reviews-by=0"
20+
- "#commits-behind=0"
1621
- "-draft"
1722
- "check-success=SonarCloud Code Analysis"
1823
actions:
19-
merge:
20-
strict: true
21-
strict_method: rebase
22-
method: merge
24+
queue:
25+
name: default
26+
update_method: rebase
2327

2428
- name: "merge non-release without-SonarCloud-but-from-dependabot PRs with strict rebase"
2529
conditions:
2630
- "head~=^(?!(release|hotfix)).*$"
2731
- "#approved-reviews-by>=1"
2832
- "#changes-requested-reviews-by=0"
33+
- "#commits-behind=0"
2934
- "-draft"
3035
- "author=dependabot[bot]"
3136
actions:
32-
merge:
33-
strict: true
34-
strict_method: rebase
35-
method: merge
37+
queue:
38+
name: default
39+
update_method: rebase
3640

3741
- name: "merge release PRs with strict merge"
3842
conditions:
3943
- "head~=^(release|hotfix).*$"
4044
- "#approved-reviews-by>=1"
4145
- "#changes-requested-reviews-by=0"
46+
- "#commits-behind=0"
4247
- "-draft"
4348
actions:
44-
merge:
45-
strict: true
46-
method: merge
49+
queue:
50+
name: default
51+
update_method: rebase
4752

4853
- name: "delete PR branches after merge"
4954
conditions:

CHANGELOG.md

Lines changed: 32 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,42 @@ Table of Contents
2020
[TOC]
2121

2222

23+
2324
[Unreleased]
2425
------------
2526

2627
### Breaking Changes
2728

29+
### Bug Fixes
30+
31+
### New Features
32+
33+
### Improvements
34+
35+
36+
--------------------------------------------------------------------------------
37+
38+
[1.13.0] (2022-03-08)
39+
---------------------
40+
41+
### Breaking Changes
42+
43+
* Update Selenium version to > 4.0, this cause that you need also to update your Selenium version.
44+
45+
### Bug Fixes
46+
47+
* AutocheckingRecheckDriver now only calls `Recheck#cap()` if browser is closed.
48+
49+
### Improvements
50+
51+
* Update dependencies to fix bugs and security issues.
52+
53+
54+
[1.12.0] (2021-06-24)
55+
---------------------
56+
57+
### Breaking Changes
58+
2859
* Since 01.12.2020 this project is owned and developed by [UBS Hainer GmbH](https://ubs-hainer.com/).
2960

3061
### Bug Fixes
@@ -38,14 +69,13 @@ Table of Contents
3869
* Calling `driver.switchTo().window( name )` will now perform a check when using a `AutocheckingRecheckDriver`.
3970
* Add Option to delay autochecking with AutocheckingRecheckDriver
4071
* AutocheckingRecheckDriver now allows manual checks: `driver.check( final String action )`
72+
* Upgrade to recheck version 1.12.0
4173

4274
### Improvements
4375

4476
* Always override the system metadata (i.e. on "architecture"), so that we do not end up with mixed info.
4577
* Since `retestId` is now created deterministically, we can reference it before we even have a Golden Master. So if you know what the `retestId` will gona be (e.g. your element has a specific text, HTML ID or you have your own `RetestIdProvider`), you can already use it in the test.
4678

47-
--------------------------------------------------------------------------------
48-
4979

5080
[1.11.1] (2020-07-08)
5181
---------------------

pom.xml

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
<groupId>de.retest</groupId>
66
<artifactId>recheck-web</artifactId>
7-
<version>1.12.0</version>
7+
<version>1.13.0</version>
88

99
<name>recheck - web</name>
1010
<description>recheck for web apps.</description>
@@ -46,9 +46,9 @@
4646
<project.resources.sourceEncoding>UTF-8</project.resources.sourceEncoding>
4747
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
4848
<maven.surefire.and.failsafe.version>3.0.0-M5</maven.surefire.and.failsafe.version>
49-
<mockito.version>3.10.0</mockito.version>
50-
<logback.version>1.2.3</logback.version>
51-
<selenium.version>3.141.59</selenium.version>
49+
<mockito.version>4.3.1</mockito.version>
50+
<logback.version>1.2.11</logback.version>
51+
<selenium.version>4.1.2</selenium.version>
5252
</properties>
5353

5454
<distributionManagement>
@@ -77,15 +77,15 @@
7777
<dependency>
7878
<groupId>de.retest</groupId>
7979
<artifactId>recheck</artifactId>
80-
<version>1.12.0</version>
80+
<version>1.13.0</version>
8181
</dependency>
8282

8383
<!-- transitively loaded via Selenium -->
8484
<!-- see https://github.com/mockito/mockito/issues/1606 -->
8585
<dependency>
8686
<groupId>net.bytebuddy</groupId>
8787
<artifactId>byte-buddy</artifactId>
88-
<version>1.11.1</version>
88+
<version>1.12.8</version>
8989
</dependency>
9090

9191
<dependency>
@@ -103,36 +103,36 @@
103103
<dependency>
104104
<groupId>org.yaml</groupId>
105105
<artifactId>snakeyaml</artifactId>
106-
<version>1.28</version>
106+
<version>1.30</version>
107107
</dependency>
108108

109109
<!-- test dependencies -->
110110

111111
<dependency>
112112
<groupId>org.junit.jupiter</groupId>
113113
<artifactId>junit-jupiter</artifactId>
114-
<version>5.7.2</version>
114+
<version>5.8.2</version>
115115
<scope>test</scope>
116116
</dependency>
117117

118118
<dependency>
119119
<groupId>org.assertj</groupId>
120120
<artifactId>assertj-core</artifactId>
121-
<version>3.19.0</version>
121+
<version>3.22.0</version>
122122
<scope>test</scope>
123123
</dependency>
124124

125125
<dependency>
126126
<groupId>de.retest</groupId>
127127
<artifactId>recheck-junit-jupiter-extension</artifactId>
128-
<version>1.11.0</version>
128+
<version>1.12.0</version>
129129
<scope>test</scope>
130130
</dependency>
131131

132132
<dependency>
133133
<groupId>de.retest</groupId>
134134
<artifactId>recheck-junit-4-extension</artifactId>
135-
<version>1.11.0</version>
135+
<version>1.12.0</version>
136136
<scope>test</scope>
137137
</dependency>
138138

@@ -153,14 +153,14 @@
153153
<dependency>
154154
<groupId>io.github.netmikey.logunit</groupId>
155155
<artifactId>logunit-core</artifactId>
156-
<version>1.1.0</version>
156+
<version>1.1.3</version>
157157
<scope>test</scope>
158158
</dependency>
159159

160160
<dependency>
161161
<groupId>io.github.netmikey.logunit</groupId>
162162
<artifactId>logunit-logback</artifactId>
163-
<version>1.1.0</version>
163+
<version>1.1.3</version>
164164
<scope>test</scope>
165165
</dependency>
166166

@@ -181,7 +181,7 @@
181181
<dependency>
182182
<groupId>com.approvaltests</groupId>
183183
<artifactId>approvaltests</artifactId>
184-
<version>11.6.0</version>
184+
<version>14.0.0</version>
185185
<scope>test</scope>
186186
</dependency>
187187
</dependencies>
@@ -190,7 +190,7 @@
190190
<plugins>
191191
<plugin>
192192
<artifactId>maven-compiler-plugin</artifactId>
193-
<version>3.8.1</version>
193+
<version>3.10.0</version>
194194
<configuration>
195195
<source>${java.version}</source>
196196
<target>${java.version}</target>
@@ -238,7 +238,7 @@
238238
<plugin>
239239
<groupId>org.apache.maven.plugins</groupId>
240240
<artifactId>maven-jar-plugin</artifactId>
241-
<version>3.2.0</version>
241+
<version>3.2.2</version>
242242
<configuration>
243243
<archive>
244244
<manifest>
@@ -255,7 +255,7 @@
255255
<plugin>
256256
<groupId>com.amashchenko.maven.plugin</groupId>
257257
<artifactId>gitflow-maven-plugin</artifactId>
258-
<version>1.16.0</version>
258+
<version>1.18.0</version>
259259
<configuration>
260260
<gitFlowConfig>
261261
<productionBranch>main</productionBranch>
@@ -290,7 +290,7 @@
290290
<plugin>
291291
<groupId>org.apache.maven.plugins</groupId>
292292
<artifactId>maven-javadoc-plugin</artifactId>
293-
<version>3.3.0</version>
293+
<version>3.3.2</version>
294294
<executions>
295295
<execution>
296296
<id>bundle-javadoc</id>
@@ -338,7 +338,7 @@
338338
<plugin>
339339
<groupId>org.apache.maven.plugins</groupId>
340340
<artifactId>maven-enforcer-plugin</artifactId>
341-
<version>3.0.0-M3</version>
341+
<version>3.0.0</version>
342342
<executions>
343343
<execution>
344344
<id>enforce-maven</id>
@@ -359,7 +359,7 @@
359359
<plugin>
360360
<groupId>org.sonatype.plugins</groupId>
361361
<artifactId>nexus-staging-maven-plugin</artifactId>
362-
<version>1.6.8</version>
362+
<version>1.6.12</version>
363363
<extensions>true</extensions>
364364
<configuration>
365365
<nexusUrl>https://oss.sonatype.org/</nexusUrl>

src/main/java/de/retest/web/RecheckSeleniumAdapter.java

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ private Set<RootElement> convert( final WebDriver driver, final RemoteWebElement
165165
@SuppressWarnings( "unchecked" )
166166
// [["//html[1]", {tagName=html, ...}], ["//html[1]/body[1]", {tagName=body, ...}]]
167167
final List<List<Object>> tagMapping = (List<List<Object>>) result;
168-
debug( tagMapping );
168+
debugLogPseudoElements( tagMapping );
169169
final RootElement lastChecked = convert( tagMapping, driver.getCurrentUrl(), driver.getTitle(), screenshot );
170170

171171
final FrameConverter frameConverter = new FrameConverter( getQueryJS(), retestIdProvider, defaultValueFinder );
@@ -180,9 +180,11 @@ private Set<RootElement> convert( final WebDriver driver, final RemoteWebElement
180180
return Collections.singleton( lastChecked );
181181
}
182182

183-
private void debug( final List<List<Object>> tagMapping ) {
184-
tagMapping.stream().filter( entry -> ((String) entry.get(0)).contains( "pseudo" ) )
185-
.forEach( entry -> logger.warn( "{} | {}", entry.get(0), entry.get(1) ) );
183+
private void debugLogPseudoElements( final List<List<Object>> tagMapping ) {
184+
if ( logger.isDebugEnabled() ) {
185+
tagMapping.stream().filter( entry -> ((String) entry.get( 0 )).contains( "pseudo" ) )
186+
.forEach( entry -> logger.debug( "{} | {}", entry.get( 0 ), entry.get( 1 ) ) );
187+
}
186188
}
187189

188190
public RootElement convert( final List<List<Object>> tagMapping, final String url, final String title,

src/main/java/de/retest/web/selenium/AutocheckingRecheckDriver.java

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
package de.retest.web.selenium;
22

33
import org.openqa.selenium.By;
4+
import org.openqa.selenium.NoSuchSessionException;
45
import org.openqa.selenium.WebDriver;
56
import org.openqa.selenium.WebElement;
67
import org.openqa.selenium.remote.RemoteWebDriver;
78

9+
import de.retest.recheck.Recheck;
810
import de.retest.recheck.RecheckLifecycle;
911
import de.retest.recheck.RecheckOptions;
1012
import de.retest.web.RecheckWebImpl;
@@ -15,6 +17,8 @@
1517
* starting with {@link WebDriver#get(String)}). Consequently, you can omit using a {@code Recheck} instance such as
1618
* {@code RecheckImpl} or {@code RecheckWebImpl} instance. It utilizes the given {@link AutocheckingCheckNamingStrategy}
1719
* to create names for the checks.
20+
*
21+
* Also handles {@link Recheck#startTest()}, {@link Recheck#capTest()} and on browser quit {@link Recheck#cap()}.
1822
*/
1923
public class AutocheckingRecheckDriver extends UnbreakableDriver implements RecheckLifecycle {
2024

@@ -97,21 +101,27 @@ public void get( final String url ) {
97101

98102
@Override
99103
public void close() {
100-
// Is this sensible? What about tests using separate sessions?
101-
cap();
102104
super.close();
105+
ifBrowserIsNotRunning( this::cap ); // cap if close window quit the driver
103106
}
104107

105108
@Override
106109
public void quit() {
107110
try {
108-
// Is this sensible? What about tests using separate sessions?
109111
cap();
110112
} finally {
111113
super.quit();
112114
}
113115
}
114116

117+
private void ifBrowserIsNotRunning( final Runnable call ) {
118+
try {
119+
super.getWindowHandles();
120+
} catch ( NullPointerException | NoSuchSessionException e ) {
121+
call.run();
122+
}
123+
}
124+
115125
@Override
116126
protected WebElement wrap( final WebElement element ) {
117127
return AutocheckingWebElement.of( element, this );

src/main/java/de/retest/web/selenium/AutocheckingTargetLocator.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import org.openqa.selenium.WebElement;
66

77
import lombok.RequiredArgsConstructor;
8+
import org.openqa.selenium.WindowType;
89

910
@RequiredArgsConstructor
1011
public class AutocheckingTargetLocator implements WebDriver.TargetLocator {
@@ -39,6 +40,11 @@ public WebDriver window( final String nameOrHandle ) {
3940
return driver;
4041
}
4142

43+
@Override
44+
public WebDriver newWindow(WindowType typeHint) {
45+
return delegate.newWindow(typeHint);
46+
}
47+
4248
@Override
4349
public WebDriver defaultContent() {
4450
return delegate.defaultContent();

src/main/java/de/retest/web/selenium/AutocheckingWebElement.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
import org.openqa.selenium.WrapsDriver;
1515
import org.openqa.selenium.interactions.Coordinates;
1616
import org.openqa.selenium.interactions.Locatable;
17-
import org.openqa.selenium.internal.WrapsElement;
17+
import org.openqa.selenium.WrapsElement;
1818

1919
import lombok.AccessLevel;
2020
import lombok.RequiredArgsConstructor;

0 commit comments

Comments
 (0)