|
5 | 5 |
|
6 | 6 | package anhtester.com.driver; |
7 | 7 |
|
8 | | -import anhtester.com.config.ConfigFactory; |
9 | 8 | import anhtester.com.constants.FrameworkConstants; |
10 | 9 | import anhtester.com.exceptions.HeadlessNotSupportedException; |
11 | 10 | import io.github.bonigarcia.wdm.WebDriverManager; |
|
18 | 17 | import org.openqa.selenium.edge.EdgeOptions; |
19 | 18 | import org.openqa.selenium.firefox.FirefoxDriver; |
20 | 19 | import org.openqa.selenium.firefox.FirefoxOptions; |
21 | | -import org.openqa.selenium.ie.InternetExplorerDriver; |
22 | | -import org.openqa.selenium.ie.InternetExplorerOptions; |
23 | | -import org.openqa.selenium.opera.OperaDriver; |
24 | | -import org.openqa.selenium.opera.OperaOptions; |
25 | 20 | import org.openqa.selenium.safari.SafariDriver; |
26 | 21 | import org.openqa.selenium.safari.SafariOptions; |
27 | 22 |
|
@@ -97,46 +92,6 @@ public SafariOptions getOptions() { |
97 | 92 |
|
98 | 93 | return safariOptions; |
99 | 94 | } |
100 | | - }, OPERA { |
101 | | - @Override |
102 | | - public WebDriver createDriver() { |
103 | | - WebDriverManager.getInstance(DriverManagerType.OPERA).setup(); |
104 | | - |
105 | | - return new OperaDriver(getOptions()); |
106 | | - } |
107 | | - |
108 | | - @Override |
109 | | - public OperaOptions getOptions() { |
110 | | - OperaOptions operaOptions = new OperaOptions(); |
111 | | - operaOptions.addArguments(START_MAXIMIZED); |
112 | | - operaOptions.addArguments("--disable-infobars"); |
113 | | - operaOptions.addArguments("--disable-notifications"); |
114 | | - |
115 | | - if (TRUE.equals(Boolean.valueOf(FrameworkConstants.HEADLESS))) |
116 | | - throw new HeadlessNotSupportedException(operaOptions.getBrowserName()); |
117 | | - |
118 | | - return operaOptions; |
119 | | - } |
120 | | - }, IE { |
121 | | - @Override |
122 | | - public WebDriver createDriver() { |
123 | | - WebDriverManager.getInstance(DriverManagerType.IEXPLORER).setup(); |
124 | | - |
125 | | - return new InternetExplorerDriver(getOptions()); |
126 | | - } |
127 | | - |
128 | | - @Override |
129 | | - public InternetExplorerOptions getOptions() { |
130 | | - InternetExplorerOptions internetExplorerOptions = new InternetExplorerOptions(); |
131 | | - internetExplorerOptions.ignoreZoomSettings(); |
132 | | - internetExplorerOptions.takeFullPageScreenshot(); |
133 | | - internetExplorerOptions.introduceFlakinessByIgnoringSecurityDomains(); |
134 | | - |
135 | | - if (TRUE.equals(Boolean.valueOf(FrameworkConstants.HEADLESS))) |
136 | | - throw new HeadlessNotSupportedException(internetExplorerOptions.getBrowserName()); |
137 | | - |
138 | | - return internetExplorerOptions; |
139 | | - } |
140 | 95 | }; |
141 | 96 |
|
142 | 97 | private static final String START_MAXIMIZED = "--start-maximized"; |
|
0 commit comments