This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
一 、Apache with passenger deploying rails project | |
1. 安装好 ror 环境 | |
bundle exec rake RAILS_ENV=production db:create | |
bundle exec rake RAILS_ENV=production db:migrate | |
2. 安装apache | |
sudo apt-get install apache2 apache2-mpm-prefork apache2-prefork-dev | |
3.安装 passenger | |
sudo gem install passenger | |
sudo passenger-install-apache2-module | |
4. 按照提示 编辑 httpd.conf ,并添加如下配置 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
模拟浏览器,人工测试 | |
1. 文本框: | |
直接填充 : fill_in("#{@user.id}_name",:with=>"jdo") | |
通过节点赋值 : find(:xpath,"//html/body/div[2]/div[2]/div/div/div[3]").set("123456") | |
获取文本框值: find(:xpath,"//html/body/div[2]/div[2]/div/div/div[3]").value.should=="expect value" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Scripting | |
一、In drivers which support it, you can easily execute JavaScript: | |
page.execute_script("$('body').empty()") | |
For simple expressions, you can return the result of the script. Note that this may break with more complicated expressions: | |
result = page.evaluate_script('4 + 4'); | |
二、 page.execute_script("$('div:eq(0)').length") | |
page.execute_script("document.getElementById('wrapper')") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Ubuntu下Git服务器安装与配置 | |
1. 安装 | |
1.1 安装Git-Core: | |
sudo apt-get install git-core | |
1.2 安装 Gitosis | |
sudo apt-get install python-setuptools | |
mkdir ~/src | |
cd ~/src | |
git clone git://eagain.net/gitosis |
NewerOlder