Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
ffdf8af3
X
Xts Acts
项目概览
OpenHarmony
/
Xts Acts
1 年多 前同步成功
通知
9
Star
22
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
X
Xts Acts
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
ffdf8af3
编写于
8月 04, 2022
作者:
Z
zhangjing
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
用例增加注释
Signed-off-by:
N
zhangjing
<
zhangjing403@huawei.com
>
上级
ecdacc92
变更
1
显示空白变更内容
内联
并排
Showing
1 changed file
with
96 addition
and
0 deletion
+96
-0
arkui/ace_ets_web_dev/entry/src/main/ets/test/WebJsunit.test.ets
...ce_ets_web_dev/entry/src/main/ets/test/WebJsunit.test.ets
+96
-0
未找到文件。
arkui/ace_ets_web_dev/entry/src/main/ets/test/WebJsunit.test.ets
浏览文件 @
ffdf8af3
...
...
@@ -44,102 +44,198 @@ export default function webJsunit() {
await Utils.sleep(2000);
done();
})
/*
*tc.number SUB_ACE_BASIC_ETS_API_001
*tc.name userAgent
*tc.desic Sets the Web's user agent
*/
it('userAgent',0,async function(done){
emitKey="emitJavaScriptProxy";
let userAgent="\"Mozila/5.0 (Linux; Andriod 9; VRD-AL10; HMSCore 6.3.0.331) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.105 HuaweiBrowser/12.0.4.1 MobileSafari/537.36\"";
Utils.registerEvent("",userAgent,100,done);
sendEventByKey('webcomponent',10,'');
})
/*
*tc.number SUB_ACE_BASIC_ETS_API_002
*tc.name javaScriptProxy *tc.desic Injects the JavaScript object into window and invoke the function in window
*/
it('javaScriptProxy',0,async function(done){
emitKey="emitOnUrlLoadIntercept";
Utils.registerEvent("javaScriptProxy","backToEts",102,done);
sendEventByKey('webcomponent',10,'');
})
/*
*tc.number SUB_ACE_BASIC_ETS_API_003
*tc.name onUrlLoadIntercept *tc.desic Triggered when the URL loading is intercepted
*/
it('onUrlLoadIntercept',0,async function(done){
emitKey="emitOnRenderExited";
Utils.registerEvent("onUrlLoadIntercept","https://www.gitee.com",104,done);
sendEventByKey('webcomponent',10,'');
})
/*
*tc.number SUB_ACE_BASIC_ETS_API_004
*tc.name onRenderExited
*tc.desic Triggered when the render process exits
*/
it('onRenderExited',0,async function(done){
emitKey="emitOnResourceLoad";
Utils.registerEvent("onRenderExited",2,106,done);
sendEventByKey('webcomponent',10,'');
})
/*
*tc.number SUB_ACE_BASIC_ETS_API_005
*tc.name onResourceLoad
*tc.desic Triggered when the url loading
*/
it('onResourceLoad',0,async function(done){
emitKey="emitLoadUrl";
Utils.registerEvent("onResourceLoad","file:///data/storage/el1/bundle/phone/resources/rawfile/second.html",108,done);
sendEventByKey('webcomponent',10,'');
})
/*
*tc.number SUB_ACE_BASIC_ETS_API_006
*tc.name loadUrl
*tc.desic Loads the given URL
*/
it('loadUrl',0,async function(done){
emitKey="emitRunJavaScript";
Utils.registerEvent("loadUrl","基于Git的代码托管和研发协作平台--Gitee | Software Development and Collaboration Platform",110,done);
sendEventByKey('webcomponent',10,'');
})
/*
*tc.number SUB_ACE_BASIC_ETS_API_007
*tc.name runJavaScript
*tc.desic Loads a piece of code and execute JS code in the context of the currently displayed page
*/
it('runJavaScript',0,async function(done){
emitKey="emitOnProgressChange";
Utils.registerEvent("runJavaScript","\"testRunJavaScript\"",112,done);
sendEventByKey('webcomponent',10,'');
})
/*
*tc.number SUB_ACE_BASIC_ETS_API_008
*tc.name onProgressChange *tc.desic Triggered when the page loading progress changes
*/
it('onProgressChange',0,async function(done){
emitKey="emitOnRefreshAccessedHistory";
Utils.registerEvent("onProgressChange","100",114,done);
sendEventByKey('webcomponent',10,'');
})
/*
*tc.number SUB_ACE_BASIC_ETS_API_009
*tc.name onRefreshAccessedHistory *tc.desic Triggered when the Web page refreshes accessed history
*/
it('onRefreshAccessedHistory',0,async function(done){
emitKey="emitGetHitTest";
Utils.registerEvent("onRefreshAccessedHistory","file:///data/storage/el1/bundle/phone/resources/rawfile/second.html",116,done);
sendEventByKey('webcomponent',10,'');
})
/*
*tc.number SUB_ACE_BASIC_ETS_API_010
*tc.name getHitTest
*tc.desic Gets the type of HitTest
*/
it('getHitTest',0,async function(done){
emitKey="emitGetWebId";
Utils.registerEvent("getHitTest","7",118,done);
sendEventByKey('webcomponent',10,'');
})
/*
*tc.number SUB_ACE_BASIC_ETS_API_011
*tc.name getWebId
*tc.desic Gets the id for the current Web
*/
it('getWebId',0,async function(done){
emitKey="emitGetTitle";
Utils.registerEvent("getWebId","1",120,done);
sendEventByKey('webcomponent',10,'');
})
/*
*tc.number SUB_ACE_BASIC_ETS_API_012
*tc.name getTitle
*tc.desic Gets the title of current Web page
*/
it('getTitle',0,async function(done){
emitKey="emitGetPageHeight";
Utils.registerEvent("getTitle","index",122,done);
sendEventByKey('webcomponent',10,'');
})
/*
*tc.number SUB_ACE_BASIC_ETS_API_013
*tc.name getPageHeight
*tc.desic Gets the content height of current Web page
*/
it('getPageHeight',0,async function(done){
emitKey="emitGetRequestFocus";
Utils.registerEvent("getPageHeight","true",124,done);
sendEventByKey('webcomponent',10,'');
})
/*
*tc.number SUB_ACE_BASIC_ETS_API_014
*tc.name requestFocus
*tc.desic Gets the request focus
*/
it('requestFocus',0,async function(done){
emitKey="emitAccessBackward";
Utils.registerEvent("requestFocus","requestFocus",126,done);
sendEventByKey('webcomponent',10,'');
})
/*
*tc.number SUB_ACE_BASIC_ETS_API_015
*tc.name accessBackward
*tc.desic Checks whether the web page can go back
*/
it('accessBackward',0,async function(done){
emitKey="emitAccessForward";
Utils.registerEvent("accessBackward","true",128,done);
sendEventByKey('webcomponent',10,'');
})
/*
*tc.number SUB_ACE_BASIC_ETS_API_016
*tc.name accessForward
*tc.desic Checks whether the web page can go forward
*/
it('accessForward',0,async function(done){
emitKey="emitAccessStep";
Utils.registerEvent("accessForward","false",130,done);
sendEventByKey('webcomponent',10,'');
})
/*
*tc.number SUB_ACE_BASIC_ETS_API_017
*tc.name accessStep
*tc.desic Checks whether the web page can go back or forward the given number of steps
*/
it('accessStep',0,async function(done){
emitKey="emitBackward";
Utils.registerEvent("accessStep","true",132,done);
sendEventByKey('webcomponent',10,'');
})
/*
*tc.number SUB_ACE_BASIC_ETS_API_018
*tc.name backward
*tc.desic Goes back in the history of the web page
*/
it('backward',0,async function(done){
emitKey="emitForward";
Utils.registerEvent("backward","index",134,done);
sendEventByKey('webcomponent',10,'');
})
/*
*tc.number SUB_ACE_BASIC_ETS_API_019
*tc.name forward
*tc.desic Goes forward in the history of the web page
*/
it('forward',0,async function(done){
emitKey="emitBackOrForward";
Utils.registerEvent("forward","second",136,done);
sendEventByKey('webcomponent',10,'');
})
/*
*tc.number SUB_ACE_BASIC_ETS_API_020
*tc.name backOrForward
*tc.desic Goes forward or back backOrForward in the history of the web page
*/
it('backOrForward',0,async function(done){
emitKey="emitBackOrForward";
Utils.registerEvent("backOrForward","index",138,done);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录