diff --git a/zh-cn/application-dev/application-test/arkxtest-guidelines.md b/zh-cn/application-dev/application-test/arkxtest-guidelines.md index f79e8b5cce3c66e0c16b140c64c16326d76aade3..136ba7664bf0fc31fc6006e7c1af10a78506605d 100644 --- a/zh-cn/application-dev/application-test/arkxtest-guidelines.md +++ b/zh-cn/application-dev/application-test/arkxtest-guidelines.md @@ -108,7 +108,7 @@ UI测试脚本是在单元测试框架的基础上编写,主要就是增加了 下面的示例代码是在上面的测试脚本基础上增量编写,首先需要增加依赖导包,如下示例代码所示: ```js -import {UiDriver,BY,UiComponent,MatchPattern} from '@ohos.uitest' +import {Driver,ON,Component,MatchPattern} from '@ohos.uitest' ``` 然后是具体测试代码编写,场景较为简单,就是在启动的应用页面上进行点击操作,然后增加检查点检查用例。 @@ -131,16 +131,16 @@ export default function abilityTest() { expect(Ability.context.abilityInfo.name).assertEqual('EntryAbility'); }) //ui test code - //init uidriver - var driver = await UiDriver.create(); + //init driver + var driver = await Driver.create(); await driver.delayMs(1000); //find button by text 'Next' - var button = await driver.findComponent(BY.text('Next')); + var button = await driver.findComponent(ON.text('Next')); //click button await button.click(); await driver.delayMs(1000); //check text - await driver.assertComponentExist(BY.text('after click')); + await driver.assertComponentExist(ON.text('after click')); await driver.pressBack(); done(); }) diff --git a/zh-cn/application-dev/application-test/figures/Execute.PNG b/zh-cn/application-dev/application-test/figures/Execute.PNG index 7c9d9be0d39c8b07c32f351622423085a4086584..5d4d1b3c79e423e7e2f758c77dd1474f2bcc47d9 100644 Binary files a/zh-cn/application-dev/application-test/figures/Execute.PNG and b/zh-cn/application-dev/application-test/figures/Execute.PNG differ