Skip to content

Commit 7969613

Browse files
authored
Added syntax highlighting for java code (SeleniumHQ#1359)[deploy site]
syntax highlighting for java code
1 parent 6ed088d commit 7969613

File tree

4 files changed

+40
-40
lines changed

4 files changed

+40
-40
lines changed

website_and_docs/content/documentation/test_practices/design_strategies.en.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ As an example of a UI that we'd like to model, take a look at
3737
the [new issue](https://github.com/SeleniumHQ/selenium/issues/new) page. From the point of view of a test author,
3838
this offers the service of being able to file a new issue. A basic Page Object would look like:
3939

40-
```
40+
```java
4141
package com.example.webdriver;
4242

4343
import org.openqa.selenium.By;
@@ -76,7 +76,7 @@ public class EditIssue {
7676

7777
In order to turn this into a LoadableComponent, all we need to do is to set that as the base type:
7878

79-
```
79+
```java
8080
public class EditIssue extends LoadableComponent<EditIssue> {
8181
// rest of class ignored for now
8282
}
@@ -87,7 +87,7 @@ represents a LoadableComponent that loads the EditIssue page.
8787

8888
By extending this base class, we need to implement two new methods:
8989

90-
```
90+
```java
9191
@Override
9292
protected void load() {
9393
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
108108

109109
With a little rework, our PageObject looks like:
110110

111-
```
111+
```java
112112
package com.example.webdriver;
113113
import org.openqa.selenium.By;
114114
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
177177
the information about how to navigate to the page into the page itself, meaning that
178178
this information's not scattered through the code base. It also means that we can do this in our tests:
179179

180-
```
180+
```java
181181
EditIssue page = new EditIssue(driver).get();
182182
```
183183

@@ -203,7 +203,7 @@ The end result, in addition to the EditIssue class above is:
203203

204204
ProjectPage.java:
205205

206-
```
206+
```java
207207
package com.example.webdriver;
208208

209209
import org.openqa.selenium.WebDriver;
@@ -236,7 +236,7 @@ public class ProjectPage extends LoadableComponent<ProjectPage> {
236236

237237
and SecuredPage.java:
238238

239-
```
239+
```java
240240
package com.example.webdriver;
241241

242242
import org.openqa.selenium.By;
@@ -293,7 +293,7 @@ public class SecuredPage extends LoadableComponent<SecuredPage> {
293293

294294
The "load" method in EditIssue now looks like:
295295

296-
```
296+
```java
297297
@Override
298298
protected void load() {
299299
securedPage.get();
@@ -306,7 +306,7 @@ This shows that the components are all "nested" within each other.
306306
A call to `get()` in EditIssue will cause all its dependencies to
307307
load too. The example usage:
308308

309-
```
309+
```java
310310
public class FooTest {
311311
private EditIssue editIssue;
312312

@@ -345,7 +345,7 @@ A "bot" is an action-oriented abstraction over the raw Selenium APIs.
345345
This means that if you find that commands aren't doing the Right Thing
346346
for your app, it's easy to change them. As an example:
347347

348-
```
348+
```java
349349
public class ActionBot {
350350
private final WebDriver driver;
351351

website_and_docs/content/documentation/test_practices/design_strategies.ja.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ LoadableComponentは、PageObjectsの作成の負担を軽減することを目
3434
テスト作成者の観点から、これは新しい問題を提出できるサービスを提供します。
3535
基本的なページオブジェクトは次のようになります。
3636

37-
```
37+
```java
3838
package com.example.webdriver;
3939

4040
import org.openqa.selenium.By;
@@ -73,7 +73,7 @@ public class EditIssue {
7373

7474
これをLoadableComponentに変換するには、これを基本型として設定するだけです。
7575

76-
```
76+
```java
7777
public class EditIssue extends LoadableComponent<EditIssue> {
7878
// rest of class ignored for now
7979
}
@@ -83,7 +83,7 @@ public class EditIssue extends LoadableComponent<EditIssue> {
8383

8484
このベースクラスを拡張することにより、2つの新しいメソッドを実装する必要があります。
8585

86-
```
86+
```java
8787
@Override
8888
protected void load() {
8989
driver.get("https://github.com/SeleniumHQ/selenium/issues/new");
@@ -103,7 +103,7 @@ public class EditIssue extends LoadableComponent<EditIssue> {
103103

104104
少し手直しすると、PageObjectは次のようになります。
105105

106-
```
106+
```java
107107
package com.example.webdriver;
108108
import org.openqa.selenium.By;
109109
import org.openqa.selenium.WebDriver;
@@ -173,7 +173,7 @@ public class EditIssue extends LoadableComponent<EditIssue> {
173173
つまり、この情報はコードベース全体に散らばっていません。
174174
これは、テストで下記を実行できることも意味します。
175175

176-
```
176+
```java
177177
EditIssue page = new EditIssue(driver).get();
178178
```
179179

@@ -199,7 +199,7 @@ LoadableComponentsは、他のLoadableComponentsと組み合わせて使用す
199199

200200
ProjectPage.java:
201201

202-
```
202+
```java
203203
package com.example.webdriver;
204204

205205
import org.openqa.selenium.WebDriver;
@@ -232,7 +232,7 @@ public class ProjectPage extends LoadableComponent<ProjectPage> {
232232

233233
and SecuredPage.java:
234234

235-
```
235+
```java
236236
package com.example.webdriver;
237237

238238
import org.openqa.selenium.By;
@@ -289,7 +289,7 @@ public class SecuredPage extends LoadableComponent<SecuredPage> {
289289

290290
EditIssueの "load" メソッドは次のようになります。
291291

292-
```
292+
```java
293293
@Override
294294
protected void load() {
295295
securedPage.get();
@@ -302,7 +302,7 @@ EditIssueの "load" メソッドは次のようになります。
302302
EditIssueで `get()` を呼び出すと、そのすべての依存関係も読み込まれます。
303303
使用例:
304304

305-
```
305+
```java
306306
public class FooTest {
307307
private EditIssue editIssue;
308308

@@ -338,7 +338,7 @@ PageObjectsは、テストでの重複を減らすための便利な方法です
338338
つまり、コマンドがアプリに対して正しいことをしていないことがわかった場合、コマンドを簡単に変更できます。
339339
例として:
340340

341-
```
341+
```java
342342
public class ActionBot {
343343
private final WebDriver driver;
344344

website_and_docs/content/documentation/test_practices/design_strategies.pt-br.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ the [new issue](https://github.com/SeleniumHQ/selenium/issues/new) page. From
4040
the point of view of a test author, this offers the service of being able to
4141
file a new issue. A basic Page Object would look like:
4242

43-
```
43+
```java
4444
package com.example.webdriver;
4545

4646
import org.openqa.selenium.By;
@@ -79,7 +79,7 @@ public class EditIssue {
7979

8080
In order to turn this into a LoadableComponent, all we need to do is to set that as the base type:
8181

82-
```
82+
```java
8383
public class EditIssue extends LoadableComponent<EditIssue> {
8484
// rest of class ignored for now
8585
}
@@ -90,7 +90,7 @@ represents a LoadableComponent that loads the EditIssue page.
9090

9191
By extending this base class, we need to implement two new methods:
9292

93-
```
93+
```java
9494
@Override
9595
protected void load() {
9696
driver.get("https://github.com/SeleniumHQ/selenium/issues/new");
@@ -113,7 +113,7 @@ used to debug tests.
113113

114114
With a little rework, our PageObject looks like:
115115

116-
```
116+
```java
117117
package com.example.webdriver;
118118
import org.openqa.selenium.By;
119119
import org.openqa.selenium.WebDriver;
@@ -183,7 +183,7 @@ encapsulate the information about how to navigate to the page into the page
183183
itself, meaning that this information's not scattered through the code base.
184184
It also means that we can do this in our tests:
185185

186-
```
186+
```java
187187
EditIssue page = new EditIssue(driver).get();
188188
```
189189

@@ -209,7 +209,7 @@ the parent. The end result, in addition to the EditIssue class above is:
209209

210210
ProjectPage.java:
211211

212-
```
212+
```java
213213
package com.example.webdriver;
214214

215215
import org.openqa.selenium.WebDriver;
@@ -242,7 +242,7 @@ public class ProjectPage extends LoadableComponent<ProjectPage> {
242242

243243
and SecuredPage.java:
244244

245-
```
245+
```java
246246
package com.example.webdriver;
247247

248248
import org.openqa.selenium.By;
@@ -299,7 +299,7 @@ public class SecuredPage extends LoadableComponent<SecuredPage> {
299299

300300
The "load" method in EditIssue now looks like:
301301

302-
```
302+
```java
303303
@Override
304304
protected void load() {
305305
securedPage.get();
@@ -310,7 +310,7 @@ The "load" method in EditIssue now looks like:
310310

311311
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:
312312

313-
```
313+
```java
314314
public class FooTest {
315315
private EditIssue editIssue;
316316

@@ -345,7 +345,7 @@ Although PageObjects are a useful way of reducing duplication in your tests, it'
345345

346346
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:
347347

348-
```
348+
```java
349349
public class ActionBot {
350350
private final WebDriver driver;
351351

website_and_docs/content/documentation/test_practices/design_strategies.zh-cn.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ the [new issue](https://github.com/SeleniumHQ/selenium/issues/new) page.
4949
From the point of view of a test author, this offers the service of being
5050
able to file a new issue. A basic Page Object would look like:
5151

52-
```
52+
```java
5353
package com.example.webdriver;
5454

5555
import org.openqa.selenium.By;
@@ -88,7 +88,7 @@ public class EditIssue {
8888

8989
In order to turn this into a LoadableComponent, all we need to do is to set that as the base type:
9090

91-
```
91+
```java
9292
public class EditIssue extends LoadableComponent<EditIssue> {
9393
// rest of class ignored for now
9494
}
@@ -99,7 +99,7 @@ this class represents a LoadableComponent that loads the EditIssue page.
9999

100100
By extending this base class, we need to implement two new methods:
101101

102-
```
102+
```java
103103
@Override
104104
protected void load() {
105105
driver.get("https://github.com/SeleniumHQ/selenium/issues/new");
@@ -122,7 +122,7 @@ can be used to debug tests.
122122

123123
With a little rework, our PageObject looks like:
124124

125-
```
125+
```java
126126
package com.example.webdriver;
127127
import org.openqa.selenium.By;
128128
import org.openqa.selenium.WebDriver;
@@ -192,7 +192,7 @@ is encapsulate the information about how to navigate to the page into
192192
the page itself, meaning that this information's not scattered through
193193
the code base. It also means that we can do this in our tests:
194194

195-
```
195+
```java
196196
EditIssue page = new EditIssue(driver).get();
197197
```
198198

@@ -218,7 +218,7 @@ the parent. The end result, in addition to the EditIssue class above is:
218218

219219
ProjectPage.java:
220220

221-
```
221+
```java
222222
package com.example.webdriver;
223223

224224
import org.openqa.selenium.WebDriver;
@@ -251,7 +251,7 @@ public class ProjectPage extends LoadableComponent<ProjectPage> {
251251

252252
and SecuredPage.java:
253253

254-
```
254+
```java
255255
package com.example.webdriver;
256256

257257
import org.openqa.selenium.By;
@@ -308,7 +308,7 @@ public class SecuredPage extends LoadableComponent<SecuredPage> {
308308

309309
The "load" method in EditIssue now looks like:
310310

311-
```
311+
```java
312312
@Override
313313
protected void load() {
314314
securedPage.get();
@@ -320,7 +320,7 @@ The "load" method in EditIssue now looks like:
320320
This shows that the components are all "nested" within each other.
321321
A call to `get()` in EditIssue will cause all its dependencies to load too. The example usage:
322322

323-
```
323+
```java
324324
public class FooTest {
325325
private EditIssue editIssue;
326326

@@ -359,7 +359,7 @@ A "bot" is an action-oriented abstraction over the raw Selenium APIs.
359359
This means that if you find that commands aren't doing the Right Thing
360360
for your app, it's easy to change them. As an example:
361361

362-
```
362+
```java
363363
public class ActionBot {
364364
private final WebDriver driver;
365365

0 commit comments

Comments
 (0)