detro/phantomjs-jasminexml-example
Composer 安装命令:
composer require --dev detro/phantomjs-jasminexml-example
包简介
A phantomjs / jasminexml Javascript Testing example
README 文档
README
WARNING - WARNING - WARNING
When I wrote this the intention was to release an example of integration between PhantomJS, Maven and Jasmine. I had no desire to maintain another project, and I find it surprising how many refer to this as one.
Use this as inspiration, and then take off your way. I have closed the Issue Tracker.
P.S.: Yes, I should have probably released this as a Gist instead...
PhantomJS - Jasmine XML - Example Project Layout
Description
This is an example project layout, that realises JavaScript Unit Testing using Jasmine on the top of PhantomJS.
It is designed to be used standalone or within Maven.
Should work properly with PhantomJS version >=2.2.0.
Use Standalone
$ phantomjs test/phantomjs_jasminexml_runner.js test/test_runner.html xml_output_dir/
This will produce a set of XML outputs, one for every Jasmine Test Suite.
Use within Maven
The project already provides a pom.xml that does the trick. So a simple:
$ mvn test
or
$ mvn clean install
will launch the tests and, if they all pass, make the mvn build pass. If any test fails, the mvn build fails.
Internals
Well, explaining the internals of PhantomJS here is pointless, but to understand how this works, you need to understand a simple idea: PhantomJS provides a main "Javascript Context" from within which, the user is able to spawn a WebPage, effectively creating another "Javascript Context".
The new context has the following characteristics:
- isolated - the page doesn't know anything about phantom and phantom API
- controllable - the main phantom context provides API to control/influence the page context
So, how does it work?
The magic is done by 2 scripts:
test/phantomjs_jasminexml_runner.js
test/lib/jasmine-reporters/jasmine.phantomjs-reporter.js
jasmine.phantomjs-reporter.js is a plugin for Jasmine that saves the result of the
tests at the bottom of the webpage where the test runs.
phantomjs_jasminexml_runner.js instead runs the show, launches the tests,
extracts the result from the page, then saves it to the directory passed (see source).
Happy Testing ;-)
Licensing: Public Domain
The code of this project is relased under Public Domain and as such you are not required to do anything but use and enjoy it.
If, out of good will, want to put somewhere in your work a reference to this project as "inspiration", please feel free. But don't feel any obligation to do so.
detro/phantomjs-jasminexml-example 适用场景与选型建议
detro/phantomjs-jasminexml-example 是一款 基于 JavaScript 开发的 Composer 扩展包,目前已累计 4.04k 次下载、GitHub Stars 达 41, 最近一次更新时间为 2013 年 02 月 11 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「javascript」 「testing」 「jasmine」 「phantomjs」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 detro/phantomjs-jasminexml-example 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 detro/phantomjs-jasminexml-example 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 detro/phantomjs-jasminexml-example 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Generates a Blade directive exporting all of your named Laravel routes. Also provides a nice route() helper function in JavaScript.
Headless WebKit scriptable with a JavaScript API.
Testing Suite For Lumen like Laravel does.
Caching and compression for Twig assets (JavaScript and CSS).
A pretty nice way to expose your translation messages to your JavaScript.
The PHP SDK for Checkmango
统计信息
- 总下载量: 4.04k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 41
- 点击次数: 18
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: Unknown
- 更新时间: 2013-02-11