From 91e43163699f4d6f2d8ff071ee4cb4306085d399 Mon Sep 17 00:00:00 2001 From: nilisha-jais Date: Mon, 17 Apr 2023 14:48:06 +0530 Subject: [PATCH] syntax highlighting for java code --- .../test_practices/design_strategies.en.md | 20 +++++++++---------- .../test_practices/design_strategies.ja.md | 20 +++++++++---------- .../test_practices/design_strategies.pt-br.md | 20 +++++++++---------- .../test_practices/design_strategies.zh-cn.md | 20 +++++++++---------- 4 files changed, 40 insertions(+), 40 deletions(-) diff --git a/website_and_docs/content/documentation/test_practices/design_strategies.en.md b/website_and_docs/content/documentation/test_practices/design_strategies.en.md index a5966263f79e..e154621960a3 100644 --- a/website_and_docs/content/documentation/test_practices/design_strategies.en.md +++ b/website_and_docs/content/documentation/test_practices/design_strategies.en.md @@ -37,7 +37,7 @@ As an example of a UI that we'd like to model, take a look at the [new issue](https://github.com/SeleniumHQ/selenium/issues/new) page. From the point of view of a test author, this offers the service of being able to file a new issue. A basic Page Object would look like: -``` +```java package com.example.webdriver; import org.openqa.selenium.By; @@ -76,7 +76,7 @@ public class EditIssue { In order to turn this into a LoadableComponent, all we need to do is to set that as the base type: -``` +```java public class EditIssue extends LoadableComponent { // rest of class ignored for now } @@ -87,7 +87,7 @@ represents a LoadableComponent that loads the EditIssue page. By extending this base class, we need to implement two new methods: -``` +```java @Override protected void load() { driver.get("https://github.com/SeleniumHQ/selenium/issues/new"); @@ -108,7 +108,7 @@ it's possible to give users of the class clear information that can be used to d With a little rework, our PageObject looks like: -``` +```java package com.example.webdriver; import org.openqa.selenium.By; import org.openqa.selenium.WebDriver; @@ -177,7 +177,7 @@ That doesn't seem to have bought us much, right? One thing it has done is encaps the information about how to navigate to the page into the page itself, meaning that this information's not scattered through the code base. It also means that we can do this in our tests: -``` +```java EditIssue page = new EditIssue(driver).get(); ``` @@ -203,7 +203,7 @@ The end result, in addition to the EditIssue class above is: ProjectPage.java: -``` +```java package com.example.webdriver; import org.openqa.selenium.WebDriver; @@ -236,7 +236,7 @@ public class ProjectPage extends LoadableComponent { and SecuredPage.java: -``` +```java package com.example.webdriver; import org.openqa.selenium.By; @@ -293,7 +293,7 @@ public class SecuredPage extends LoadableComponent { The "load" method in EditIssue now looks like: -``` +```java @Override protected void load() { securedPage.get(); @@ -306,7 +306,7 @@ This shows that the components are all "nested" within each other. A call to `get()` in EditIssue will cause all its dependencies to load too. The example usage: -``` +```java public class FooTest { private EditIssue editIssue; @@ -345,7 +345,7 @@ A "bot" is an action-oriented abstraction over the raw Selenium APIs. This means that if you find that commands aren't doing the Right Thing for your app, it's easy to change them. As an example: -``` +```java public class ActionBot { private final WebDriver driver; diff --git a/website_and_docs/content/documentation/test_practices/design_strategies.ja.md b/website_and_docs/content/documentation/test_practices/design_strategies.ja.md index 8fdf46cdf421..5ef10220466c 100644 --- a/website_and_docs/content/documentation/test_practices/design_strategies.ja.md +++ b/website_and_docs/content/documentation/test_practices/design_strategies.ja.md @@ -34,7 +34,7 @@ LoadableComponentは、PageObjectsの作成の負担を軽減することを目 テスト作成者の観点から、これは新しい問題を提出できるサービスを提供します。 基本的なページオブジェクトは次のようになります。 -``` +```java package com.example.webdriver; import org.openqa.selenium.By; @@ -73,7 +73,7 @@ public class EditIssue { これをLoadableComponentに変換するには、これを基本型として設定するだけです。 -``` +```java public class EditIssue extends LoadableComponent { // rest of class ignored for now } @@ -83,7 +83,7 @@ public class EditIssue extends LoadableComponent { このベースクラスを拡張することにより、2つの新しいメソッドを実装する必要があります。 -``` +```java @Override protected void load() { driver.get("https://github.com/SeleniumHQ/selenium/issues/new"); @@ -103,7 +103,7 @@ public class EditIssue extends LoadableComponent { 少し手直しすると、PageObjectは次のようになります。 -``` +```java package com.example.webdriver; import org.openqa.selenium.By; import org.openqa.selenium.WebDriver; @@ -173,7 +173,7 @@ public class EditIssue extends LoadableComponent { つまり、この情報はコードベース全体に散らばっていません。 これは、テストで下記を実行できることも意味します。 -``` +```java EditIssue page = new EditIssue(driver).get(); ``` @@ -199,7 +199,7 @@ LoadableComponentsは、他のLoadableComponentsと組み合わせて使用す ProjectPage.java: -``` +```java package com.example.webdriver; import org.openqa.selenium.WebDriver; @@ -232,7 +232,7 @@ public class ProjectPage extends LoadableComponent { and SecuredPage.java: -``` +```java package com.example.webdriver; import org.openqa.selenium.By; @@ -289,7 +289,7 @@ public class SecuredPage extends LoadableComponent { EditIssueの "load" メソッドは次のようになります。 -``` +```java @Override protected void load() { securedPage.get(); @@ -302,7 +302,7 @@ EditIssueの "load" メソッドは次のようになります。 EditIssueで `get()` を呼び出すと、そのすべての依存関係も読み込まれます。 使用例: -``` +```java public class FooTest { private EditIssue editIssue; @@ -338,7 +338,7 @@ PageObjectsは、テストでの重複を減らすための便利な方法です つまり、コマンドがアプリに対して正しいことをしていないことがわかった場合、コマンドを簡単に変更できます。 例として: -``` +```java public class ActionBot { private final WebDriver driver; diff --git a/website_and_docs/content/documentation/test_practices/design_strategies.pt-br.md b/website_and_docs/content/documentation/test_practices/design_strategies.pt-br.md index 87bd185a0906..d2174f34adaf 100644 --- a/website_and_docs/content/documentation/test_practices/design_strategies.pt-br.md +++ b/website_and_docs/content/documentation/test_practices/design_strategies.pt-br.md @@ -40,7 +40,7 @@ the [new issue](https://github.com/SeleniumHQ/selenium/issues/new) page. From the point of view of a test author, this offers the service of being able to file a new issue. A basic Page Object would look like: -``` +```java package com.example.webdriver; import org.openqa.selenium.By; @@ -79,7 +79,7 @@ public class EditIssue { In order to turn this into a LoadableComponent, all we need to do is to set that as the base type: -``` +```java public class EditIssue extends LoadableComponent { // rest of class ignored for now } @@ -90,7 +90,7 @@ represents a LoadableComponent that loads the EditIssue page. By extending this base class, we need to implement two new methods: -``` +```java @Override protected void load() { driver.get("https://github.com/SeleniumHQ/selenium/issues/new"); @@ -113,7 +113,7 @@ used to debug tests. With a little rework, our PageObject looks like: -``` +```java package com.example.webdriver; import org.openqa.selenium.By; import org.openqa.selenium.WebDriver; @@ -183,7 +183,7 @@ encapsulate the information about how to navigate to the page into the page itself, meaning that this information's not scattered through the code base. It also means that we can do this in our tests: -``` +```java EditIssue page = new EditIssue(driver).get(); ``` @@ -209,7 +209,7 @@ the parent. The end result, in addition to the EditIssue class above is: ProjectPage.java: -``` +```java package com.example.webdriver; import org.openqa.selenium.WebDriver; @@ -242,7 +242,7 @@ public class ProjectPage extends LoadableComponent { and SecuredPage.java: -``` +```java package com.example.webdriver; import org.openqa.selenium.By; @@ -299,7 +299,7 @@ public class SecuredPage extends LoadableComponent { The "load" method in EditIssue now looks like: -``` +```java @Override protected void load() { securedPage.get(); @@ -310,7 +310,7 @@ The "load" method in EditIssue now looks like: This shows that the components are all "nested" within each other. A call to `get()` in EditIssue will cause all its dependencies to load too. The example usage: -``` +```java public class FooTest { private EditIssue editIssue; @@ -345,7 +345,7 @@ Although PageObjects are a useful way of reducing duplication in your tests, it' A "bot" is an action-oriented abstraction over the raw Selenium APIs. This means that if you find that commands aren't doing the Right Thing for your app, it's easy to change them. As an example: -``` +```java public class ActionBot { private final WebDriver driver; diff --git a/website_and_docs/content/documentation/test_practices/design_strategies.zh-cn.md b/website_and_docs/content/documentation/test_practices/design_strategies.zh-cn.md index 5bb2da52b9d7..b46f36a185cc 100644 --- a/website_and_docs/content/documentation/test_practices/design_strategies.zh-cn.md +++ b/website_and_docs/content/documentation/test_practices/design_strategies.zh-cn.md @@ -49,7 +49,7 @@ the [new issue](https://github.com/SeleniumHQ/selenium/issues/new) page. From the point of view of a test author, this offers the service of being able to file a new issue. A basic Page Object would look like: -``` +```java package com.example.webdriver; import org.openqa.selenium.By; @@ -88,7 +88,7 @@ public class EditIssue { In order to turn this into a LoadableComponent, all we need to do is to set that as the base type: -``` +```java public class EditIssue extends LoadableComponent { // rest of class ignored for now } @@ -99,7 +99,7 @@ this class represents a LoadableComponent that loads the EditIssue page. By extending this base class, we need to implement two new methods: -``` +```java @Override protected void load() { driver.get("https://github.com/SeleniumHQ/selenium/issues/new"); @@ -122,7 +122,7 @@ can be used to debug tests. With a little rework, our PageObject looks like: -``` +```java package com.example.webdriver; import org.openqa.selenium.By; import org.openqa.selenium.WebDriver; @@ -192,7 +192,7 @@ is encapsulate the information about how to navigate to the page into the page itself, meaning that this information's not scattered through the code base. It also means that we can do this in our tests: -``` +```java EditIssue page = new EditIssue(driver).get(); ``` @@ -218,7 +218,7 @@ the parent. The end result, in addition to the EditIssue class above is: ProjectPage.java: -``` +```java package com.example.webdriver; import org.openqa.selenium.WebDriver; @@ -251,7 +251,7 @@ public class ProjectPage extends LoadableComponent { and SecuredPage.java: -``` +```java package com.example.webdriver; import org.openqa.selenium.By; @@ -308,7 +308,7 @@ public class SecuredPage extends LoadableComponent { The "load" method in EditIssue now looks like: -``` +```java @Override protected void load() { securedPage.get(); @@ -320,7 +320,7 @@ The "load" method in EditIssue now looks like: This shows that the components are all "nested" within each other. A call to `get()` in EditIssue will cause all its dependencies to load too. The example usage: -``` +```java public class FooTest { private EditIssue editIssue; @@ -359,7 +359,7 @@ A "bot" is an action-oriented abstraction over the raw Selenium APIs. This means that if you find that commands aren't doing the Right Thing for your app, it's easy to change them. As an example: -``` +```java public class ActionBot { private final WebDriver driver;