搭建cucumber測試環境

一、到ruby官網下載ruby,並安裝 git

二、下載DevKit,並解壓ruby安裝目錄的任意目錄下,eg.kit目錄下分別運行 github

ruby dk.rb init
ruby dk.rb install


三、安裝所須要的gem包 web

1)安裝以前會遇到的問題 shell

ERROR:  While executing gem ... (Gem::RemoteFetcher::FetchError)
    SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed (https://api.rubygem
s.org/specs.4.8.gz)

解決辦法,參考網站 api

This assumes your have already installed the Rails Installer for Windows. ruby

Download the ruby script to your Desktop folder fromhttps://gist.github.com/raw/867550/win_fetch_cacerts.rb. Then in your command prompt, execute the ruby script: session

ruby "%USERPROFILE%\Desktop\win_fetch_cacerts.rb"

Now make ruby aware of your certificate authority bundle by setting SSL_CERT_FILE. To set this in your current command prompt session, type: fetch

set SSL_CERT_FILE=C:\RailsInstaller\cacert.pem
gem update --system
gem install rspec --no-ri --no-rdoc
gem install win32console --no-ri --no-rdoc
gem install watir-webdriver --no-ri --no-rdoc
gem install cucumber --no-ri --no-rdoc
  4 .這樣就安裝成功了,能夠用下面命令查看Cucumber的版本

cucumber --version
相關文章
相關標籤/搜索