You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#### 2. Create your SeleniumBase Docker environment:
11
+
#### 2. Go to the SeleniumBase home directory on the command line, which is where [Dockerfile](https://github.com/seleniumbase/SeleniumBase/blob/master/Dockerfile) is located. (This assumes you've already cloned the SeleniumBase repo.)
##### (If your Docker environment ever goes down for any reason, you can bring it back up with a restart.)
16
-
17
-
docker-machine restart seleniumbase
18
-
19
-
#### 3. Configure your shell:
20
-
21
-
eval "$(docker-machine env seleniumbase)"
22
-
23
-
#### 4. Go to the SeleniumBase home directory on the command line, which is where [Dockerfile](https://github.com/seleniumbase/SeleniumBase/blob/master/Dockerfile) is located. (This assumes you've already cloned the SeleniumBase repo.)
24
-
25
-
#### 5. Create your Docker image from your Dockerfile: (Get ready to wait awhile)
13
+
#### 3. Create your Docker image from your Dockerfile: (Get ready to wait awhile)
26
14
27
15
docker build -t seleniumbase .
28
16
29
-
If running on an Apple M1 Mac, use this instead:
17
+
If running on an Apple M1/M2 Mac, use this instead:
#### 6. Run [the example test](https://github.com/seleniumbase/SeleniumBase/blob/master/examples/my_first_test.py) with Chrome inside your Docker: (Once the test completes after a few seconds, you'll automatically exit the Docker shell)
21
+
M1/M2 Mac users should also see [StackOverflow.com/a/76586216/7058266](https://stackoverflow.com/a/76586216/7058266) to **Enable Rosetta in Docker Desktop**. (Otherwise **you will** encounter errors like this when Chrome tries to launch: `"Chrome failed to start: crashed."`)
34
22
35
-
docker run seleniumbase ./run_docker_test_in_chrome.sh
36
-
37
-
#### 7. Now run the same test with Firefox inside your Docker:
23
+
#### 4. Run [the example test](https://github.com/seleniumbase/SeleniumBase/blob/master/examples/my_first_test.py) with Chrome inside your Docker: (Once the test completes after a few seconds, you'll automatically exit the Docker shell)
38
24
39
-
docker run seleniumbase ./run_docker_test_in_firefox.sh
25
+
docker run seleniumbase ./run_docker_test_in_chrome.sh
40
26
41
-
#### 8. You can also enter Docker and stay inside the shell:
27
+
#### 5. You can also enter Docker and stay inside the shell:
42
28
43
29
docker run -i -t seleniumbase
44
30
45
-
#### 9. Now you can run the example test from inside the Docker shell:
31
+
#### 6. Now you can run the example test from inside the Docker shell:
46
32
47
33
./run_docker_test_in_chrome.sh
48
34
49
-
#### 10. When you're satisfied, you may exit the Docker shell:
35
+
#### 7. When you're satisfied, you may exit the Docker shell:
50
36
51
37
exit
52
38
53
-
#### 11. (Optional) Since Docker images and containers take up a lot of space, you may want to clean up your machine from time to time when they’re not being used:
39
+
#### 8. (Optional) Since Docker images and containers take up a lot of space, you may want to clean up your machine from time to time when they’re not being used:
0 commit comments