我试图在验收测试中使用codeception。我决定将其与Selenium2一起使用。从环境:
acceptance.suite.yml:
class_name: WebGuy
modules:
enabled:
- Selenium2
- WebHelper
config:
Selenium2:
url: 'http://nemo.dev'
browser: firefox
delay: 1000
测试:<?php
$I = new WebGuy($scenario);
$I->wantTo('see text');
$I->amGoingTo('/');
$I->see('text');
构建并运行后,Firefox启动,显示空白页面,并退出。
在控制台:1) Couldn't see text in SigninCept.php
Guy couldn't see "text": 'text' in .
Failed asserting that response contains "text". Response was saved to 'log' directory.
Scenario Steps:
2. I see "text"
1. I am going to /
FAILURES!
Tests: 1, Assertions: 1, Failures: 1.
运行Mac OS X 10.8.3, selenium: selenium-server-standalone-2.32.0.jar, PHP 5.3.15。故障,日志中出现白屏截图,不了解情况
非常基本的问题。您应该指定起始页。总是这样。在命令行之前插入这一行。
$I->amOnPage('/');