# assertj-ohos **Repository Path**: HarmonyOS-tpc/assertj-ohos ## Basic Information - **Project Name**: assertj-ohos - **Description**: 一组旨在测试ohos的断言。 - **Primary Language**: Unknown - **License**: Apache-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 2 - **Forks**: 1 - **Created**: 2021-04-01 - **Last Updated**: 2023-04-17 ## Categories & Tags **Categories**: harmonyos-toolkit **Tags**: None ## README # assertj-ohos ## 目录 * [功能介绍](#功能介绍) * [集成](#集成) * [例子](#例子) ## 功能介绍 - [x] 一组旨在测试ohos的断言。 ## 集成 ``` 方式一: 通过library生成har包,添加har包到libs文件夹内 在entry的gradle内添加如下代码 implementation fileTree(dir: 'libs', include: ['*.jar', '*.har']) 添加依赖 implementation 'org.assertj:assertj-core:1.7.1' 方式二: allprojects{ repositories{ mavenCentral() } } implementation 'io.openharmony.tpc.thirdlib:assertj-ohos:1.0.0' 添加依赖 implementation 'org.assertj:assertj-core:1.7.1' ``` ## 例子 ``` Text text = (Text) findComponentById(ResourceTable.Id_text_helloworld); assertThat(text).isVisible(); assertThat(text).hasAlpha(10); DirectionalLayout directionalLayout = (DirectionalLayout) findComponentById(ResourceTable.Id_dl); assertThat(directionalLayout).isVisible().isVertical().hasChildCount(4); ``` |support-v4 module | Google Play Services module | |:---:|:---:| |暂不支持|暂不支持| |appcompat-v7 module | Design library module | |:---:|:---:| |暂不支持|暂不支持| |mediarouter-v7 module | gridlayout-v7 module | |:---:|:---:| |暂不支持|暂不支持| |cardview-v7 module | recyclerview-v7 module | |:---:|:---:| |暂不支持|暂不支持| |palette-v7 module | |:---:| |暂不支持| ## License Copyright 2013 Square, Inc. 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.