我的机器上安装了两个版本的Python(版本2.6和2.5).我想为一个项目运行2.6,为另一个项目运行2.5.
如何指定要使用的内容?
我正在使用Windows XP SP2.
我正在使用黄瓜和水豚.在rails 3.0.9平台上.我得到这个测试用例失败:日志是:
(::) failed steps (::)
No route matches "/wiki/Baltimore_Ravens" (ActionController::RoutingError)
<internal:prelude>:10:in `synchronize'
./features/step_definitions/web_steps.rb:20:in `/^(?:|I )am on (.+)$/'
features/annotate.feature:7:in `Given I am on a web page'
Failing Scenarios:
cucumber features/annotate.feature:11 # Scenario: launch annotation/ logged in
6 scenarios (1 failed, 5 skipped)
63 steps (1 failed, 62 skipped)
Run Code Online (Sandbox Code Playgroud)
文件web_steps:得到这段代码:
19 Given /^(?:|I )am on (.+)$/ do |page_name|
20 visit path_to(page_name)
21 end
Run Code Online (Sandbox Code Playgroud)
文件annotate.feature得到了这段代码:
7 Given I am on a web page
Run Code Online (Sandbox Code Playgroud)
"web页面"在support/paths.rb中定义为:
when /a web page/
'http://en.wikipedia.org/wiki/Baltimore_Ravens'
Run Code Online (Sandbox Code Playgroud)
显然这是一个外部网址.我想打开它,水豚和黄瓜不允许我这样做.所以,帮我找一个在黄瓜测试案例中打开外网的方法!
当我尝试运行此测试用例时出现此错误:这是在我的django应用程序的tests.py中写的:
def test_accounts_register( self ):
self.url = 'http://royalflag.com.pk/accounts/register/'
self.c = Client()
self.values = {
'email': 'bilal@gmail.com',
'first_name': 'bilal',
'last_name': 'bash',
'password1': 'bilal',
'password2': 'bilal',
}
self.response = self.c.post( self.url, self.values )
Run Code Online (Sandbox Code Playgroud)
我的django版本是1.2.1和python 2.6,satchmo版本是0.9.2-pre hg-unknown
完整的错误日志是:
.E....
======================================================================
ERROR: test_accounts_register (administration.tests.AccountsRegisterTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
File "C:\pytho\satchmo\administration\tests.py", line 53, in test_accounts_reg
ister
self.response = self.c.get( self.url )
File "C:\django\django\test\client.py", line 290, in get
response = self.request(**r)
File "C:\django\django\test\client.py", line 230, in request
response = self.handler(environ)
File "C:\django\django\test\client.py", line 74, …Run Code Online (Sandbox Code Playgroud) 当我通过键入运行测试用例时
python manage.py test myapp
Run Code Online (Sandbox Code Playgroud)
测试用例完成后,django test runner默认删除了测试数据库.我不希望它被删除.
我可以使用任何数据库!
我想保留我的数据库,因为数据库中存在我想在创建的数据库中看到的错误.这样我就可以找到它们!
我正在使用caoybara,硒和黄瓜.我单击一个带有"确定"按钮的警告框.帮我解决这个代码没有点击按钮:
page.evaluate_script('window.confirm = function() { return true; }')
page.click("Ok")
Run Code Online (Sandbox Code Playgroud) python ×3
capybara ×2
cucumber ×2
django ×2
satchmo ×2
python-2.x ×1
python-3.x ×1
ruby ×1
selenium ×1
windows ×1