用于本地测试的miq selenium服务器
miqsel的Python项目详细描述
工信部
miq硒服务器
简单的命令行应用程序来旋转selenium docker container并提供vnc
访问。
先决条件:
docker:
要设置
docker
环境,请执行以下步骤:- 设置存储库:
sudo dnf -y install dnf-plugins-core sudo dnf config-manager --add-repo https://download.docker.com/linux/fedora/docker-ce.repo
- 安装以下软件包:
sudo dnf -y install docker-ce sudo systemctl start docker sudo systemctl enable docker
- 使用非根用户运行Docker:
sudo groupadd docker sudo usermod -aG docker <non-root-user>
tigervnc查看器:
- 软呢帽:
sudo dnf install tigervnc
- TigerVNC link for other Distro's
- 软呢帽:
安装:
pip install miqsel --user
或
pip install git+https://github.com/digitronik/miqsel#egg=miqsel --user
用法:
❯❯❯ miqsel --help Usage: miqsel [OPTIONS] COMMAND [ARGS]... Miq Selenium Server Options: --version Show the version and exit. --help Show this message and exit. Commands: appliance Appliance browser Set Browser config Configure Miq Selenium Server executor Selenium executor URL start Start Selenium Server status Status of Selenium Server stop Stop Selenium Server viewer VNC viewer vnc VNC URL
配置: 如果项目目录
not set
,则miqsel
需要从integration_tests
项目目录运行。它将有助于管理env.local.yaml
❯❯❯ miqsel config Miq project working dir: /home/.../integration_tests
状态: 检查硒容器的状态(运行/停止)
❯❯❯ miqsel status stopped
开始/停止: start将在
env.local.yaml
中设置命令执行器,并提供vnc
访问权限。❯❯❯ miqsel start Selenium Server started TigerVNC Viewer 64-bit v1.9.0 ❯❯❯ miqsel stop Sun Apr 2812:29:02 2019 CConn: End of stream Selenium Server stopped
设备: 检查当前设备或设置新设备。
❯❯❯ miqsel appliance ❯❯❯ miqsel appliance -s 192.168.1.1 Appliance set to 192.168.1.1 ❯❯❯ miqsel appliance 192.168.1.1
浏览器: 检查当前浏览器或设置其他浏览器
❯❯❯ miqsel browser chrome ❯❯❯ miqsel browser --firefox Browser set to firefox ❯❯❯ miqsel browser firefox
viewer: 访问selenium服务器。在selenium服务器启动时,vnc查看器将自动
invoked
。 如果status
是running
,viewer
是close
,那么viewer命令将帮助重新打开vnc会话。❯❯❯ miqsel status running ❯❯❯ miqsel viewer TigerVNC Viewer 64-bit v1.9.0
执行器: 获取命令执行器url
❯❯❯ miqsel executor http://172.17.0.2:4444/wd/hub
vnc: 获取vnc会话url
❯❯❯ miqsel vnc 172.17.0.2:5999