Skip to content

Commit 688131f

Browse files
committed
docker-compose support added
1 parent 3c0ca82 commit 688131f

File tree

2 files changed

+42
-1
lines changed

2 files changed

+42
-1
lines changed

docs/compose.rst

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
Docker compose support
2+
======================
3+
4+
Allows to spin up services configured via docker-compose.yml
5+
6+
Example docker-compose.yml for grid
7+
-----------------------------------
8+
9+
::
10+
11+
hub:
12+
image: selenium/hub
13+
ports:
14+
- "4444:4444"
15+
firefox:
16+
image: selenium/node-firefox
17+
links:
18+
- hub
19+
expose:
20+
- "5555"
21+
chrome:
22+
image: selenium/node-chrome
23+
links:
24+
- hub
25+
expose:
26+
- "5555"
27+
28+
Code
29+
----
30+
31+
::
32+
33+
compose = DockerCompose("/home/project")
34+
with compose:
35+
host = compose.get_service_host("hub", 4444)
36+
port = compose.get_service_port("hub", 4444)
37+
driver = webdriver.Remote(
38+
command_executor=("http://{}:{}/wd/hub".format(host,port)),
39+
desired_capabilities=CHROME)
40+
driver.get("http://automation-remarks.com")
41+

docs/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,4 +44,4 @@ Usage modes
4444
Database containers <database>
4545
Selenium containers <selenium>
4646
Generic containers <generic>
47-
47+
Docker Compose <compose>

0 commit comments

Comments
 (0)