未验证 提交 5b087768 编写于 作者: O openharmony_ci 提交者: Gitee

!9396 切换模式

Merge pull request !9396 from youngshady/master
/node_modules
/oh_modules
/local.properties
/.idea
**/build
/.hvigor
.cxx
/.clangd
/.clang-format
/.clang-tidy
**/.test
\ No newline at end of file
# Copyright (c) 2021 Huawei Device Co., Ltd. # Copyright (C) 2023 Huawei Device Co., Ltd.
# Licensed under the Apache License, Version 2.0 (the "License"); # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. # you may not use this file except in compliance with the License.
# You may obtain a copy of the License at # You may obtain a copy of the License at
...@@ -10,26 +10,12 @@ ...@@ -10,26 +10,12 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
import("//test/xts/tools/build/suite.gni") import("//test/xts/tools/build/suite.gni")
ohos_js_app_suite("ActsAccessibleCaptionConfigurationTest") {
ohos_js_hap_suite("ActsAccessibleCaptionConfigurationTest") { test_hap = true
hap_profile = "./src/main/config.json" testonly = true
deps = [
":hjs_demo_js_assets",
":hjs_demo_resources",
]
certificate_profile = "./signature/openharmony_sx.p7b"
hap_name = "ActsAccessibleCaptionConfigurationTest" hap_name = "ActsAccessibleCaptionConfigurationTest"
part_name = "accessibility"
subsystem_name = "barrierfree" subsystem_name = "barrierfree"
} part_name = "accessibility"
ohos_js_assets("hjs_demo_js_assets") { certificate_profile = "./signature/openharmony_sx.p7b"
js2abc = true
hap_profile = "./src/main/config.json"
source_dir = "./src/main/js"
}
ohos_resources("hjs_demo_resources") {
sources = [ "./src/main/resources" ]
hap_profile = "./src/main/config.json"
} }
{ {
"description": "Configuration for hjunit demo Tests", "description":"Configuration for hjunit demo Tests",
"driver": { "driver":{
"type": "OHJSUnitTest", "type":"OHJSUnitTest",
"test-timeout": "180000", "test-timeout":"180000",
"shell-timeout": "180000", "shell-timeout":"180000",
"bundle-name": "com.example.accessiblecaptionconfiguration", "bundle-name":"com.example.accessiblecaptionconfiguration",
"package-name": "com.example.accessiblecaptionconfiguration" "package-name":"com.example.accessiblecaptionconfiguration_test"
}, },
"kits": [ "kits":[
{ {
"test-file-name": [ "test-file-name":[
"ActsAccessibleCaptionConfigurationTest.hap" "ActsAccessibleCaptionConfigurationTest.hap"
], ],
"type": "AppInstallKit", "type":"AppInstallKit",
"cleanup-apps": true "cleanup-apps":true
},{ },
"type": "ShellKit", {
"run-command": [ "type":"ShellKit",
"power-shell wakeup", "run-command":[
"power-shell setmode 602" "power-shell wakeup",
] "power-shell setmode 602"
} ]
] }
]
} }
\ No newline at end of file
/**
* Copyright (c) 2023 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
{
"app":{
"signingConfigs":[
],
"compileSdkVersion":10,
"compatibleSdkVersion":10,
"products":[
{
"name":"default",
"signingConfig":"default"
}
]
},
"modules":[
{
"name":"entry",
"srcPath":"./entry",
"targets":[
{
"name":"default",
"applyToProducts":[
"default"
]
}
]
}
]
}
\ No newline at end of file
/node_modules
/oh_modules
/.preview
/build
/.cxx
/.test
\ No newline at end of file
/**
* Copyright (c) 2023 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/ {
"apiType":"faMode",
"buildOption":{
},
"targets":[
{
"name":"default"
},
{
"name":"ohosTest"
}
]
}
\ No newline at end of file
/**
* Copyright (c) 2023 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// Script for compiling build behavior. It is built in the build plug-in and cannot be modified currently.
export { legacyHapTasks } from '@ohos/hvigor-ohos-plugin';
/**
* Copyright (c) 2023 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/ {
"license":"",
"devDependencies":{
},
"author":"",
"name":"entry",
"description":"Please describe the basic information.",
"main":"",
"version":"1.0.0",
"dependencies":{
}
}
\ No newline at end of file
{
"app":{
"bundleName":"com.example.accessiblecaptionconfiguration",
"vendor":"example",
"version":{
"code":1,
"name":"1.0"
}
},
"deviceConfig":{
},
"module":{
"package":"com.example.accessiblecaptionconfiguration",
"name":".entry",
"mainAbility":".MainAbility",
"deviceType":[
"tablet",
"default",
"phone"
],
"distro":{
"deliveryWithInstall":true,
"installationFree":false,
"moduleName":"entry",
"moduleType":"entry"
},
"abilities":[
{
"description":"$string:MainAbility_desc",
"formsEnabled":false,
"icon":"$media:icon",
"label":"$string:MainAbility_label",
"launchType":"standard",
"name":".MainAbility",
"orientation":"unspecified",
"skills":[
{
"actions":[
"action.system.home"
],
"entities":[
"entity.system.home"
]
}
],
"srcLanguage":"js",
"srcPath":"MainAbility",
"type":"page",
"visible":true
}
],
"js":[
{
"name":".MainAbility",
"pages":[
"pages/index/index"
],
"window":{
"autoDesignWidth":false,
"designWidth":720
}
}
]
}
}
\ No newline at end of file
/**
* Copyright (c) 2023 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import hilog from '@ohos.hilog';
export default {
onCreate() {
hilog.info(0x0000, 'testTag', '%{public}s', 'Application onCreate');
},
onDestroy() {
hilog.info(0x0000, 'testTag', '%{public}s', 'Application onDestroy');
},
}
\ No newline at end of file
{
"strings": {
"hello": "Hello",
"world": "World"
}
}
\ No newline at end of file
{
"strings": {
"hello": "您好",
"world": "世界"
}
}
\ No newline at end of file
.container {
flex-direction: column;
justify-content: center;
align-items: center;
}
.title {
font-size: 100px;
}
<div class="container">
<text class="title">
{{title}}
</text>
</div>
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import file from '@system.file'
const injectRef = Object.getPrototypeOf(global) || global
injectRef.regeneratorRuntime = require('@babel/runtime/regenerator')
export default {
data: {
title: "Accessbility js test"
},
onInit() {
this.title = "Accessbility js test";
},
onShow() {
console.info('onShow finish')
},
onReady() {
},
}
\ No newline at end of file
{
"string": [
{
"name": "app_name",
"value": "ActsSetCheckSyncEnable"
},
{
"name": "mainability_description",
"value": "JS_Phone_Empty Feature Ability"
},
{
"name": "MainAbility_desc",
"value": "description"
},
{
"name": "MainAbility_label",
"value": "label"
},
{
"name": "TestAbility_desc",
"value": "description"
},
{
"name": "TestAbility_label",
"value": "label"
}
]
}
\ No newline at end of file
{
"app":{
"bundleName":"com.example.accessiblecaptionconfiguration",
"vendor":"example",
"version":{
"code":1,
"name":"1.0"
}
},
"deviceConfig":{
},
"module":{
"package":"com.example.accessiblecaptionconfiguration_test",
"name":".entry_test",
"mainAbility":".TestAbility",
"deviceType":[
"tablet",
"default",
"phone"
],
"reqPermissions":[
{
"name":"ohos.permission.DISTRIBUTED_DATASYNC",
"reason":"ceshi"
}
],
"testRunner":{
"name":"OpenHarmonyTestRunner",
"srcPath":"TestRunner"
},
"distro":{
"deliveryWithInstall":true,
"installationFree":false,
"moduleName":"entry_test",
"moduleType":"feature"
},
"abilities":[
{
"description":"$string:TestAbility_desc",
"formsEnabled":false,
"icon":"$media:icon",
"label":"$string:TestAbility_label",
"launchType":"standard",
"name":".TestAbility",
"orientation":"unspecified",
"skills":[
{
"actions":[
"action.system.home"
],
"entities":[
"entity.system.home"
]
}
],
"srcLanguage":"js",
"srcPath":"TestAbility",
"type":"page",
"visible":true
}
],
"js":[
{
"name":".TestAbility",
"pages":[
"pages/index/index"
],
"window":{
"autoDesignWidth":false,
"designWidth":720
}
}
]
}
}
\ No newline at end of file
/* * Copyright (c) 2022 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ import AbilityDelegatorRegistry from '@ohos.app.ability.abilityDelegatorRegistry'import { Hypium } from '@ohos/hypium'import testsuite from '../test/List.test' export default { onCreate() { console.info('TestApplication onCreate') var abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() var abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments() console.info('start run testcase!!!') Hypium.hypiumTest(abilityDelegator, abilityDelegatorArguments, testsuite) }, onDestroy() { console.info("TestApplication onDestroy"); }};
\ No newline at end of file
{
"strings": {
"hello": "Hello",
"world": "World"
},
"Files": {
}
}
\ No newline at end of file
{
"strings": {
"hello": "您好",
"world": "世界"
},
"Files": {
}
}
\ No newline at end of file
.container {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
left: 0px;
top: 0px;
width: 100%;
height: 100%;
}
.title {
font-size: 60px;
text-align: center;
width: 100%;
height: 40%;
margin: 10px;
}
@media screen and (device-type: phone) and (orientation: landscape) {
.title {
font-size: 60px;
}
}
@media screen and (device-type: tablet) and (orientation: landscape) {
.title {
font-size: 100px;
}
}
\ No newline at end of file
<div class="container">
<text class="title">
{{ $t('strings.hello') }} {{ title }}
</text>
</div>
/*
* Copyright (c) 2022 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
export default {
data: {
title: ""
},
onInit() {
this.title = this.$t('strings.world');
}
}
/**
* Copyright (c) 2023 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import hilog from '@ohos.hilog';
import AbilityDelegatorRegistry from '@ohos.app.ability.abilityDelegatorRegistry';
export default {
onPrepare() {
hilog.info(0x0000, 'testTag', '%{public}s', 'OpenHarmonyTestRunner OnPrepare');
},
onRun() {
hilog.info(0x0000, 'testTag', '%{public}s', 'OpenHarmonyTestRunner onRun run');
var abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments()
var abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator()
var testAbilityName = abilityDelegatorArguments.parameters['-p'] + '.TestAbility'
var cmd = 'aa start -d 0 -a ' + testAbilityName + ' -b ' + abilityDelegatorArguments.bundleName
var debug = abilityDelegatorArguments.parameters["-D"]
if (debug == 'true')
{
cmd += ' -D'
}
hilog.info(0x0000, 'testTag', 'cmd : %{public}s', cmd);
abilityDelegator.executeShellCommand(cmd, (err, data) => {
hilog.info(0x0000, 'testTag', 'executeShellCommand : err : %{public}s', JSON.stringify(err) ?? '');
hilog.info(0x0000, 'testTag', 'executeShellCommand : data : %{public}s', data.stdResult ?? '');
hilog.info(0x0000, 'testTag', 'executeShellCommand : data : %{public}s', data.exitCode ?? '');
})
}
};
\ No newline at end of file
/*
* Copyright (C) 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from '@ohos/hypium'
import accessibility from '@ohos.accessibility'
export default function AccessibleCaptionConfiguration() {
describe('AccessibleCaptionConfiguration', function () {
beforeEach(async function (done) {
console.info(`AccessibleCaptionConfiguration: beforeEach starts`);
done();
})
afterEach(async function (done) {
console.info(`AccessibleCaptionConfiguration: afterEach starts`);
done();
})
/*
* @tc.number CaptionConfiguration_0010
* @tc.name CaptionConfiguration_0010
* @tc.desc The parameter input is 'enableChange', test the captionManager.on() function,
* and return undefined
* @tc.size SmallTest
* @tc.type User
*/
it('CaptionConfiguration_0010', 0, async function (done) {
console.info('CaptionConfiguration_0010');
let captionManager = accessibility.getCaptionsManager();
let stateEventType = 'enableChange';
let ret = captionManager.on(stateEventType, (data) => {});
expect(ret).assertEqual(undefined);
done();
})
/*
* @tc.number CaptionConfiguration_0020
* @tc.name CaptionConfiguration_0020
* @tc.desc The parameter input is 'styleChange', test the captionManager.on() function,
* and return undefined
* @tc.size SmallTest
* @tc.type User
*/
it('CaptionConfiguration_0020', 0, async function (done) {
console.info('CaptionConfiguration_0020');
let captionManager = accessibility.getCaptionsManager();
let stateEventType = 'styleChange';
let ret = captionManager.on(stateEventType, (data) => {});
expect(ret).assertEqual(undefined);
done();
})
/*
* @tc.number CaptionConfiguration_0050
* @tc.name CaptionConfiguration_0050
* @tc.desc The parameter input is 'enableChange', test the captionManager.off() function,
* and return undefined
* @tc.size SmallTest
* @tc.type User
*/
it('CaptionConfiguration_0050', 0, async function (done) {
console.info('CaptionConfiguration_0050');
let captionManager = accessibility.getCaptionsManager();
let stateEventType = 'enableChange';
let ret = captionManager.off(stateEventType, (data) => {});
expect(ret).assertEqual(undefined);
done();
})
/*
* @tc.number CaptionConfiguration_0060
* @tc.name CaptionConfiguration_0060
* @tc.desc The parameter input is 'styleChange', test the captionManager.off() function,
* and return undefined
* @tc.size SmallTest
* @tc.type User
*/
it('CaptionConfiguration_0060', 0, async function (done) {
console.info('CaptionConfiguration_0060');
let captionManager = accessibility.getCaptionsManager();
let stateEventType = 'styleChange';
let ret = captionManager.off(stateEventType, (data) => {});
expect(ret).assertEqual(undefined);
done();
})
})
}
/*
* Copyright (C) 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import AccessibleCaptionConfiguration from './AccessibleCaptionConfiguration.test.js'
export default function testsuite() {
AccessibleCaptionConfiguration()
}
{
"string": [
{
"name": "app_name",
"value": "ActsSetCheckSyncEnable"
},
{
"name": "mainability_description",
"value": "JS_Phone_Empty Feature Ability"
},
{
"name": "MainAbility_desc",
"value": "description"
},
{
"name": "MainAbility_label",
"value": "label"
},
{
"name": "TestAbility_desc",
"value": "description"
},
{
"name": "TestAbility_label",
"value": "label"
}
]
}
\ No newline at end of file
/**
* Copyright (c) 2023 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
{
"hvigorVersion": "2.4.2",
"dependencies": {
"@ohos/hvigor-ohos-plugin": "2.4.2"
}
}
/**
* Copyright (c) 2023 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// Script for compiling build behavior. It is built in the build plug-in and cannot be modified currently.
export { legacyAppTasks } from '@ohos/hvigor-ohos-plugin';
\ No newline at end of file
# Copyright (c) 2023 Huawei Device Co., Ltd.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#!/bin/bash
# ----------------------------------------------------------------------------
# Hvigor startup script, version 1.0.0
#
# Required ENV vars:
# ------------------
# NODE_HOME - location of a Node home dir
# or
# Add /usr/local/nodejs/bin to the PATH environment variable
# ----------------------------------------------------------------------------
HVIGOR_APP_HOME=$(dirname $(readlink -f $0))
HVIGOR_WRAPPER_SCRIPT=${HVIGOR_APP_HOME}/hvigor/hvigor-wrapper.js
warn() {
echo ""
echo -e "\033[1;33m`date '+[%Y-%m-%d %H:%M:%S]'`$@\033[0m"
}
error() {
echo ""
echo -e "\033[1;31m`date '+[%Y-%m-%d %H:%M:%S]'`$@\033[0m"
}
fail() {
error "$@"
exit 1
}
# Determine node to start hvigor wrapper script
if [ -n "${NODE_HOME}" ];then
EXECUTABLE_NODE="${NODE_HOME}/bin/node"
if [ ! -x "$EXECUTABLE_NODE" ];then
fail "ERROR: NODE_HOME is set to an invalid directory,check $NODE_HOME\n\nPlease set NODE_HOME in your environment to the location where your nodejs installed"
fi
else
EXECUTABLE_NODE="node"
which ${EXECUTABLE_NODE} > /dev/null 2>&1 || fail "ERROR: NODE_HOME is not set and not 'node' command found in your path"
fi
# Check hvigor wrapper script
if [ ! -r "$HVIGOR_WRAPPER_SCRIPT" ];then
fail "ERROR: Couldn't find hvigor/hvigor-wrapper.js in ${HVIGOR_APP_HOME}"
fi
# start hvigor-wrapper script
exec "${EXECUTABLE_NODE}" \
"${HVIGOR_WRAPPER_SCRIPT}" "$@"
@rem Copyright (C) 2023 Huawei Device Co., Ltd.
@rem Licensed under the Apache License, Version 2.0 (the "License");
@rem you may not use this file except in compliance with the License.
@rem You may obtain a copy of the License at
@rem
@rem http://www.apache.org/licenses/LICENSE-2.0
@rem
@rem Unless required by applicable law or agreed to in writing, software
@rem distributed under the License is distributed on an "AS IS" BASIS,
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@rem See the License for the specific language governing permissions and
@rem limitations under the License.
@if "%DEBUG%" == "" @echo off
@rem ##########################################################################
@rem
@rem Hvigor startup script for Windows
@rem
@rem ##########################################################################
@rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal
set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%
@rem Resolve any "." and ".." in APP_HOME to make it shorter.
for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
set WRAPPER_MODULE_PATH=%APP_HOME%\hvigor\hvigor-wrapper.js
set NODE_EXE=node.exe
goto start
:start
@rem Find node.exe
if defined NODE_HOME goto findNodeFromNodeHome
%NODE_EXE% --version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto execute
echo.
echo ERROR: NODE_HOME is not set and no 'node' command could be found in your PATH.
echo.
echo Please set the NODE_HOME variable in your environment to match the
echo location of your NodeJs installation.
goto fail
:findNodeFromNodeHome
set NODE_HOME=%NODE_HOME:"=%
set NODE_EXE_PATH=%NODE_HOME%/%NODE_EXE%
if exist "%NODE_EXE_PATH%" goto execute
echo.
echo ERROR: NODE_HOME is not set and no 'node' command could be found in your PATH.
echo.
echo Please set the NODE_HOME variable in your environment to match the
echo location of your NodeJs installation.
goto fail
:execute
@rem Execute hvigor
"%NODE_EXE%" %WRAPPER_MODULE_PATH% %*
:fail
exit /b 1
/*
* Copyright (C) 2023 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
{
"lockfileVersion": 1,
"ATTENTION": "THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.",
"specifiers": {
"@ohos/hypium@1.0.6": "@ohos/hypium@1.0.6"
},
"packages": {
"@ohos/hypium@1.0.6": {
"resolved": "https://repo.harmonyos.com/ohpm/@ohos/hypium/-/hypium-1.0.6.tgz",
"integrity": "sha512-bb3DWeWhYrFqj9mPFV3yZQpkm36kbcK+YYaeY9g292QKSjOdmhEIQR2ULPvyMsgSR4usOBf5nnYrDmaCCXirgQ=="
}
}
}
\ No newline at end of file
/**
* Copyright (c) 2023 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
{
"license": "",
"devDependencies": {
"@ohos/hypium": "1.0.6"
},
"author": "",
"name": "myapplication454434",
"description": "Please describe the basic information.",
"main": "",
"version": "1.0.0",
"dependencies": {}
}
/node_modules
/oh_modules
/local.properties
/.idea
**/build
/.hvigor
.cxx
/.clangd
/.clang-format
/.clang-tidy
**/.test
\ No newline at end of file
# Copyright (c) 2021 Huawei Device Co., Ltd. # Copyright (C) 2023 Huawei Device Co., Ltd.
# Licensed under the Apache License, Version 2.0 (the "License"); # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. # you may not use this file except in compliance with the License.
# You may obtain a copy of the License at # You may obtain a copy of the License at
...@@ -10,26 +10,12 @@ ...@@ -10,26 +10,12 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
import("//test/xts/tools/build/suite.gni") import("//test/xts/tools/build/suite.gni")
ohos_js_app_suite("ActsAccessibleCheckAbilityTest") {
ohos_js_hap_suite("ActsAccessibleCheckAbilityTest") { test_hap = true
hap_profile = "./src/main/config.json" testonly = true
deps = [
":hjs_demo_js_assets",
":hjs_demo_resources",
]
certificate_profile = "./signature/openharmony_sx.p7b"
hap_name = "ActsAccessibleCheckAbilityTest" hap_name = "ActsAccessibleCheckAbilityTest"
part_name = "accessibility"
subsystem_name = "barrierfree" subsystem_name = "barrierfree"
} part_name = "accessibility"
ohos_js_assets("hjs_demo_js_assets") { certificate_profile = "./signature/openharmony_sx.p7b"
js2abc = true
hap_profile = "./src/main/config.json"
source_dir = "./src/main/js"
}
ohos_resources("hjs_demo_resources") {
sources = [ "./src/main/resources" ]
hap_profile = "./src/main/config.json"
} }
{ {
"description": "Configuration for hjunit demo Tests", "description":"Configuration for hjunit demo Tests",
"driver": { "driver":{
"type": "OHJSUnitTest", "type":"OHJSUnitTest",
"test-timeout": "180000", "test-timeout":"180000",
"shell-timeout": "180000", "shell-timeout":"180000",
"bundle-name": "com.example.accessiblecheckability", "bundle-name":"com.example.accessiblecheckability",
"package-name": "com.example.accessiblecheckability" "package-name":"com.example.accessiblecheckability_test"
}, },
"kits": [ "kits":[
{ {
"test-file-name": [ "test-file-name":[
"ActsAccessibleCheckAbilityTest.hap" "ActsAccessibleCheckAbilityTest.hap"
], ],
"type": "AppInstallKit", "type":"AppInstallKit",
"cleanup-apps": true "cleanup-apps":true
},{ },
"type": "ShellKit", {
"run-command": [ "type":"ShellKit",
"power-shell wakeup", "run-command":[
"power-shell setmode 602" "power-shell wakeup",
] "power-shell setmode 602"
} ]
] }
]
} }
\ No newline at end of file
/**
* Copyright (c) 2023 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
{
"app":{
"signingConfigs":[
],
"compileSdkVersion":10,
"compatibleSdkVersion":10,
"products":[
{
"name":"default",
"signingConfig":"default"
}
]
},
"modules":[
{
"name":"entry",
"srcPath":"./entry",
"targets":[
{
"name":"default",
"applyToProducts":[
"default"
]
}
]
}
]
}
\ No newline at end of file
/node_modules
/oh_modules
/.preview
/build
/.cxx
/.test
\ No newline at end of file
/**
* Copyright (c) 2023 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/ {
"apiType":"faMode",
"buildOption":{
},
"targets":[
{
"name":"default"
},
{
"name":"ohosTest"
}
]
}
\ No newline at end of file
/**
* Copyright (c) 2023 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// Script for compiling build behavior. It is built in the build plug-in and cannot be modified currently.
export { legacyHapTasks } from '@ohos/hvigor-ohos-plugin';
/**
* Copyright (c) 2023 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/ {
"license":"",
"devDependencies":{
},
"author":"",
"name":"entry",
"description":"Please describe the basic information.",
"main":"",
"version":"1.0.0",
"dependencies":{
}
}
\ No newline at end of file
{
"app":{
"bundleName":"com.example.accessiblecheckability",
"vendor":"example",
"version":{
"code":1,
"name":"1.0"
}
},
"deviceConfig":{
},
"module":{
"package":"com.example.accessiblecheckability",
"name":".entry",
"mainAbility":".MainAbility",
"deviceType":[
"tablet",
"default",
"phone"
],
"distro":{
"deliveryWithInstall":true,
"installationFree":false,
"moduleName":"entry",
"moduleType":"entry"
},
"abilities":[
{
"description":"$string:MainAbility_desc",
"formsEnabled":false,
"icon":"$media:icon",
"label":"$string:MainAbility_label",
"launchType":"standard",
"name":".MainAbility",
"orientation":"unspecified",
"skills":[
{
"actions":[
"action.system.home"
],
"entities":[
"entity.system.home"
]
}
],
"srcLanguage":"js",
"srcPath":"MainAbility",
"type":"page",
"visible":true
}
],
"js":[
{
"name":".MainAbility",
"pages":[
"pages/index/index"
],
"window":{
"autoDesignWidth":false,
"designWidth":720
}
}
]
}
}
\ No newline at end of file
/**
* Copyright (c) 2023 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import hilog from '@ohos.hilog';
export default {
onCreate() {
hilog.info(0x0000, 'testTag', '%{public}s', 'Application onCreate');
},
onDestroy() {
hilog.info(0x0000, 'testTag', '%{public}s', 'Application onDestroy');
},
}
\ No newline at end of file
{
"strings": {
"hello": "Hello",
"world": "World"
}
}
\ No newline at end of file
{
"strings": {
"hello": "您好",
"world": "世界"
}
}
\ No newline at end of file
.container {
flex-direction: column;
justify-content: center;
align-items: center;
}
.title {
font-size: 100px;
}
<div class="container">
<text class="title">
{{title}}
</text>
</div>
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import file from '@system.file'
const injectRef = Object.getPrototypeOf(global) || global
injectRef.regeneratorRuntime = require('@babel/runtime/regenerator')
export default {
data: {
title: "Accessbility js test"
},
onInit() {
this.title = "Accessbility js test";
},
onShow() {
console.info('onShow finish')
},
onReady() {
},
}
\ No newline at end of file
{
"string": [
{
"name": "app_name",
"value": "ActsSetCheckSyncEnable"
},
{
"name": "mainability_description",
"value": "JS_Phone_Empty Feature Ability"
},
{
"name": "MainAbility_desc",
"value": "description"
},
{
"name": "MainAbility_label",
"value": "label"
},
{
"name": "TestAbility_desc",
"value": "description"
},
{
"name": "TestAbility_label",
"value": "label"
}
]
}
\ No newline at end of file
{
"app":{
"bundleName":"com.example.accessiblecheckability",
"vendor":"example",
"version":{
"code":1,
"name":"1.0"
}
},
"deviceConfig":{
},
"module":{
"package":"com.example.accessiblecheckability_test",
"name":".entry_test",
"mainAbility":".TestAbility",
"deviceType":[
"tablet",
"default",
"phone"
],
"reqPermissions":[
{
"name":"ohos.permission.DISTRIBUTED_DATASYNC",
"reason":"ceshi"
}
],
"testRunner":{
"name":"OpenHarmonyTestRunner",
"srcPath":"TestRunner"
},
"distro":{
"deliveryWithInstall":true,
"installationFree":false,
"moduleName":"entry_test",
"moduleType":"feature"
},
"abilities":[
{
"description":"$string:TestAbility_desc",
"formsEnabled":false,
"icon":"$media:icon",
"label":"$string:TestAbility_label",
"launchType":"standard",
"name":".TestAbility",
"orientation":"unspecified",
"skills":[
{
"actions":[
"action.system.home"
],
"entities":[
"entity.system.home"
]
}
],
"srcLanguage":"js",
"srcPath":"TestAbility",
"type":"page",
"visible":true
}
],
"js":[
{
"name":".TestAbility",
"pages":[
"pages/index/index"
],
"window":{
"autoDesignWidth":false,
"designWidth":720
}
}
]
}
}
\ No newline at end of file
/* * Copyright (c) 2022 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ import AbilityDelegatorRegistry from '@ohos.app.ability.abilityDelegatorRegistry'import { Hypium } from '@ohos/hypium'import testsuite from '../test/List.test' export default { onCreate() { console.info('TestApplication onCreate') var abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() var abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments() console.info('start run testcase!!!') Hypium.hypiumTest(abilityDelegator, abilityDelegatorArguments, testsuite) }, onDestroy() { console.info("TestApplication onDestroy"); }};
\ No newline at end of file
{
"strings": {
"hello": "Hello",
"world": "World"
},
"Files": {
}
}
\ No newline at end of file
{
"strings": {
"hello": "您好",
"world": "世界"
},
"Files": {
}
}
\ No newline at end of file
.container {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
left: 0px;
top: 0px;
width: 100%;
height: 100%;
}
.title {
font-size: 60px;
text-align: center;
width: 100%;
height: 40%;
margin: 10px;
}
@media screen and (device-type: phone) and (orientation: landscape) {
.title {
font-size: 60px;
}
}
@media screen and (device-type: tablet) and (orientation: landscape) {
.title {
font-size: 100px;
}
}
\ No newline at end of file
<div class="container">
<text class="title">
{{ $t('strings.hello') }} {{ title }}
</text>
</div>
/*
* Copyright (c) 2022 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
export default {
data: {
title: ""
},
onInit() {
this.title = this.$t('strings.world');
}
}
/**
* Copyright (c) 2023 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import hilog from '@ohos.hilog';
import AbilityDelegatorRegistry from '@ohos.app.ability.abilityDelegatorRegistry';
export default {
onPrepare() {
hilog.info(0x0000, 'testTag', '%{public}s', 'OpenHarmonyTestRunner OnPrepare');
},
onRun() {
hilog.info(0x0000, 'testTag', '%{public}s', 'OpenHarmonyTestRunner onRun run');
var abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments()
var abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator()
var testAbilityName = abilityDelegatorArguments.parameters['-p'] + '.TestAbility'
var cmd = 'aa start -d 0 -a ' + testAbilityName + ' -b ' + abilityDelegatorArguments.bundleName
var debug = abilityDelegatorArguments.parameters["-D"]
if (debug == 'true')
{
cmd += ' -D'
}
hilog.info(0x0000, 'testTag', 'cmd : %{public}s', cmd);
abilityDelegator.executeShellCommand(cmd, (err, data) => {
hilog.info(0x0000, 'testTag', 'executeShellCommand : err : %{public}s', JSON.stringify(err) ?? '');
hilog.info(0x0000, 'testTag', 'executeShellCommand : data : %{public}s', data.stdResult ?? '');
hilog.info(0x0000, 'testTag', 'executeShellCommand : data : %{public}s', data.exitCode ?? '');
})
}
};
\ No newline at end of file
/*
* Copyright (C) 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from '@ohos/hypium'
import accessibility from '@ohos.accessibility'
export default function AccessibleCheckAbility() {
describe('AccessibleCheckAbility', function () {
const TIMEOUT = 1000;
beforeEach(async function (done) {
console.info(`AccessibleAbilityList: beforeEach starts`);
done();
})
afterEach(async function (done) {
console.info(`AccessibleAbilityList: afterEach starts`);
done();
})
/******************************************************************************************* */
/* Cases CheckAbilityIsOpen_0170-0180 are for accessibility.isOpenAccessibility() API test */
/******************************************************************************************* */
/* Cases for namespace accessibility */
/*
* @tc.number CheckAbilityIsOpen_0170
* @tc.name CheckAbilityIsOpen_0170
* @tc.desc Test isOpenAccessibility() function in callback mode.
* The result of isOpenAccessibility() should be boolean type.
* @tc.size SmallTest
* @tc.type User
*/
it('CheckAbilityIsOpen_0170', 0, async function (done) {
console.info('CheckAbilityIsOpen_0170');
accessibility.isOpenAccessibility((err, data) => {
if (err && err.code != 0) {
console.error(`AccessibilityApi: CheckAbilityIsOpen_0170 has error: ${err.code}`);
expect(null).assertFail();
done();
}
expect(typeof (data)).assertEqual('boolean');
done();
});
})
/*
* @tc.number CheckAbilityIsOpen_0180
* @tc.name CheckAbilityIsOpen_0180
* @tc.desc Test isOpenAccessibility() function in promise mode.
* The result of isOpenAccessibility() should be boolean type.
* @tc.size SmallTest
* @tc.type User
*/
it('CheckAbilityIsOpen_0180', 0, async function (done) {
console.info('CheckAbilityIsOpen_0180');
accessibility.isOpenAccessibility().then((result) => {
console.info(`AccessibilityApi: CheckAbilityIsOpen_0180 result: ${result}`);
expect(typeof (result)).assertEqual('boolean');
done();
}).catch((err) => {
console.error(`AccessibilityApi: CheckAbilityIsOpen_0180 has error: ${err.code}`);
expect(null).assertFail();
done();
});
})
/******************************************************************************************* */
/* Cases CheckAbilityIsOpen_0190-0200 are for accessibility.isOpenTouchGuide() API test */
/******************************************************************************************* */
/*
* @tc.number CheckAbilityIsOpen_0190
* @tc.name CheckAbilityIsOpen_0190
* @tc.desc Test isOpenTouchGuide() function in callback mode.
* The result of isOpenTouchGuide() should be boolean type.
* @tc.size SmallTest
* @tc.type User
*/
it('CheckAbilityIsOpen_0190', 0, async function (done) {
console.info('CheckAbilityIsOpen_0190');
accessibility.isOpenTouchGuide((err, data) => {
if (err && err.code != 0) {
console.error(`AccessibilityApi: CheckAbilityIsOpen_0190 has error: ${err.code}`);
expect(null).assertFail();
done();
}
expect(typeof (data)).assertEqual('boolean');
done();
});
})
/*
* @tc.number CheckAbilityIsOpen_0200
* @tc.name CheckAbilityIsOpen_0200
* @tc.desc Test isOpenTouchGuide() function in promise mode.
* The result of isOpenTouchGuide() should be boolean type.
* @tc.size SmallTest
* @tc.type User
*/
it('CheckAbilityIsOpen_0200', 0, async function (done) {
console.info('CheckAbilityIsOpen_0200');
accessibility.isOpenTouchGuide().then((result) => {
console.info(`AccessibilityApi: CheckAbilityIsOpen_0200 result: ${result}`);
expect(typeof (result)).assertEqual('boolean');
done();
}).catch((err) => {
if (err && err.code != 0){
console.error(`AccessibilityApi: CheckAbilityIsOpen_0200 has error: ${err.code}`);
expect(null).assertFail();
done();
}
});
})
})
}
/*
* Copyright (C) 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import AccessibleCheckAbility from './AccessibleCheckAbility.test.js'
export default function testsuite() {
AccessibleCheckAbility()
}
{
"string": [
{
"name": "app_name",
"value": "ActsSetCheckSyncEnable"
},
{
"name": "mainability_description",
"value": "JS_Phone_Empty Feature Ability"
},
{
"name": "MainAbility_desc",
"value": "description"
},
{
"name": "MainAbility_label",
"value": "label"
},
{
"name": "TestAbility_desc",
"value": "description"
},
{
"name": "TestAbility_label",
"value": "label"
}
]
}
\ No newline at end of file
/**
* Copyright (c) 2023 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
{
"hvigorVersion": "2.4.2",
"dependencies": {
"@ohos/hvigor-ohos-plugin": "2.4.2"
}
}
/**
* Copyright (c) 2023 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// Script for compiling build behavior. It is built in the build plug-in and cannot be modified currently.
export { legacyAppTasks } from '@ohos/hvigor-ohos-plugin';
\ No newline at end of file
# Copyright (c) 2023 Huawei Device Co., Ltd.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#!/bin/bash
# ----------------------------------------------------------------------------
# Hvigor startup script, version 1.0.0
#
# Required ENV vars:
# ------------------
# NODE_HOME - location of a Node home dir
# or
# Add /usr/local/nodejs/bin to the PATH environment variable
# ----------------------------------------------------------------------------
HVIGOR_APP_HOME=$(dirname $(readlink -f $0))
HVIGOR_WRAPPER_SCRIPT=${HVIGOR_APP_HOME}/hvigor/hvigor-wrapper.js
warn() {
echo ""
echo -e "\033[1;33m`date '+[%Y-%m-%d %H:%M:%S]'`$@\033[0m"
}
error() {
echo ""
echo -e "\033[1;31m`date '+[%Y-%m-%d %H:%M:%S]'`$@\033[0m"
}
fail() {
error "$@"
exit 1
}
# Determine node to start hvigor wrapper script
if [ -n "${NODE_HOME}" ];then
EXECUTABLE_NODE="${NODE_HOME}/bin/node"
if [ ! -x "$EXECUTABLE_NODE" ];then
fail "ERROR: NODE_HOME is set to an invalid directory,check $NODE_HOME\n\nPlease set NODE_HOME in your environment to the location where your nodejs installed"
fi
else
EXECUTABLE_NODE="node"
which ${EXECUTABLE_NODE} > /dev/null 2>&1 || fail "ERROR: NODE_HOME is not set and not 'node' command found in your path"
fi
# Check hvigor wrapper script
if [ ! -r "$HVIGOR_WRAPPER_SCRIPT" ];then
fail "ERROR: Couldn't find hvigor/hvigor-wrapper.js in ${HVIGOR_APP_HOME}"
fi
# start hvigor-wrapper script
exec "${EXECUTABLE_NODE}" \
"${HVIGOR_WRAPPER_SCRIPT}" "$@"
@rem Copyright (C) 2023 Huawei Device Co., Ltd.
@rem Licensed under the Apache License, Version 2.0 (the "License");
@rem you may not use this file except in compliance with the License.
@rem You may obtain a copy of the License at
@rem
@rem http://www.apache.org/licenses/LICENSE-2.0
@rem
@rem Unless required by applicable law or agreed to in writing, software
@rem distributed under the License is distributed on an "AS IS" BASIS,
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@rem See the License for the specific language governing permissions and
@rem limitations under the License.
@if "%DEBUG%" == "" @echo off
@rem ##########################################################################
@rem
@rem Hvigor startup script for Windows
@rem
@rem ##########################################################################
@rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal
set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%
@rem Resolve any "." and ".." in APP_HOME to make it shorter.
for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
set WRAPPER_MODULE_PATH=%APP_HOME%\hvigor\hvigor-wrapper.js
set NODE_EXE=node.exe
goto start
:start
@rem Find node.exe
if defined NODE_HOME goto findNodeFromNodeHome
%NODE_EXE% --version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto execute
echo.
echo ERROR: NODE_HOME is not set and no 'node' command could be found in your PATH.
echo.
echo Please set the NODE_HOME variable in your environment to match the
echo location of your NodeJs installation.
goto fail
:findNodeFromNodeHome
set NODE_HOME=%NODE_HOME:"=%
set NODE_EXE_PATH=%NODE_HOME%/%NODE_EXE%
if exist "%NODE_EXE_PATH%" goto execute
echo.
echo ERROR: NODE_HOME is not set and no 'node' command could be found in your PATH.
echo.
echo Please set the NODE_HOME variable in your environment to match the
echo location of your NodeJs installation.
goto fail
:execute
@rem Execute hvigor
"%NODE_EXE%" %WRAPPER_MODULE_PATH% %*
:fail
exit /b 1
/*
* Copyright (C) 2023 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
{
"lockfileVersion": 1,
"ATTENTION": "THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.",
"specifiers": {
"@ohos/hypium@1.0.6": "@ohos/hypium@1.0.6"
},
"packages": {
"@ohos/hypium@1.0.6": {
"resolved": "https://repo.harmonyos.com/ohpm/@ohos/hypium/-/hypium-1.0.6.tgz",
"integrity": "sha512-bb3DWeWhYrFqj9mPFV3yZQpkm36kbcK+YYaeY9g292QKSjOdmhEIQR2ULPvyMsgSR4usOBf5nnYrDmaCCXirgQ=="
}
}
}
\ No newline at end of file
/**
* Copyright (c) 2023 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
{
"license": "",
"devDependencies": {
"@ohos/hypium": "1.0.6"
},
"author": "",
"name": "myapplication454434",
"description": "Please describe the basic information.",
"main": "",
"version": "1.0.0",
"dependencies": {}
}
/node_modules
/oh_modules
/local.properties
/.idea
**/build
/.hvigor
.cxx
/.clangd
/.clang-format
/.clang-tidy
**/.test
\ No newline at end of file
# Copyright (c) 2021 Huawei Device Co., Ltd. # Copyright (C) 2023 Huawei Device Co., Ltd.
# Licensed under the Apache License, Version 2.0 (the "License"); # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. # you may not use this file except in compliance with the License.
# You may obtain a copy of the License at # You may obtain a copy of the License at
...@@ -10,26 +10,12 @@ ...@@ -10,26 +10,12 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
import("//test/xts/tools/build/suite.gni") import("//test/xts/tools/build/suite.gni")
ohos_js_app_suite("ActsAccessibleRegisterStateTest") {
ohos_js_hap_suite("ActsAccessibleRegisterStateTest") { test_hap = true
hap_profile = "./src/main/config.json" testonly = true
deps = [
":hjs_demo_js_assets",
":hjs_demo_resources",
]
certificate_profile = "./signature/openharmony_sx.p7b"
hap_name = "ActsAccessibleRegisterStateTest" hap_name = "ActsAccessibleRegisterStateTest"
part_name = "accessibility"
subsystem_name = "barrierfree" subsystem_name = "barrierfree"
} part_name = "accessibility"
ohos_js_assets("hjs_demo_js_assets") { certificate_profile = "./signature/openharmony_sx.p7b"
js2abc = true
hap_profile = "./src/main/config.json"
source_dir = "./src/main/js"
}
ohos_resources("hjs_demo_resources") {
sources = [ "./src/main/resources" ]
hap_profile = "./src/main/config.json"
} }
{ {
"description": "Configuration for hjunit demo Tests", "description":"Configuration for hjunit demo Tests",
"driver": { "driver":{
"type": "OHJSUnitTest", "type":"OHJSUnitTest",
"test-timeout": "180000", "test-timeout":"180000",
"shell-timeout": "180000", "shell-timeout":"180000",
"bundle-name": "com.example.accessibleregisterstate", "bundle-name":"com.example.accessibleregisterstate",
"package-name": "com.example.accessibleregisterstate" "package-name":"com.example.accessibleregisterstate_test"
}, },
"kits": [ "kits":[
{ {
"test-file-name": [ "test-file-name":[
"ActsAccessibleRegisterStateTest.hap" "ActsAccessibleRegisterStateTest.hap"
], ],
"type": "AppInstallKit", "type":"AppInstallKit",
"cleanup-apps": true "cleanup-apps":true
},{ },
"type": "ShellKit", {
"run-command": [ "type":"ShellKit",
"power-shell wakeup", "run-command":[
"power-shell setmode 602" "power-shell wakeup",
] "power-shell setmode 602"
} ]
] }
]
} }
\ No newline at end of file
/**
* Copyright (c) 2023 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
{
"app":{
"signingConfigs":[
],
"compileSdkVersion":10,
"compatibleSdkVersion":10,
"products":[
{
"name":"default",
"signingConfig":"default"
}
]
},
"modules":[
{
"name":"entry",
"srcPath":"./entry",
"targets":[
{
"name":"default",
"applyToProducts":[
"default"
]
}
]
}
]
}
\ No newline at end of file
/node_modules
/oh_modules
/.preview
/build
/.cxx
/.test
\ No newline at end of file
/**
* Copyright (c) 2023 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/ {
"apiType":"faMode",
"buildOption":{
},
"targets":[
{
"name":"default"
},
{
"name":"ohosTest"
}
]
}
\ No newline at end of file
/**
* Copyright (c) 2023 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// Script for compiling build behavior. It is built in the build plug-in and cannot be modified currently.
export { legacyHapTasks } from '@ohos/hvigor-ohos-plugin';
/**
* Copyright (c) 2023 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/ {
"license":"",
"devDependencies":{
},
"author":"",
"name":"entry",
"description":"Please describe the basic information.",
"main":"",
"version":"1.0.0",
"dependencies":{
}
}
\ No newline at end of file
{
"app":{
"bundleName":"com.example.accessibleregisterstate",
"vendor":"example",
"version":{
"code":1,
"name":"1.0"
}
},
"deviceConfig":{
},
"module":{
"package":"com.example.accessibleregisterstate",
"name":".entry",
"mainAbility":".MainAbility",
"deviceType":[
"tablet",
"default",
"phone"
],
"distro":{
"deliveryWithInstall":true,
"installationFree":false,
"moduleName":"entry",
"moduleType":"entry"
},
"abilities":[
{
"description":"$string:MainAbility_desc",
"formsEnabled":false,
"icon":"$media:icon",
"label":"$string:MainAbility_label",
"launchType":"standard",
"name":".MainAbility",
"orientation":"unspecified",
"skills":[
{
"actions":[
"action.system.home"
],
"entities":[
"entity.system.home"
]
}
],
"srcLanguage":"js",
"srcPath":"MainAbility",
"type":"page",
"visible":true
}
],
"js":[
{
"name":".MainAbility",
"pages":[
"pages/index/index"
],
"window":{
"autoDesignWidth":false,
"designWidth":720
}
}
]
}
}
\ No newline at end of file
/**
* Copyright (c) 2023 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import hilog from '@ohos.hilog';
export default {
onCreate() {
hilog.info(0x0000, 'testTag', '%{public}s', 'Application onCreate');
},
onDestroy() {
hilog.info(0x0000, 'testTag', '%{public}s', 'Application onDestroy');
},
}
\ No newline at end of file
{
"strings": {
"hello": "Hello",
"world": "World"
}
}
\ No newline at end of file
{
"strings": {
"hello": "您好",
"world": "世界"
}
}
\ No newline at end of file
.container {
flex-direction: column;
justify-content: center;
align-items: center;
}
.title {
font-size: 100px;
}
<div class="container">
<text class="title">
{{title}}
</text>
</div>
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import file from '@system.file'
const injectRef = Object.getPrototypeOf(global) || global
injectRef.regeneratorRuntime = require('@babel/runtime/regenerator')
export default {
data: {
title: "Accessbility js test"
},
onInit() {
this.title = "Accessbility js test";
},
onShow() {
console.info('onShow finish')
},
onReady() {
},
}
\ No newline at end of file
{
"string": [
{
"name": "app_name",
"value": "ActsSetCheckSyncEnable"
},
{
"name": "mainability_description",
"value": "JS_Phone_Empty Feature Ability"
},
{
"name": "MainAbility_desc",
"value": "description"
},
{
"name": "MainAbility_label",
"value": "label"
},
{
"name": "TestAbility_desc",
"value": "description"
},
{
"name": "TestAbility_label",
"value": "label"
}
]
}
\ No newline at end of file
{
"app":{
"bundleName":"com.example.accessibleregisterstate",
"vendor":"example",
"version":{
"code":1,
"name":"1.0"
}
},
"deviceConfig":{
},
"module":{
"package":"com.example.accessibleregisterstate_test",
"name":".entry_test",
"mainAbility":".TestAbility",
"deviceType":[
"tablet",
"default",
"phone"
],
"reqPermissions":[
{
"name":"ohos.permission.DISTRIBUTED_DATASYNC",
"reason":"ceshi"
}
],
"testRunner":{
"name":"OpenHarmonyTestRunner",
"srcPath":"TestRunner"
},
"distro":{
"deliveryWithInstall":true,
"installationFree":false,
"moduleName":"entry_test",
"moduleType":"feature"
},
"abilities":[
{
"description":"$string:TestAbility_desc",
"formsEnabled":false,
"icon":"$media:icon",
"label":"$string:TestAbility_label",
"launchType":"standard",
"name":".TestAbility",
"orientation":"unspecified",
"skills":[
{
"actions":[
"action.system.home"
],
"entities":[
"entity.system.home"
]
}
],
"srcLanguage":"js",
"srcPath":"TestAbility",
"type":"page",
"visible":true
}
],
"js":[
{
"name":".TestAbility",
"pages":[
"pages/index/index"
],
"window":{
"autoDesignWidth":false,
"designWidth":720
}
}
]
}
}
\ No newline at end of file
/* * Copyright (c) 2022 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ import AbilityDelegatorRegistry from '@ohos.app.ability.abilityDelegatorRegistry'import { Hypium } from '@ohos/hypium'import testsuite from '../test/List.test' export default { onCreate() { console.info('TestApplication onCreate') var abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() var abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments() console.info('start run testcase!!!') Hypium.hypiumTest(abilityDelegator, abilityDelegatorArguments, testsuite) }, onDestroy() { console.info("TestApplication onDestroy"); }};
\ No newline at end of file
{
"strings": {
"hello": "Hello",
"world": "World"
},
"Files": {
}
}
\ No newline at end of file
{
"strings": {
"hello": "您好",
"world": "世界"
},
"Files": {
}
}
\ No newline at end of file
.container {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
left: 0px;
top: 0px;
width: 100%;
height: 100%;
}
.title {
font-size: 60px;
text-align: center;
width: 100%;
height: 40%;
margin: 10px;
}
@media screen and (device-type: phone) and (orientation: landscape) {
.title {
font-size: 60px;
}
}
@media screen and (device-type: tablet) and (orientation: landscape) {
.title {
font-size: 100px;
}
}
\ No newline at end of file
<div class="container">
<text class="title">
{{ $t('strings.hello') }} {{ title }}
</text>
</div>
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册