我希望有人能帮助我,因为我真的正要在这张桌子上撞我的桌子:-(
我正在尝试让 fillFIeld 工作,但我似乎无法让它屈服。
seeInField 在同一个表单字段上工作,所以我认为我的定位等都很好。
我什至写了一个非常基本的测试来尝试其他规则。
的HTML...
<!DOCTYPE html>
<html>
<body>
<form id="SearchForm" action="" method="get">
<input type="text" name="search" value="abc" />
<button type="submit">Search</button>
</form>
</body>
</html>
考试...
//INSTANTIATE WEB GUY
$I = new WebGuy($scenario);
//DEFINE TEST
$I->wantTo('search from home');
//GET ON THE HOME PAGE
$I->amOnPage('/');
$I->seeInField('search', 'abc');
$I->fillField('search', 'def');
$I->seeInField('search', 'def');
输出...
Acceptance Tests (1) ---------------------------------------------------------------------------------------
Modules: PhpBrowser, WebHelper
------------------------------------------------------------------------------------------------------------
Trying to search from home (Search_From_Home_Page_Cept.php)
Scenario:
* I am on page "/__staging/"
* I see in field "search","abc"
* I fill field "search","def"
* I see in field "search","def"
FAIL
------------------------------------------------------------------------------------------------------------
Time: 25 ms, Memory: 12.25Mb
There was 1 failure:
---------
1) Failed to search from home in Search_From_Home_Page_Cept.php
Sorry, I couldn't see in field "search","def":
Failed asserting that two strings are equal.
--- Expected
+++ Actual
@@ @@
-'def'
+'abc'
Scenario Steps:
4. I see in field "search","def"
3. I fill field "search","def"
2. I see in field "search","abc"
1. I am on page "/__staging/"
FAILURES!
Tests: 1, Assertions: 2, Failures: 1.
我显然遗漏了一些非常明显的东西,但是花了几个小时在论坛上拖网并没有找到任何可以解决它的东西,我需要帮助!