Skip to content

Commit

Permalink
更新至f2etest v3.2
Browse files Browse the repository at this point in the history
调整单元测试方案为Karma
自测云独立为产品:UI Recorder
  • Loading branch information
yaniswang committed Aug 16, 2016
1 parent 57e5220 commit 5e829ef
Show file tree
Hide file tree
Showing 94 changed files with 343 additions and 56,848 deletions.
9 changes: 4 additions & 5 deletions INSTALL.md
Expand Up @@ -127,7 +127,7 @@
3. 2008如果默认安装的是IE10浏览器,可以从安装补丁上卸载,从而降级到IE8,但是没办法降级到IE6或IE7
4. 建议在任务计划程序中添加每周磁盘碎片整理,以保持最高工作性能

IE浏览器安全级别低解决方案:
IE浏览器安全级别低解决方案(此步骤非常重要,如果不操作,会出现cookie无法写入)

1. 以桌面模式连接一个User用户
2. 按照需要自由配置IE
Expand Down Expand Up @@ -182,14 +182,13 @@

hostsShare-client的bat可直接复制f2etest-client/app/中的:`禁用代理.bat`

部署WebDriver云 & JS单元测试云 & 单测云
部署WebDriver云
===========================

1. 开启WebDriver功能:`conf/site.json`中的`wdEnabled``true`,此时重启f2etest-web,可以在上方菜单栏上看到:JS单测云 | WebDriver云
1. 开启WebDriver功能:`conf/site.json`中的`wdEnabled``true`,此时重启f2etest-web,可以在上方菜单栏上看到:WebDriver云
2. 初始化执行机节点:详细安装请查看[f2etest-client/f2etest-webdriver/节点部署教程.md](f2etest-client/f2etest-webdriver/节点部署教程.md)

经过上面的安装过程,我们的WebDriver云及JS单测云即已经部署完成,可以对外服务了。

经过上面的安装过程,我们的WebDriver云即已经部署完成,可以对外服务了。

f2etest v1.0.0系列如何升级到v2.0.0 v3.0.0
========================
Expand Down
139 changes: 44 additions & 95 deletions README.md
Expand Up @@ -8,7 +8,7 @@ F2etest是一个面向前端、测试、产品等岗位的多浏览器兼容性
注:F2e test = Front to End Test = 前端测试

浏览器云
------------------------
=================================

在之前,多浏览器兼容性人肉测试,我们一般有三种解决方案:

Expand Down Expand Up @@ -36,29 +36,55 @@ F2etest是一个面向前端、测试、产品等岗位的多浏览器兼容性
2. Windows Server: Server版Windows,最大化复用机器资源
3. hostsShare: 跨浏览器,跨服务器的hosts共享

自动化测试
-----------------------------
WebDriver云
=================================

WebDriver云利用Windows Server多用户的特性,将执行机的使用效率提升10倍以上。

之前1台执行机只能跑1个任务,现在同样的硬件配置,我们可以跑10个任务。

上面的截图看上去有88个执行机节点,传统情况下我们需要88台服务器。

但是我们实际上才5台!

相比较官方的Selenium Grid,我们有以下优势:

1. 10倍以上硬件利用率:传统WebDriver 1台执行机仅能跑1个Job,而我们一台机器可以高并发跑N个Job,这个N取决于机器配置,理论上硬件利用率相当于传统节点的10倍以上
2. 支持独立hosts绑定:每次申请节点时,可以指定不同的hosts绑定,保证同一台机器上不同节点的Job不会相互干扰
3. 所有节点支持远程在线调试:利用Guacamole的在线远程功能,当自动化出现问题时,我们能非常便利的对自动化进展进行即时监控和调试

UI Recorder
=================================

UI Recorder是一款几乎零成本的整体自动化测试解决方案,一次自测等于多次测试,测一个浏览器等于测多个浏览器!

我们的目标:让自测不要重复测!让自动化变成零成本!让自动化持续保障您的业务!

对于浏览器功能来讲,自动化一般分两种形式
以下是本产品的特点

