1+ /*
2+ * (C) Copyright 2020 Boni Garcia (http://bonigarcia.github.io/)
3+ *
4+ * Licensed under the Apache License, Version 2.0 (the "License");
5+ * you may not use this file except in compliance with the License.
6+ * You may obtain a copy of the License at
7+ *
8+ * http://www.apache.org/licenses/LICENSE-2.0
9+ *
10+ * Unless required by applicable law or agreed to in writing, software
11+ * distributed under the License is distributed on an "AS IS" BASIS,
12+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+ * See the License for the specific language governing permissions and
14+ * limitations under the License.
15+ *
16+ */
17+ package io .github .bonigarcia .seljup .test .basic ;
18+
19+ import static org .apache .commons .lang3 .SystemUtils .IS_OS_MAC ;
20+ import static org .apache .commons .lang3 .SystemUtils .IS_OS_WINDOWS ;
21+ import static org .hamcrest .CoreMatchers .containsString ;
22+ import static org .hamcrest .MatcherAssert .assertThat ;
23+
24+ import org .junit .jupiter .api .Disabled ;
25+ import org .junit .jupiter .api .Test ;
26+ import org .junit .jupiter .api .extension .ExtendWith ;
27+ import org .openqa .selenium .chrome .ChromeDriver ;
28+ import org .openqa .selenium .chrome .ChromeOptions ;
29+
30+ import io .github .bonigarcia .seljup .Options ;
31+ import io .github .bonigarcia .seljup .SeleniumExtension ;
32+
33+ @ ExtendWith (SeleniumExtension .class )
34+ class ChromiumJupiterTest {
35+
36+ @ Options
37+ ChromeOptions options = new ChromeOptions ();
38+ {
39+ String chromium ;
40+ if (IS_OS_WINDOWS ) {
41+ String localAppDat = System .getenv ("LOCALAPPDATA" )
42+ .replaceAll ("\\ \\ " , "\\ \\ \\ \\ " );
43+ chromium = localAppDat + "\\ Chromium\\ Application\\ chrome.exe" ;
44+ } else {
45+ chromium = IS_OS_MAC
46+ ? "/Applications/Chromium.app/Contents/MacOS/Chromium"
47+ : "/usr/bin/chromium-browser" ;
48+ }
49+ options .setBinary (chromium );
50+ }
51+
52+ @ Disabled
53+ @ Test
54+ void testChromium (ChromeDriver driver ) {
55+ driver .get ("https://bonigarcia.github.io/selenium-jupiter/" );
56+ assertThat (driver .getTitle (),
57+ containsString ("JUnit 5 extension for Selenium" ));
58+ }
59+
60+ }
0 commit comments