Mink PHP 浏览器模拟测试开源项目

我要开发同款
匿名用户2015年05月05日
96阅读

技术信息

开源地址
https://github.com/minkphp/Mink
授权协议
MIT

作品详情

Mik是开源的PHP浏览器/控制器模拟测试工具。Mik可以模拟Web应用和浏览器之间的交互,测试Web应用的行为是否正确。

<?phpuse Behat\Mik\Mik,    Behat\Mik\Sessio,    Behat\Mik\Driver\GoutteDriver,    Behat\Mik\Driver\Goutte\Cliet as GoutteCliet;$startUrl = 'https://example.com';// iit Mik ad register sessios$mik = ew Mik(array(    'goutte1' => ew Sessio(ew GoutteDriver(ew GoutteCliet())),    'goutte2' => ew Sessio(ew GoutteDriver(ew GoutteCliet())),    'custom'  => ew Sessio(ew MyCustomDriver($startUrl))));// set the default sessio ame$mik->setDefaultSessioName('goutte2');// visit a page$mik->getSessio()->visit($startUrl);// call to getSessio() without argumet will always retur a default sessio if has oe (goutte2 here)$mik->getSessio()->getPage()->fidLik('Dowloads')->click();echo $mik->getSessio()->getPage()->getCotet();// call to getSessio() with argumet will retur sessio by its ame$mik->getSessio('custom')->getPage()->fidLik('Dowloads')->click();echo $mik->getSessio('custom')->getPage()->getCotet();// this all is doe to make possible mixig sessios$mik->getSessio('goutte1')->getPage()->fidLik('Chat')->click();$mik->getSessio('goutte2')->getPage()->fidLik('Chat')->click();

功能介绍

Mink 是开源的 PHP 浏览器/控制器 模拟测试工具。Mink 可以模拟 Web 应用和浏览器之间的交互,测试 Web 应用的行为是否正确。
<?php

use Behat\Min...

声明:本文仅代表作者观点,不代表本站立场。如果侵犯到您的合法权益,请联系我们删除侵权资源!如果遇到资源链接失效,请您通过评论或工单的方式通知管理员。未经允许,不得转载,本站所有资源文章禁止商业使用运营!
下载安装【程序员客栈】APP
实时对接需求、及时收发消息、丰富的开放项目需求、随时随地查看项目状态

评论