#120 disable start browser on run application
This commit is contained in:
parent
c303d65c8d
commit
181086c9db
@ -32,17 +32,16 @@ public class KiasService {
|
||||
private final static String DRIVER_TYPE = "webdriver.chrome.driver";
|
||||
|
||||
private final UserService userService;
|
||||
private WebDriver webDriver;
|
||||
|
||||
public KiasService(UserService userService) {
|
||||
System.setProperty(DRIVER_TYPE, getDriverExecutablePath());
|
||||
this.userService = userService;
|
||||
final ChromeOptions chromeOptions = new ChromeOptions();
|
||||
chromeOptions.addArguments("--headless");
|
||||
webDriver = new ChromeDriver(chromeOptions);
|
||||
}
|
||||
|
||||
public List<GrantDto> getNewGrantsDto() throws ParseException {
|
||||
System.setProperty(DRIVER_TYPE, getDriverExecutablePath());
|
||||
final ChromeOptions chromeOptions = new ChromeOptions();
|
||||
chromeOptions.addArguments("--headless");
|
||||
WebDriver webDriver = new ChromeDriver(chromeOptions);
|
||||
webDriver.get(String.format(BASE_URL, CONTEST_STATUS_ID, CONTEST_TYPE, CONTEST_YEAR));
|
||||
KiasPage kiasPage = new KiasPage(webDriver);
|
||||
List<WebElement> kiasGrants = new ArrayList<>();
|
||||
@ -64,7 +63,7 @@ public class KiasService {
|
||||
kiasGrants.clear();
|
||||
}
|
||||
while (kiasPage.checkPagination()); //проверка существования следующей страницы с грантами
|
||||
|
||||
webDriver.quit();
|
||||
return newGrants;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user