|
13 | 13 | import java.io.File;
|
14 | 14 | import java.nio.file.Path;
|
15 | 15 | import java.nio.file.Paths;
|
16 |
| -import org.openqa.selenium.chromium.ChromiumDriverLogLevel; |
| 16 | +//import org.openqa.selenium.chromium.ChromiumDriverLogLevel; |
17 | 17 |
|
18 | 18 | import java.io.File;
|
19 | 19 | import java.io.IOException;
|
@@ -80,57 +80,57 @@ public void logsToFile() throws IOException {
|
80 | 80 | // Assertions.assertTrue(fileContent.contains("Starting ChromeDriver"));
|
81 | 81 | // }
|
82 | 82 |
|
83 |
| - @Test |
84 |
| - public void logsWithLevel() throws IOException { |
85 |
| - System.setProperty(ChromeDriverService.CHROME_DRIVER_LOG_PROPERTY, |
86 |
| - getLogLocation().getAbsolutePath()); |
87 |
| - |
88 |
| - ChromeDriverService service = new ChromeDriverService.Builder() |
89 |
| - .withLogLevel(ChromiumDriverLogLevel.DEBUG) |
90 |
| - .build(); |
91 |
| - |
92 |
| - driver = new ChromeDriver(service); |
93 |
| - |
94 |
| - String fileContent = new String(Files.readAllBytes(getLogLocation().toPath())); |
95 |
| - Assertions.assertTrue(fileContent.contains("[DEBUG]:")); |
96 |
| - } |
97 |
| - |
98 |
| - @Test |
99 |
| - public void configureDriverLogs() throws IOException { |
100 |
| - System.setProperty(ChromeDriverService.CHROME_DRIVER_LOG_PROPERTY, |
101 |
| - getLogLocation().getAbsolutePath()); |
102 |
| - System.setProperty(ChromeDriverService.CHROME_DRIVER_LOG_LEVEL_PROPERTY, |
103 |
| - ChromiumDriverLogLevel.DEBUG.toString()); |
104 |
| - |
105 |
| - ChromeDriverService service = new ChromeDriverService.Builder() |
106 |
| - .withAppendLog(true) |
107 |
| - .withReadableTimestamp(true) |
108 |
| - .build(); |
109 |
| - |
110 |
| - driver = new ChromeDriver(service); |
111 |
| - |
112 |
| - String fileContent = new String(Files.readAllBytes(getLogLocation().toPath())); |
113 |
| - Pattern pattern = Pattern.compile("\\[\\d\\d-\\d\\d-\\d\\d\\d\\d", Pattern.CASE_INSENSITIVE); |
114 |
| - Assertions.assertTrue(pattern.matcher(fileContent).find()); |
115 |
| - } |
116 |
| - |
117 |
| - @Test |
118 |
| - public void disableBuildChecks() throws IOException { |
119 |
| - System.setProperty(ChromeDriverService.CHROME_DRIVER_LOG_PROPERTY, |
120 |
| - getLogLocation().getAbsolutePath()); |
121 |
| - System.setProperty(ChromeDriverService.CHROME_DRIVER_LOG_LEVEL_PROPERTY, |
122 |
| - ChromiumDriverLogLevel.WARNING.toString()); |
123 |
| - |
124 |
| - ChromeDriverService service = new ChromeDriverService.Builder() |
125 |
| - .withBuildCheckDisabled(true) |
126 |
| - .build(); |
| 83 | +// @Test |
| 84 | +// public void logsWithLevel() throws IOException { |
| 85 | +// System.setProperty(ChromeDriverService.CHROME_DRIVER_LOG_PROPERTY, |
| 86 | +// getLogLocation().getAbsolutePath()); |
| 87 | +// |
| 88 | +// ChromeDriverService service = new ChromeDriverService.Builder() |
| 89 | +// .withLogLevel(ChromiumDriverLogLevel.DEBUG) |
| 90 | +// .build(); |
| 91 | +// |
| 92 | +// driver = new ChromeDriver(service); |
| 93 | +// |
| 94 | +// String fileContent = new String(Files.readAllBytes(getLogLocation().toPath())); |
| 95 | +// Assertions.assertTrue(fileContent.contains("[DEBUG]:")); |
| 96 | +// } |
127 | 97 |
|
128 |
| - driver = new ChromeDriver(service); |
| 98 | +// @Test |
| 99 | +// public void configureDriverLogs() throws IOException { |
| 100 | +// System.setProperty(ChromeDriverService.CHROME_DRIVER_LOG_PROPERTY, |
| 101 | +// getLogLocation().getAbsolutePath()); |
| 102 | +// System.setProperty(ChromeDriverService.CHROME_DRIVER_LOG_LEVEL_PROPERTY, |
| 103 | +// ChromiumDriverLogLevel.DEBUG.toString()); |
| 104 | +// |
| 105 | +// ChromeDriverService service = new ChromeDriverService.Builder() |
| 106 | +// .withAppendLog(true) |
| 107 | +// .withReadableTimestamp(true) |
| 108 | +// .build(); |
| 109 | +// |
| 110 | +// driver = new ChromeDriver(service); |
| 111 | +// |
| 112 | +// String fileContent = new String(Files.readAllBytes(getLogLocation().toPath())); |
| 113 | +// Pattern pattern = Pattern.compile("\\[\\d\\d-\\d\\d-\\d\\d\\d\\d", Pattern.CASE_INSENSITIVE); |
| 114 | +// Assertions.assertTrue(pattern.matcher(fileContent).find()); |
| 115 | +// } |
129 | 116 |
|
130 |
| - String fileContent = new String(Files.readAllBytes(getLogLocation().toPath())); |
131 |
| - String expected = "[WARNING]: You are using an unsupported command-line switch: --disable-build-check"; |
132 |
| - Assertions.assertTrue(fileContent.contains(expected)); |
133 |
| - } |
| 117 | +// @Test |
| 118 | +// public void disableBuildChecks() throws IOException { |
| 119 | +// System.setProperty(ChromeDriverService.CHROME_DRIVER_LOG_PROPERTY, |
| 120 | +// getLogLocation().getAbsolutePath()); |
| 121 | +// System.setProperty(ChromeDriverService.CHROME_DRIVER_LOG_LEVEL_PROPERTY, |
| 122 | +// ChromiumDriverLogLevel.WARNING.toString()); |
| 123 | +// |
| 124 | +// ChromeDriverService service = new ChromeDriverService.Builder() |
| 125 | +// .withBuildCheckDisabled(true) |
| 126 | +// .build(); |
| 127 | +// |
| 128 | +// driver = new ChromeDriver(service); |
| 129 | +// |
| 130 | +// String fileContent = new String(Files.readAllBytes(getLogLocation().toPath())); |
| 131 | +// String expected = "[WARNING]: You are using an unsupported command-line switch: --disable-build-check"; |
| 132 | +// Assertions.assertTrue(fileContent.contains(expected)); |
| 133 | +// } |
134 | 134 |
|
135 | 135 | @Test
|
136 | 136 | public void extensionOptions() {
|
|
0 commit comments