$ python3 -m venv selenium-venv
$ source selenium-venv/bin/active
$ pip3 install pytz jupyter selenium
# install local DasUITesting package
$ pip3 install .
$ make nb_convert_py
$ make configmap
$ oc apply -f selenium-chrome-standalone.yaml
$ oc apply -f selenium-py.yaml
$ oc logs selenium -f
Port 4444 is Remote Browser Driver port, 5900 is vnc server port. You can see browser behavior by using VNC viewer connect to localhost:5900.
$ cd selenium-script
$ docker run -ti -p 4444:4444 -p 5900:5900 --shm-size=2g --rm selenium/standalone-chrome-debug:latest
-
environment variables
CASE
:project
ornotebook
DAS_INSTANCE
: CPD instance URLDAS_USER
: CPD usernameDAS_PASSWORD
: CPD user passwordREMOTE_EXECUTOR
: Selenium remote browser driver. You can use docker command to create one.
-
run script
$ cd selenium-script $ docker run -ti --rm \ -v `pwd`:/tmp/selenium-script \ -e DAS_INSTANCE="https://cpd.org.tw" \ -e DAS_USER=user \ -e DAS_PASSWORD=password \ -e REMOTE_EXECUTOR="http://host.docker.internal:4444/wd/hub" \ -e CASE=notebook \ python:3-alpine sh /tmp/selenium-script/docker/bootstrap.sh