1. 组件单元测试
2. UI自动化
1. 自测 = 自动化测试:对于开发人员来讲,自测是开发流程中缺一不可的过程,我们要实现的目标就是自测过程中即可同步的录制出自动化脚本,实现真正的零成本自动化
2. 无干扰录制:所作操作均无需交互干扰,鼠标、键盘、alert弹框、文件上传,完全按照正常自测流程操作即可(以下操作除外:悬停事件、断言、变量)
3. 本地生成脚本:录制的脚本存储在用户本机,用户可以自行在录制的基础上进行修改定制,更自由更开放
4. 丰富的断言:支持以下断言类型,val、text、displayed、enabled、selected、attr、css、url、title、cookie、localStorage、sessionStorage
5. 支持数据Mock:我们支持Faker变量功能,支持强大的数据Mock
6. 支持公共用例: 用例之间允许相互引用,可以将某些公用的操作步骤录制为公用用例,以进一步提升录制效率
7. 支持执行截图:每次执行后,允许生成截图日志,以方便出问题时排查诊断

无论哪种方式,F2etest都为您提供了最完美的整体解决方案。
要了解详细细节,可以查看我们的视频教程:[http://v.youku.com/v_show/id_XMTY4NTk5NjI4MA==.html](http://v.youku.com/v_show/id_XMTY4NTk5NjI4MA==.html)

我们拥有强大的JS单测云,让你的JS单元测试一键运行在云上所有浏览器,可视直观的查看代码覆盖率
UI Recorder目前已经对F2etest进行了解偶,在非F2etest环境下也可以使用,只要是标准WebDriver协议就行

自测云更让你能够零成本的完成自动化脚本的编写,轻松搞定质量保障问题。
仓库地址: [https://github.com/alibaba/uirecorder](https://github.com/alibaba/uirecorder)

成功案例
===================
=================================

[![imgs/alibaba.png](https://raw.githubusercontent.com/alibaba/f2etest/master/imgs/alibaba.png)](http://www.alibabagroup.com/)

如果您使用了我们的解决方案,请联系我们添加在此处。

产品截图
===================
=================================

浏览器云
-------------------
Expand All @@ -79,37 +105,20 @@ Mac:

![imgs/mac.jpg](https://raw.githubusercontent.com/alibaba/f2etest/master/imgs/mac.jpg)

JS单测云
--------------------

任务队列:

![imgs/jsunit1.jpg](https://raw.githubusercontent.com/alibaba/f2etest/master/imgs/jsunit1.jpg)


任务详情页面:

![imgs/jsunit2.jpg](https://raw.githubusercontent.com/alibaba/f2etest/master/imgs/jsunit2.jpg)

代码覆盖率:

![imgs/jsunit3.jpg](https://raw.githubusercontent.com/alibaba/f2etest/master/imgs/jsunit3.jpg)

命令行客户端:

![imgs/jsunit4.jpg](https://raw.githubusercontent.com/alibaba/f2etest/master/imgs/jsunit4.jpg)


WebDriver云
--------------------

![imgs/webdriver1.jpg](https://raw.githubusercontent.com/alibaba/f2etest/master/imgs/webdriver1.jpg)

Karma + F2etest
--------------------

自测云
![imgs/jsunit.png](imgs/jsunit.png)

UI Recorder
---------------------

自测云请查看视频教程[http://v.youku.com/v_show/id_XMTYzMjgyNzExMg==.html](http://v.youku.com/v_show/id_XMTYzMjgyNzExMg==.html)
UI Recorder请查看视频教程[http://v.youku.com/v_show/id_XMTY4NTk5NjI4MA==.html](http://v.youku.com/v_show/id_XMTY4NTk5NjI4MA==.html)

安全风险警示(非常重要)
==================
Expand All @@ -123,70 +132,11 @@ WebDriver云
3. 请将User用户之间做到完全隔离,仅提供User用户文件的访问权限,别的任何权限请勿多余授权
4. 请将f2etest-client仅设置为管理员拥有权限,防止API接口被恶意访问

安装
安装教程
===================

安装请前往安装教程页面:[INSTALL.md](INSTALL.md)

了解 WebDriver云 & JS单元测试云
=================================

f2etest v2.0.0我们添加了WebDriver云 & JS单元测试云两个重要子产品。

在这之前,我们一直都仅仅是一个手工测试的提效平台。

现在,我们终于开始有自动化的功能了。

WebDriver云:
-----------------------

WebDriver云利用Windows Server多用户的特性,将执行机的使用效率提升10倍以上。

之前1台执行机只能跑1个任务,现在同样的硬件配置,我们可以跑10个任务。

上面的截图看上去有88个执行机节点,传统情况下我们需要88台服务器。

但是我们实际上才5台!

相比较官方的Selenium Grid,我们有以下优势:

1. 10倍以上硬件利用率:传统WebDriver 1台执行机仅能跑1个Job,而我们一台机器可以高并发跑N个Job,这个N取决于机器配置,理论上硬件利用率相当于传统节点的10倍以上
2. 支持独立hosts绑定:每次申请节点时,可以指定不同的hosts绑定,保证同一台机器上不同节点的Job不会相互干扰
3. 所有节点支持远程在线调试:利用Guacamole的在线远程功能,当自动化出现问题时,我们能非常便利的对自动化进展进行即时监控和调试

JS单元测试云:
-----------------------

f2etest JS单测云,相比较互联网上现有的JS单测自动化解决方案,我们具有以下特点:

1. 真实WebDriver执行机:每次运行均为空白的真实浏览器环境,多个任务间完全隔离,不会相互影响
2. 便携的远程可视化调试:可以直接远程连接到执行机,进行可视化的调试
3. 支持用例详情查看:可以在云端方便的查看用例测试详情,对测试结果了如指掌
4. 支持JS代码覆盖率:云端可视化查看覆盖率结果,支持压缩代码美化,方便对压缩代码的覆盖率检测
5. 支持hosts绑定:每个任务可运行在自己的hosts环境下,互不影响
6. 支持以下主流JS单元测试框架:Mocha, Jasmine, QUnit,将来可以方便的适配更多单测框架


了解自测云
========================

从F2etest v3.0.0开始,我们拥有了一个强大的零成本自动化整体解决方案。

F2etest自测云是一款几乎零成本的整体自动化测试解决方案,自测云 = 自动化测试云

我们的目标:让自测不要重复测!让自动化变成零成本!让自测云持续保障您的业务!

以下是本产品的特点:

1. 自测 = 自动化测试:对于开发人员来讲,自测是开发流程中缺一不可的过程,我们要实现的目标就是自测过程中即可同步的录制出自动化脚本,实现真正的零成本自动化
2. 无干扰录制:所作操作均无需交互干扰,鼠标、键盘、alert弹框、文件上传,完全按照正常自测流程操作即可(以下操作除外:悬停事件、断言、变量)
3. 云录制:仅需安装一个npm包,即可完成录制,所有依赖均部署在F2etest云中,几乎零安装成本,快速上手自动化
4. 本地生成脚本:录制的脚本存储在用户本机,用户可以自行在录制的基础上进行修改定制,更自由更开放
5. 丰富的断言:支持以下断言类型,val、text、displayed、enabled、selected、attr、css、url、title、cookie、localStorage、sessionStorage
6. 支持数据Mock:我们支持[Faker变量](https://github.com/marak/Faker.js/)功能,支持强大的数据Mock

要了解详细细节,可以查看我们的视频教程:[http://v.youku.com/v_show/id_XMTYzMjgyNzExMg==.html](http://v.youku.com/v_show/id_XMTYzMjgyNzExMg==.html)

感谢
===================

Expand All @@ -197,5 +147,4 @@ F2etest自测云是一款几乎零成本的整体自动化测试解决方案,
* express: [https://github.com/expressjs/express](https://github.com/expressjs/express)
* jwebdriver: [https://github.com/yaniswang/jWebDriver](https://github.com/yaniswang/jWebDriver)
* mysql: [https://github.com/felixge/node-mysql](https://github.com/felixge/node-mysql)
* pagejsunit: [https://github.com/yaniswang/pageJsUnit](https://github.com/yaniswang/pageJsUnit)
* request: [https://github.com/request/request](https://github.com/request/request)

This file was deleted.

Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
9 changes: 9 additions & 0 deletions f2etest-client/f2etest-webdriver/rdp/initAllNodes.bat
@@ -0,0 +1,9 @@
@echo off
SETLOCAL ENABLEDELAYEDEXPANSION
for /f %%p in ('dir /b *.rdp') do (
set p=%%p
echo start /MAX C:\f2etest-webdriver\webdriver\opennode !p:~4,2! > "opennode!p:~4,2!.bat"
move "opennode!p:~4,2!.bat" "C:\Users\node!p:~4,2!\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup\opennode!p:~4,2!.bat"
start "" mstsc %%p
echo open %%p
)
Binary file modified f2etest-client/f2etest-webdriver/rdp/node01.rdp
Binary file not shown.
Binary file modified f2etest-client/f2etest-webdriver/rdp/node02.rdp
Binary file not shown.
Binary file modified f2etest-client/f2etest-webdriver/rdp/node03.rdp
Binary file not shown.
Binary file modified f2etest-client/f2etest-webdriver/rdp/node04.rdp
Binary file not shown.
Binary file modified f2etest-client/f2etest-webdriver/rdp/node05.rdp
Binary file not shown.
Binary file modified f2etest-client/f2etest-webdriver/rdp/node06.rdp
Binary file not shown.
Binary file modified f2etest-client/f2etest-webdriver/rdp/node07.rdp
Binary file not shown.
Binary file modified f2etest-client/f2etest-webdriver/rdp/node08.rdp
Binary file not shown.
Binary file modified f2etest-client/f2etest-webdriver/rdp/node09.rdp
Binary file not shown.
Binary file modified f2etest-client/f2etest-webdriver/rdp/node10.rdp
Binary file not shown.
Binary file modified f2etest-client/f2etest-webdriver/rdp/node11.rdp
Binary file not shown.
Binary file modified f2etest-client/f2etest-webdriver/rdp/node12.rdp
Binary file not shown.
Binary file modified f2etest-client/f2etest-webdriver/rdp/node13.rdp
Binary file not shown.
Binary file modified f2etest-client/f2etest-webdriver/rdp/node14.rdp
Binary file not shown.
Binary file modified f2etest-client/f2etest-webdriver/rdp/node15.rdp
Binary file not shown.
Binary file modified f2etest-client/f2etest-webdriver/rdp/node16.rdp
Binary file not shown.
66 changes: 43 additions & 23 deletions f2etest-client/f2etest-webdriver/webdriver/wdproxy.js
Expand Up @@ -33,30 +33,50 @@ var server = http.createServer(function(req, res){
var desiredCapabilities = json.desiredCapabilities;
var browserName = desiredCapabilities.browserName.toLowerCase();
var proxy = desiredCapabilities.proxy;
if(proxy && browserName === 'internet explorer'){
var proxyType = proxy.proxyType || '';
proxyType = proxyType.toLowerCase()
var proxyAutoconfigUrl = proxy.proxyAutoconfigUrl;
var httpProxy = proxy.httpProxy;
switch(proxyType){
case 'manual':
if(httpProxy){
setProxy(httpProxy);
}
break;
case 'pac':
if(proxyAutoconfigUrl){
setPac(proxyAutoconfigUrl);
}
break;
default:
disableProxy();
}
desiredCapabilities.proxy = {
'proxyType': 'SYSTEM'
};
body = JSON.stringify(json);
if(browserName === 'internet explorer'){
if(proxy){
var proxyType = proxy.proxyType || '';
proxyType = proxyType.toLowerCase()
var proxyAutoconfigUrl = proxy.proxyAutoconfigUrl;
var httpProxy = proxy.httpProxy;
switch(proxyType){
case 'manual':
if(httpProxy){
setProxy(httpProxy);
}
break;
case 'pac':
if(proxyAutoconfigUrl){
setPac(proxyAutoconfigUrl);
}
break;
}
desiredCapabilities.proxy = {
'proxyType': 'SYSTEM'
};
body = JSON.stringify(json);
}
else{
disableProxy();
}
}
else if(browserName === '360se'){
desiredCapabilities.browserName = 'chrome';
desiredCapabilities.chromeOptions = desiredCapabilities.chromeOptions || {};
desiredCapabilities.chromeOptions.binary = 'c:\\360\\360se6\\Application\\360se.exe';
body = JSON.stringify(json);
}
else if(browserName === '360chrome'){
desiredCapabilities.browserName = 'chrome';
desiredCapabilities.chromeOptions = desiredCapabilities.chromeOptions || {};
desiredCapabilities.chromeOptions.binary = 'c:\\360\\360Chrome\\Chrome\\Application\\360chrome.exe';
body = JSON.stringify(json);
}
else if(browserName === 'chrome'){
desiredCapabilities.chromeOptions = desiredCapabilities.chromeOptions || {};
desiredCapabilities.chromeOptions.args = ['--allow-no-sandbox-job'];
body = JSON.stringify(json);
}
}
catch(e){}
var headers = req.headers;
Expand Down
13 changes: 7 additions & 6 deletions f2etest-client/f2etest-webdriver/节点部署教程.md
Expand Up @@ -75,12 +75,13 @@ WebDriver云的客户端,可以根据需要和浏览器云部署在同一批
节点初始化
====================

1. 执行`firstInit\initAllNodes.bat`,会批量打开所有的节点账户远程界面,对所有用户进行初始化
2. 打开一次所有的IE浏览器,进行首次初始化,防止自动化时出现`首次使用向导`,导致自动化失败
3. 所有节点初始化完成后,将`rdp\openAllNode.bat`添加快捷方式到系统自动启动文件夹,以实现开机自动打开所有的WebDriver节点
4. 命令行输入:`netplwiz`,在高级用户控制面板中,取消对`“要使用本机,用户需输入用户名和密码(E)”`项的勾选
5. 系统将弹出窗口要求输入默认登录系统的用户名和密码,输入完成后点击确定
6. 重启操作系统,如果正常的话,所有节点在3分钟左右之后应该会自动启动
1. 登录Administrtor用户
2. 执行`rdp\initAllNodes.bat`,批量添加启动批处理
3. 打开一次所有的IE浏览器,进行首次初始化,防止自动化时出现`首次使用向导`,导致自动化失败
4. 所有节点初始化完成后,将`rdp\openAllNode.bat`添加快捷方式到Administrator账号的系统自动启动文件夹,以实现开机自动打开所有的WebDriver节点
5. 命令行输入:`netplwiz`,在高级用户控制面板中,取消对`“要使用本机,用户需输入用户名和密码(E)”`项的勾选
6. 系统将弹出窗口要求输入默认登录系统的用户名和密码,输入完成后点击确定
7. 重启操作系统,如果正常的话,所有节点在3分钟左右之后应该会自动启动

guacamole中添加当前节点
====================
Expand Down
4 changes: 0 additions & 4 deletions f2etest-recorder/buildcrx.bat

This file was deleted.

Binary file removed f2etest-recorder/chrome-extension/img/cancel.png
Binary file not shown.
Binary file removed f2etest-recorder/chrome-extension/img/end.png
Binary file not shown.
Binary file removed f2etest-recorder/chrome-extension/img/expect.png
Binary file not shown.
Binary file removed f2etest-recorder/chrome-extension/img/fail.png
Binary file not shown.
Binary file removed f2etest-recorder/chrome-extension/img/hover.png
Binary file not shown.
Binary file removed f2etest-recorder/chrome-extension/img/icon-128.png
Binary file not shown.
Binary file removed f2etest-recorder/chrome-extension/img/icon-64.png
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed f2etest-recorder/chrome-extension/img/icon.png
Binary file not shown.
Binary file removed f2etest-recorder/chrome-extension/img/module.png
Binary file not shown.
Binary file removed f2etest-recorder/chrome-extension/img/ok.png
Binary file not shown.
Binary file removed f2etest-recorder/chrome-extension/img/success.png
Binary file not shown.
Binary file removed f2etest-recorder/chrome-extension/img/vars.png
Binary file not shown.
Binary file removed f2etest-recorder/chrome-extension/img/warn.png
Binary file not shown.

0 comments on commit 5e829ef

Please sign in to comment.