From 3afc6a50795224d827733b11608fd9376bd00e5d Mon Sep 17 00:00:00 2001 From: Sam Brannen Date: Mon, 28 Nov 2022 14:45:46 +0100 Subject: [PATCH] Polish Testing chapter --- .../asciidoc/testing/spring-mvc-test-framework.adoc | 11 ++++------- .../docs/asciidoc/testing/testcontext-framework.adoc | 5 ++--- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/framework-docs/src/docs/asciidoc/testing/spring-mvc-test-framework.adoc b/framework-docs/src/docs/asciidoc/testing/spring-mvc-test-framework.adoc index e1fb855c2b..234c6db850 100644 --- a/framework-docs/src/docs/asciidoc/testing/spring-mvc-test-framework.adoc +++ b/framework-docs/src/docs/asciidoc/testing/spring-mvc-test-framework.adoc @@ -1466,15 +1466,13 @@ with HtmlUnit, but it is much easier with WebDriver. Consider the following [source,java,indent=0,subs="verbatim,quotes",role="primary"] .Java ---- - public class CreateMessagePage - extends AbstractPage { // <1> + public class CreateMessagePage extends AbstractPage { // <1> // <2> private WebElement summary; private WebElement text; - // <3> - @FindBy(css = "input[type=submit]") + @FindBy(css = "input[type=submit]") // <3> private WebElement submit; public CreateMessagePage(WebDriver driver) { @@ -1509,7 +1507,7 @@ by the `id` or `name` of the element within the HTML page. <3> We can use the https://github.com/SeleniumHQ/selenium/wiki/PageFactory#making-the-example-work-using-annotations[`@FindBy` annotation] to override the default lookup behavior. Our example shows how to use the `@FindBy` -annotation to look up our submit button with a `css` selector (*input[type=submit]*). +annotation to look up our submit button with a `css` selector (`input[type=submit]`). [source,kotlin,indent=0,subs="verbatim,quotes",role="secondary"] .Kotlin @@ -1520,8 +1518,7 @@ annotation to look up our submit button with a `css` selector (*input[type=submi private lateinit var summary: WebElement private lateinit var text: WebElement - // <3> - @FindBy(css = "input[type=submit]") + @FindBy(css = "input[type=submit]") // <3> private lateinit var submit: WebElement fun createMessage(resultPage: Class, summary: String, details: String): T { diff --git a/framework-docs/src/docs/asciidoc/testing/testcontext-framework.adoc b/framework-docs/src/docs/asciidoc/testing/testcontext-framework.adoc index 6399cf8465..f7f524389c 100644 --- a/framework-docs/src/docs/asciidoc/testing/testcontext-framework.adoc +++ b/framework-docs/src/docs/asciidoc/testing/testcontext-framework.adoc @@ -631,7 +631,7 @@ path that represents a resource URL (i.e., a path prefixed with `classpath:`, `f @ExtendWith(SpringExtension.class) // ApplicationContext will be loaded from "/app-config.xml" and // "/test-config.xml" in the root of the classpath - @ContextConfiguration(locations={"/app-config.xml", "/test-config.xml"}) // <1> + @ContextConfiguration(locations = {"/app-config.xml", "/test-config.xml"}) // <1> class MyTest { // class body... } @@ -898,8 +898,7 @@ class: .Java ---- @SpringJUnitConfig <1> - // ApplicationContext will be loaded from the - // static nested Config class + // ApplicationContext will be loaded from the static nested Config class class OrderServiceTest { @Configuration