Skip to content

Commit

Permalink
Merge branch 'release/v1.13.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
rebazer committed Mar 8, 2022
2 parents ad99f6b + dd63939 commit 994933d
Show file tree
Hide file tree
Showing 20 changed files with 1,262 additions and 233 deletions.
35 changes: 20 additions & 15 deletions .mergify.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
pull_request_rules:
- name: "rebase unreviewed non-release PRs"
queue_rules:
- name: default
conditions:
- "head~=^(?!(release|hotfix)).*$"
- "#approved-reviews-by=0"
- "#approved-reviews-by>=1"
- "#changes-requested-reviews-by=0"
- "-draft"

pull_request_rules:
- name: "rebase non-release PRs"
conditions:
- "head~=^(?!(release|hotfix)).*$"
actions:
rebase:

Expand All @@ -13,37 +17,38 @@ pull_request_rules:
- "head~=^(?!(release|hotfix)).*$"
- "#approved-reviews-by>=1"
- "#changes-requested-reviews-by=0"
- "#commits-behind=0"
- "-draft"
- "check-success=SonarCloud Code Analysis"
actions:
merge:
strict: true
strict_method: rebase
method: merge
queue:
name: default
update_method: rebase

- name: "merge non-release without-SonarCloud-but-from-dependabot PRs with strict rebase"
conditions:
- "head~=^(?!(release|hotfix)).*$"
- "#approved-reviews-by>=1"
- "#changes-requested-reviews-by=0"
- "#commits-behind=0"
- "-draft"
- "author=dependabot[bot]"
actions:
merge:
strict: true
strict_method: rebase
method: merge
queue:
name: default
update_method: rebase

- name: "merge release PRs with strict merge"
conditions:
- "head~=^(release|hotfix).*$"
- "#approved-reviews-by>=1"
- "#changes-requested-reviews-by=0"
- "#commits-behind=0"
- "-draft"
actions:
merge:
strict: true
method: merge
queue:
name: default
update_method: rebase

- name: "delete PR branches after merge"
conditions:
Expand Down
34 changes: 32 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,42 @@ Table of Contents
[TOC]



[Unreleased]
------------

### Breaking Changes

### Bug Fixes

### New Features

### Improvements


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

[1.13.0] (2022-03-08)
---------------------

### Breaking Changes

* Update Selenium version to > 4.0, this cause that you need also to update your Selenium version.

### Bug Fixes

* AutocheckingRecheckDriver now only calls `Recheck#cap()` if browser is closed.

### Improvements

* Update dependencies to fix bugs and security issues.


[1.12.0] (2021-06-24)
---------------------

### Breaking Changes

