我在使用代码时真的很新,我刚刚根据指南创建了我的第一个验收测试。 你可以看到,如果我使用非拉丁字母,测试将无法通过。但我在页面字符串“dneskaláska”。此外,您可以看到输出在控制台中的字母“á”以某种方式改变了。
$I = new AcceptanceTester($scenario);
$I->wantTo('perform actions and see result');
$I->amOnPage('/');
$I->see("dneska l", "h1");
$I->see("dneska", "h1");
$I->see("dneska láska", "h1");
您可以在此处查看输出:
There was 1 failure:
---------
1) Failed to perform actions and see result in WelcomeCept (tests\acceptance\WelcomeCept.php)
Step I see null,"h1"
Fail Failed asserting that any element by 'h1' on page /
+ <h1>dneska láska</h1>
contains text 'dneska lßska'
Scenario Steps:
4. $I->see(null,"h1") at tests\acceptance\WelcomeCept.php:7
3. $I->see("dneska","h1") at tests\acceptance\WelcomeCept.php:6
2. $I->see("dneska l","h1") at tests\acceptance\WelcomeCept.php:5
1. $I->amOnPage("/") at tests\acceptance\WelcomeCept.php:4
FAILURES!
Tests: 1, Assertions: 3, Failures: 1.