5
5
import org .openqa .selenium .Proxy ;
6
6
import org .springframework .context .annotation .*;
7
7
import org .springframework .core .type .AnnotatedTypeMetadata ;
8
- import org .springframework .stereotype .Component ;
9
8
10
9
import javax .annotation .PostConstruct ;
11
10
import java .io .File ;
17
16
* Created by christopher on 01/12/2015.
18
17
*/
19
18
@ Configuration
20
- @ Component
21
19
public class Beans {
22
20
23
21
String workingDir = System .getProperty ("user.dir" );
@@ -29,6 +27,18 @@ public class Beans {
29
27
private static String browser = System .getProperty ("browser" , "chrome" );
30
28
31
29
30
+ @ PostConstruct
31
+ public void systemPath () throws IOException {
32
+ if (workingOS .contains ("windows" )) {
33
+ System .setProperty ("webdriver.chrome.driver" , new File ("." ).getCanonicalPath ()+"/src/test/resources/selenium_browser_drivers/windowsChromedriver/chromedriver.exe" );
34
+ } else if (workingOS .contains ("mac" )) {
35
+ System .setProperty ("webdriver.chrome.driver" , new File ("." ).getCanonicalPath ()+"/src/test/resources/selenium_browser_drivers/macChromedriver/chromedriver" );
36
+ } else if (workingOS .contains ("linux" )) {
37
+ System .setProperty ("webdriver.chrome.driver" , new File ("." ).getCanonicalPath ()+"/src/test/resources/selenium_browser_drivers/linuxChromedriver/chromedriver" );
38
+ }
39
+
40
+ }
41
+
32
42
@ Bean
33
43
public Proxy proxy () {
34
44
Proxy proxy = null ;
@@ -54,17 +64,6 @@ public BrowserDriverExtended.ChromeDriverExtended chrome() {
54
64
return new BrowserDriverExtended .ChromeDriverExtended (BrowserCapabilities .newInstance ().getChromeCapabilities ());
55
65
}
56
66
57
- @ PostConstruct
58
- public void systemPath () throws IOException {
59
- if (workingOS .contains ("windows" )) {
60
- System .setProperty ("webdriver.chrome.driver" , new File ("." ).getCanonicalPath ()+"/src/test/resources/selenium_browser_drivers/windowsChromedriver/chromedriver.exe" );
61
- } else if (workingOS .contains ("mac" )) {
62
- System .setProperty ("webdriver.chrome.driver" , new File ("." ).getCanonicalPath ()+"/src/test/resources/selenium_browser_drivers/macChromedriver/chromedriver" );
63
- } else if (workingOS .contains ("linux" )) {
64
- System .setProperty ("webdriver.chrome.driver" , new File ("." ).getCanonicalPath ()+"/src/test/resources/selenium_browser_drivers/linuxChromedriver/chromedriver" );
65
- }
66
-
67
- }
68
67
69
68
public static class FirefoxCondition implements Condition {
70
69
@ Override
0 commit comments