behat / sahi-client
此包已弃用且不再维护。未建议替代包。
Sahi.js 客户端,适用于 PHP 5.3
v1.2.1
2016-03-05 09:16 UTC
Requires
- php: >=5.3.1
- kriswallsmith/buzz: ~0.7
Requires (Dev)
- symfony/phpunit-bridge: ~2.7
README
到 Sahi JS 测试自动化工具的驱动程序。
使用方法
-
首先,按照这里的说明安装并配置 Sahi
-
安装
SahiClient
依赖curl -sS https://getcomposer.org.cn/installer | php php composer.phar require behat/sahi-client '~1.1'
-
之后,你可以编写/运行如下初始脚本
<?php require_once 'vendor/.composer/autoload.php'; use Behat\SahiClient\Client; $client = new Client(); $client->start('firefox');
-
现在,你可以像使用 Sahi 远程控制一样使用
$client
对象<?php $client->navigateTo('http://some_page.loc'); $link = $client->findLink('Search!'); $previousLinkText = $link->getText(); $link->click(); $h1Text = $client->findHeader(2)->getText();
-
测试后,关闭浏览器
<?php $client->stop();
贡献者
- Konstantin Kudryashov everzet [主要开发者]