* Since 01.12.2020 this project is owned and developed by [UBS Hainer GmbH](https://ubs-hainer.com/).

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

### Improvements

* Always override the system metadata (i.e. on "architecture"), so that we do not end up with mixed info.
* 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.

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


[1.11.1] (2020-07-08)
---------------------
Expand Down
40 changes: 20 additions & 20 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<groupId>de.retest</groupId>
<artifactId>recheck-web</artifactId>
<version>1.12.0</version>
<version>1.13.0</version>

<name>recheck - web</name>
<description>recheck for web apps.</description>
Expand Down Expand Up @@ -46,9 +46,9 @@
<project.resources.sourceEncoding>UTF-8</project.resources.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<maven.surefire.and.failsafe.version>3.0.0-M5</maven.surefire.and.failsafe.version>
<mockito.version>3.10.0</mockito.version>
<logback.version>1.2.3</logback.version>
<selenium.version>3.141.59</selenium.version>
<mockito.version>4.3.1</mockito.version>
<logback.version>1.2.11</logback.version>
<selenium.version>4.1.2</selenium.version>
</properties>

<distributionManagement>
Expand Down Expand Up @@ -77,15 +77,15 @@
<dependency>
<groupId>de.retest</groupId>
<artifactId>recheck</artifactId>
<version>1.12.0</version>
<version>1.13.0</version>
</dependency>

<!-- transitively loaded via Selenium -->
<!-- see https://github.com/mockito/mockito/issues/1606 -->
<dependency>
<groupId>net.bytebuddy</groupId>
<artifactId>byte-buddy</artifactId>
<version>1.11.1</version>
<version>1.12.8</version>
</dependency>

<dependency>
Expand All @@ -103,36 +103,36 @@
<dependency>
<groupId>org.yaml</groupId>
<artifactId>snakeyaml</artifactId>
<version>1.28</version>
<version>1.30</version>
</dependency>

<!-- test dependencies -->

<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
<version>5.7.2</version>
<version>5.8.2</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.assertj</groupId>
<artifactId>assertj-core</artifactId>
<version>3.19.0</version>
<version>3.22.0</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>de.retest</groupId>
<artifactId>recheck-junit-jupiter-extension</artifactId>
<version>1.11.0</version>
<version>1.12.0</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>de.retest</groupId>
<artifactId>recheck-junit-4-extension</artifactId>
<version>1.11.0</version>
<version>1.12.0</version>
<scope>test</scope>
</dependency>

Expand All @@ -153,14 +153,14 @@
<dependency>
<groupId>io.github.netmikey.logunit</groupId>
<artifactId>logunit-core</artifactId>
<version>1.1.0</version>
<version>1.1.3</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>io.github.netmikey.logunit</groupId>
<artifactId>logunit-logback</artifactId>
<version>1.1.0</version>
<version>1.1.3</version>
<scope>test</scope>
</dependency>

Expand All @@ -181,7 +181,7 @@
<dependency>
<groupId>com.approvaltests</groupId>
<artifactId>approvaltests</artifactId>
<version>11.6.0</version>
<version>14.0.0</version>
<scope>test</scope>
</dependency>
</dependencies>
Expand All @@ -190,7 +190,7 @@
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<version>3.10.0</version>
<configuration>
<source>${java.version}</source>
<target>${java.version}</target>
Expand Down Expand Up @@ -238,7 +238,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.2.0</version>
<version>3.2.2</version>
<configuration>
<archive>
<manifest>
Expand All @@ -255,7 +255,7 @@
<plugin>
<groupId>com.amashchenko.maven.plugin</groupId>
<artifactId>gitflow-maven-plugin</artifactId>
<version>1.16.0</version>
<version>1.18.0</version>
<configuration>
<gitFlowConfig>
<productionBranch>main</productionBranch>
Expand Down Expand Up @@ -290,7 +290,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.3.0</version>
<version>3.3.2</version>
<executions>
<execution>
<id>bundle-javadoc</id>
Expand Down Expand Up @@ -338,7 +338,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-enforcer-plugin</artifactId>
<version>3.0.0-M3</version>
<version>3.0.0</version>
<executions>
<execution>
<id>enforce-maven</id>
Expand All @@ -359,7 +359,7 @@
<plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>
<version>1.6.8</version>
<version>1.6.12</version>
<extensions>true</extensions>
<configuration>
<nexusUrl>https://oss.sonatype.org/</nexusUrl>
Expand Down
10 changes: 6 additions & 4 deletions src/main/java/de/retest/web/RecheckSeleniumAdapter.java
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ private Set<RootElement> convert( final WebDriver driver, final RemoteWebElement
@SuppressWarnings( "unchecked" )
// [["//html[1]", {tagName=html, ...}], ["//html[1]/body[1]", {tagName=body, ...}]]
final List<List<Object>> tagMapping = (List<List<Object>>) result;
debug( tagMapping );
debugLogPseudoElements( tagMapping );
final RootElement lastChecked = convert( tagMapping, driver.getCurrentUrl(), driver.getTitle(), screenshot );

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

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

public RootElement convert( final List<List<Object>> tagMapping, final String url, final String title,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
package de.retest.web.selenium;

import org.openqa.selenium.By;
import org.openqa.selenium.NoSuchSessionException;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.remote.RemoteWebDriver;

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

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

@Override
public void close() {
// Is this sensible? What about tests using separate sessions?
cap();
super.close();
ifBrowserIsNotRunning( this::cap ); // cap if close window quit the driver
}

@Override
public void quit() {
try {
// Is this sensible? What about tests using separate sessions?
cap();
} finally {
super.quit();
}
}

private void ifBrowserIsNotRunning( final Runnable call ) {
try {
super.getWindowHandles();
} catch ( NullPointerException | NoSuchSessionException e ) {
call.run();
}
}

@Override
protected WebElement wrap( final WebElement element ) {
return AutocheckingWebElement.of( element, this );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import org.openqa.selenium.WebElement;

import lombok.RequiredArgsConstructor;
import org.openqa.selenium.WindowType;

@RequiredArgsConstructor
public class AutocheckingTargetLocator implements WebDriver.TargetLocator {
Expand Down Expand Up @@ -39,6 +40,11 @@ public WebDriver window( final String nameOrHandle ) {
return driver;
}

@Override
public WebDriver newWindow(WindowType typeHint) {
return delegate.newWindow(typeHint);
}

@Override
public WebDriver defaultContent() {
return delegate.defaultContent();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
import org.openqa.selenium.WrapsDriver;
import org.openqa.selenium.interactions.Coordinates;
import org.openqa.selenium.interactions.Locatable;
import org.openqa.selenium.internal.WrapsElement;
import org.openqa.selenium.WrapsElement;

import lombok.AccessLevel;
import lombok.RequiredArgsConstructor;
Expand Down
Loading

0 comments on commit 994933d

Please sign in to comment.