From 4872523181bc4c4f11d6070e7a73517302413d29 Mon Sep 17 00:00:00 2001 From: AlexCD Date: Sun, 12 Sep 2021 19:27:29 +0300 Subject: [PATCH 1/2] Allow configuring WebDriver with TestNG See gh-27947 --- .../boot/test/autoconfigure/web/servlet/WebDriverScope.java | 6 +++++- .../web/servlet/WebDriverTestExecutionListener.java | 3 ++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/web/servlet/WebDriverScope.java b/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/web/servlet/WebDriverScope.java index 40c3d36aaa9..7d1a6748d96 100644 --- a/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/web/servlet/WebDriverScope.java +++ b/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/web/servlet/WebDriverScope.java @@ -36,11 +36,15 @@ import org.springframework.util.StringUtils; * {@link WebDriverTestExecutionListener}. * * @author Phillip Webb + * @since 2.6.0 * @see WebDriverContextCustomizerFactory * @see WebDriverTestExecutionListener */ -class WebDriverScope implements Scope { +public class WebDriverScope implements Scope { + /** + * WebDriver bean scope name. + */ public static final String NAME = "webDriver"; private static final String WEB_DRIVER_CLASS = "org.openqa.selenium.WebDriver"; diff --git a/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/web/servlet/WebDriverTestExecutionListener.java b/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/web/servlet/WebDriverTestExecutionListener.java index f192bbb1182..d43a28a73ee 100644 --- a/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/web/servlet/WebDriverTestExecutionListener.java +++ b/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/web/servlet/WebDriverTestExecutionListener.java @@ -26,10 +26,11 @@ import org.springframework.test.context.support.DependencyInjectionTestExecution * {@link TestExecutionListener} to reset the {@link WebDriverScope}. * * @author Phillip Webb + * @since 2.6.0 * @see WebDriverContextCustomizerFactory * @see WebDriverScope */ -class WebDriverTestExecutionListener extends AbstractTestExecutionListener { +public class WebDriverTestExecutionListener extends AbstractTestExecutionListener { @Override public int getOrder() { From e746dfa677201c2ffa63e30a4dc84dfe4bd82232 Mon Sep 17 00:00:00 2001 From: Stephane Nicoll Date: Sun, 19 Jun 2022 10:35:09 +0200 Subject: [PATCH 2/2] Polish "Allow configuring WebDriver with TestNG" See gh-27947 --- .../boot/test/autoconfigure/web/servlet/WebDriverScope.java | 4 ++-- .../web/servlet/WebDriverTestExecutionListener.java | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/web/servlet/WebDriverScope.java b/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/web/servlet/WebDriverScope.java index 7d1a6748d96..f2007a56d5f 100644 --- a/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/web/servlet/WebDriverScope.java +++ b/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/web/servlet/WebDriverScope.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2022 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -36,7 +36,7 @@ import org.springframework.util.StringUtils; * {@link WebDriverTestExecutionListener}. * * @author Phillip Webb - * @since 2.6.0 + * @since 3.0.0 * @see WebDriverContextCustomizerFactory * @see WebDriverTestExecutionListener */ diff --git a/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/web/servlet/WebDriverTestExecutionListener.java b/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/web/servlet/WebDriverTestExecutionListener.java index d43a28a73ee..f511a31a454 100644 --- a/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/web/servlet/WebDriverTestExecutionListener.java +++ b/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/web/servlet/WebDriverTestExecutionListener.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2022 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -26,7 +26,7 @@ import org.springframework.test.context.support.DependencyInjectionTestExecution * {@link TestExecutionListener} to reset the {@link WebDriverScope}. * * @author Phillip Webb - * @since 2.6.0 + * @since 3.0.0 * @see WebDriverContextCustomizerFactory * @see WebDriverScope */