-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #9 from jLubi/master
Support Selenium Grid, Screenshot-Name
- Loading branch information
Showing
14 changed files
with
282 additions
and
123 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
version: "3" | ||
services: | ||
selenium-hub: | ||
image: selenium/hub:3.141.59-radium | ||
container_name: selenium-hub | ||
ports: | ||
- "4444:4444" | ||
chrome: | ||
image: selenium/node-chrome:3.141.59-radium | ||
volumes: | ||
- /dev/shm:/dev/shm | ||
depends_on: | ||
- selenium-hub | ||
environment: | ||
- HUB_HOST=selenium-hub | ||
- HUB_PORT=4444 | ||
- NODE_MAX_INSTANCES=10 | ||
- NODE_MAX_SESSION=10 | ||
firefox: | ||
image: selenium/node-firefox:3.141.59-radium | ||
volumes: | ||
- /dev/shm:/dev/shm | ||
depends_on: | ||
- selenium-hub | ||
environment: | ||
- HUB_HOST=selenium-hub | ||
- HUB_PORT=4444 | ||
- NODE_MAX_INSTANCES=10 | ||
- NODE_MAX_SESSION=10 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
48 changes: 48 additions & 0 deletions
48
src/main/java/io/freefair/screenshot_scheduler/selenium/SeleniumConfiguration.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
package io.freefair.screenshot_scheduler.selenium; | ||
|
||
import lombok.Getter; | ||
import lombok.extern.slf4j.Slf4j; | ||
import org.springframework.beans.factory.annotation.Value; | ||
import org.springframework.stereotype.Component; | ||
|
||
import java.net.MalformedURLException; | ||
import java.net.URL; | ||
|
||
@Getter | ||
@Slf4j | ||
@Component | ||
public class SeleniumConfiguration { | ||
@Value("${selenium.useGrid}") | ||
private boolean useGrid; | ||
|
||
@Value("${selenium.gridURL}") | ||
private String gridURL; | ||
|
||
@Value("${selenium.browser}") | ||
private String browser; | ||
|
||
@Value("${selenium.platform}") | ||
private String platform; | ||
|
||
@Value("${selenium.implicitWait}") | ||
private int implicitlyWait; | ||
|
||
@Value("${selenium.browser.height}") | ||
private int height; | ||
|
||
@Value("${selenium.browser.width}") | ||
private int width; | ||
|
||
@Value("#{'${selenium.chrome_args}'.trim().split(' ')}") | ||
private String[] chromeArgs; | ||
|
||
public URL getGridURL() { | ||
try { | ||
return new URL(gridURL); | ||
} catch (MalformedURLException e) { | ||
log.error("GridURL is invalid", e); | ||
return null; | ||
} | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.