* gauge init -t
* 查看gauge支持的所有模板
![image](https://img.haomeiwen.com/i10517060/e8413bb62de8bbf1.jpg?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
* gauge init python_selenium
* pip3 install -r requirements.txt # 可以不用运行这一步!!
* requirements.txt 内容:
* getgauge
* selenium
* chromedriver_installer
* 注意,这里有个坑,运行这个,安装所需要的依赖后,默认是安装4getgauge 0.2.5版本
* 但是,这样的话,运行 gauge run specs ,会报错:
![image](https://img.haomeiwen.com/i10517060/c7030e785c06a012.jpg?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
* 解决办法如下图:
* 降级 0.2.5 -->>> 0.2.3
![image](https://img.haomeiwen.com/i10517060/bf77a60aa1e099c9.jpg?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
* 执行如下命令降级
![image](https://img.haomeiwen.com/i10517060/891ad5b7407cf73f.jpg?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
* 再次运行specs,成功!!
![image](https://img.haomeiwen.com/i10517060/d2ddb1f089f18d2c.jpg?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
* Python-Gauge, specs <--> step_impl (*.py located )
![image](https://img.haomeiwen.com/i10517060/c646a89f3734a5a2.jpg?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
* Java-Gauge, specs <--> src ( *.java located )
![image](https://img.haomeiwen.com/i10517060/3c67c8097ecf292d.jpg?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
* IDEA中,specs 中可以直接 ctrl + 右键点击,自动跳转; 目前pycharm中还没有这种插件支持!
![image](https://img.haomeiwen.com/i10517060/17184d5a98cfdec8.jpg?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
* ![image](https://img.haomeiwen.com/i10517060/8a9aa90faaa62d23.jpg?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
![image](https://img.haomeiwen.com/i10517060/e78bd25a96e55011.jpg?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
* Gauge does not not provide an assertion library. So you will have to use whatever python or use an external python module.
![image](https://img.haomeiwen.com/i10517060/fdd124334baa0715.jpg?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
* gauge run specs
![image](https://img.haomeiwen.com/i10517060/832366f5aa7a5000.jpg?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
网友评论