|
1 | 1 | /*
|
2 | 2 | Copyright 2014 Selenium committers
|
3 |
| -Copyright 2014 Software Freedom Conservancy |
| 3 | +Copyright 2014-2015 Software Freedom Conservancy |
4 | 4 |
|
5 | 5 | Licensed under the Apache License, Version 2.0 (the "License");
|
6 | 6 | you may not use this file except in compliance with the License.
|
|
15 | 15 | limitations under the License.
|
16 | 16 | */
|
17 | 17 |
|
18 |
| - |
19 | 18 | package org.openqa.selenium.opera;
|
20 | 19 |
|
21 | 20 | import org.openqa.selenium.Capabilities;
|
|
36 | 35 | * A {@link WebDriver} implementation that controls a Blink-based Opera browser running on the local
|
37 | 36 | * machine. This class is provided as a convenience for easily testing the Chrome browser. The
|
38 | 37 | * control server which each instance communicates with will live and die with the instance.
|
39 |
| - * |
40 |
| - * <p/> |
| 38 | + * |
41 | 39 | * To avoid unnecessarily restarting the OperaDriver server with each instance, use a
|
42 | 40 | * {@link RemoteWebDriver} coupled with the desired {@link OperaDriverService}, which is managed
|
43 | 41 | * separately. For example: <pre>{@code
|
44 |
| - * |
| 42 | + * |
45 | 43 | * import static org.junit.Assert.assertEquals;
|
46 |
| - * |
| 44 | + * |
47 | 45 | * import org.junit.*;
|
48 | 46 | * import org.junit.runner.RunWith;
|
49 | 47 | * import org.junit.runners.JUnit4;
|
50 | 48 | * import org.openqa.selenium.opera.OperaDriverService;
|
51 | 49 | * import org.openqa.selenium.remote.DesiredCapabilities;
|
52 | 50 | * import org.openqa.selenium.remote.RemoteWebDriver;
|
53 |
| - * |
| 51 | + * |
54 | 52 | * {@literal @RunWith(JUnit4.class)}
|
55 | 53 | * public class OperaTest extends TestCase {
|
56 |
| - * |
| 54 | + * |
57 | 55 | * private static OperaDriverService service;
|
58 | 56 | * private WebDriver driver;
|
59 |
| - * |
| 57 | + * |
60 | 58 | * {@literal @BeforeClass}
|
61 | 59 | * public static void createAndStartService() {
|
62 | 60 | * service = new OperaDriverService.Builder()
|
|
65 | 63 | * .build();
|
66 | 64 | * service.start();
|
67 | 65 | * }
|
68 |
| - * |
| 66 | + * |
69 | 67 | * {@literal @AfterClass}
|
70 | 68 | * public static void createAndStopService() {
|
71 | 69 | * service.stop();
|
72 | 70 | * }
|
73 |
| - * |
| 71 | + * |
74 | 72 | * {@literal @Before}
|
75 | 73 | * public void createDriver() {
|
76 | 74 | * driver = new RemoteWebDriver(service.getUrl(),
|
77 | 75 | * DesiredCapabilities.opera());
|
78 | 76 | * }
|
79 |
| - * |
| 77 | + * |
80 | 78 | * {@literal @After}
|
81 | 79 | * public void quitDriver() {
|
82 | 80 | * driver.quit();
|
83 | 81 | * }
|
84 |
| - * |
| 82 | + * |
85 | 83 | * {@literal @Test}
|
86 | 84 | * public void testGoogleSearch() {
|
87 | 85 | * driver.get("http://www.google.com");
|
|
0 commit comments