source stringlengths 14 113 | code stringlengths 10 21.3k |
|---|---|
application-dev\reference\apis-test-kit\js-apis-uitest.md | import { Component, Driver, ON } from '@kit.TestKit';
async function demo() {
let driver: Driver = Driver.create();
let button: Component = await driver.findComponent(ON.type('Button'));
if(await button.isClickable()) {
console.info('This button can be Clicked');
} else {
console.info('This button can n... |
application-dev\reference\apis-test-kit\js-apis-uitest.md | import { Component, Driver, ON } from '@kit.TestKit';
async function demo() {
let driver: Driver = Driver.create();
let button: Component = await driver.findComponent(ON.type('Button'));
if(await button.isLongClickable()) {
console.info('This button can longClick');
} else {
console.info('This button ca... |
application-dev\reference\apis-test-kit\js-apis-uitest.md | import { Component, Driver, ON } from '@kit.TestKit';
async function demo() {
let driver: Driver = Driver.create();
let checkBox: Component = await driver.findComponent(ON.type('Checkbox'));
if(await checkBox.isChecked()) {
console.info('This checkBox is checked');
} else {
console.info('This checkBox i... |
application-dev\reference\apis-test-kit\js-apis-uitest.md | import { Component, Driver, ON } from '@kit.TestKit';
async function demo() {
let driver: Driver = Driver.create();
let checkBox: Component = await driver.findComponent(ON.type('Checkbox'));
if(await checkBox.isCheckable()) {
console.info('This checkBox is checkable');
} else {
console.info('This checkB... |
application-dev\reference\apis-test-kit\js-apis-uitest.md | import { Component, Driver, ON } from '@kit.TestKit';
async function demo() {
let driver: Driver = Driver.create();
let scrollBar: Component = await driver.findComponent(ON.scrollable(true));
if(await scrollBar.isScrollable()) {
console.info('This scrollBar can be operated');
} else {
console.info('This... |
application-dev\reference\apis-test-kit\js-apis-uitest.md | import { Component, Driver, ON } from '@kit.TestKit';
async function demo() {
let driver: Driver = Driver.create();
let button: Component = await driver.findComponent(ON.type('Button'));
if(await button.isEnabled()) {
console.info('This button can be operated');
} else {
console.info('This button can no... |
application-dev\reference\apis-test-kit\js-apis-uitest.md | import { Component, Driver, ON } from '@kit.TestKit';
async function demo() {
let driver: Driver = Driver.create();
let button: Component = await driver.findComponent(ON.type('Button'));
if(await button.isFocused()) {
console.info('This button is focused');
} else {
console.info('This button is not focu... |
application-dev\reference\apis-test-kit\js-apis-uitest.md | import { Component, Driver, ON } from '@kit.TestKit';
async function demo() {
let driver: Driver = Driver.create();
let button: Component = await driver.findComponent(ON.type('Button'));
if(await button.isSelected()) {
console.info('This button is selected');
} else {
console.info('This button is not se... |
application-dev\reference\apis-test-kit\js-apis-uitest.md | import { Component, Driver, ON } from '@kit.TestKit';
async function demo() {
let driver: Driver = Driver.create();
let text: Component = await driver.findComponent(ON.text('hello world'));
await text.inputText('123');
} |
application-dev\reference\apis-test-kit\js-apis-uitest.md | import { Component, Driver, ON } from '@kit.TestKit';
async function demo() {
let driver: Driver = Driver.create();
let text: Component = await driver.findComponent(ON.text('hello world'));
await text.clearText();
} |
application-dev\reference\apis-test-kit\js-apis-uitest.md | import { Component, Driver, ON } from '@kit.TestKit';
async function demo() {
let driver: Driver = Driver.create();
let scrollBar: Component = await driver.findComponent(ON.type('Scroll'));
let button = await scrollBar.scrollSearch(ON.text('next page'));
} |
application-dev\reference\apis-test-kit\js-apis-uitest.md | import { Component, Driver, ON } from '@kit.TestKit';
async function demo() {
let driver: Driver = Driver.create();
let scrollBar: Component = await driver.findComponent(ON.type('Scroll'));
let button = await scrollBar.scrollSearch(ON.text('next page'));
} |
application-dev\reference\apis-test-kit\js-apis-uitest.md | import { Component, Driver, ON } from '@kit.TestKit';
async function demo() {
let driver: Driver = Driver.create();
let scrollBar: Component = await driver.findComponent(ON.type('Scroll'));
await scrollBar.scrollToTop();
} |
application-dev\reference\apis-test-kit\js-apis-uitest.md | import { Component, Driver, ON } from '@kit.TestKit';
async function demo() {
let driver: Driver = Driver.create();
let scrollBar: Component = await driver.findComponent(ON.type('Scroll'));
await scrollBar.scrollToBottom();
} |
application-dev\reference\apis-test-kit\js-apis-uitest.md | import { Component, Driver, ON } from '@kit.TestKit';
async function demo() {
let driver: Driver = Driver.create();
let button: Component = await driver.findComponent(ON.type('Button'));
let text: Component = await driver.findComponent(ON.text('hello world'));
await button.dragTo(text);
} |
application-dev\reference\apis-test-kit\js-apis-uitest.md | import { Component, Driver, ON } from '@kit.TestKit';
async function demo() {
let driver: Driver = Driver.create();
let image: Component = await driver.findComponent(ON.type('Image'));
await image.pinchOut(1.5);
} |
application-dev\reference\apis-test-kit\js-apis-uitest.md | import { Component, Driver, ON } from '@kit.TestKit';
async function demo() {
let driver: Driver = Driver.create();
let image: Component = await driver.findComponent(ON.type('Image'));
await image.pinchIn(0.5);
} |
application-dev\reference\apis-test-kit\js-apis-uitest.md | import { Component, Driver, ON } from '@kit.TestKit';
async function demo() {
let driver: Driver = Driver.create();
let button: Component = await driver.findComponent(ON.type('Button'));
let description = await button.getDescription();
} |
application-dev\reference\apis-test-kit\js-apis-uitest.md | import { Component, Driver, ON } from '@kit.TestKit';
async function demo() {
let driver: Driver = Driver.create();
let button: Component = await driver.findComponent(ON.type('TextInput'));
let hints = await button.getHint();
} |
application-dev\reference\apis-test-kit\js-apis-uitest.md | import { Driver } from '@kit.TestKit';
async function demo() {
let driver: Driver = Driver.create();
} |
application-dev\reference\apis-test-kit\js-apis-uitest.md | import { Driver } from '@kit.TestKit';
async function demo() {
let driver: Driver = Driver.create();
await driver.delayMs(1000);
} |
application-dev\reference\apis-test-kit\js-apis-uitest.md | import { Component, Driver, ON } from '@kit.TestKit';
async function demo() {
let driver: Driver = Driver.create();
let button: Component = await driver.findComponent(ON.text('next page'));
} |
application-dev\reference\apis-test-kit\js-apis-uitest.md | import { Component, Driver, ON } from '@kit.TestKit';
async function demo() {
let driver: Driver = Driver.create();
let buttonList: Array<Component> = await driver.findComponents(ON.text('next page'));
} |
application-dev\reference\apis-test-kit\js-apis-uitest.md | import { Driver, UiWindow } from '@kit.TestKit';
async function demo() {
let driver: Driver = Driver.create();
let window: UiWindow = await driver.findWindow({actived: true});
} |
application-dev\reference\apis-test-kit\js-apis-uitest.md | import { Component, Driver, ON } from '@kit.TestKit';
async function demo() {
let driver: Driver = Driver.create();
let button: Component = await driver.waitForComponent(ON.text('next page'),500);
} |
application-dev\reference\apis-test-kit\js-apis-uitest.md | import { Driver, ON } from '@kit.TestKit';
async function demo() {
let driver: Driver = Driver.create();
await driver.assertComponentExist(ON.text('next page'));
} |
application-dev\reference\apis-test-kit\js-apis-uitest.md | import { Driver } from '@kit.TestKit';
async function demo() {
let driver: Driver = Driver.create();
await driver.pressBack();
} |
application-dev\reference\apis-test-kit\js-apis-uitest.md | import { Driver } from '@kit.TestKit';
async function demo() {
let driver: Driver = Driver.create();
await driver.triggerKey(123);
} |
application-dev\reference\apis-test-kit\js-apis-uitest.md | import { Driver } from '@kit.TestKit';
async function demo() {
let driver: Driver = Driver.create();
await driver.triggerCombineKeys(2072, 2047, 2035);
} |
application-dev\reference\apis-test-kit\js-apis-uitest.md | import { Driver } from '@kit.TestKit';
async function demo() {
let driver: Driver = Driver.create();
await driver.click(100,100);
} |
application-dev\reference\apis-test-kit\js-apis-uitest.md | import { Driver } from '@kit.TestKit';
async function demo() {
let driver: Driver = Driver.create();
await driver.doubleClick(100,100);
} |
application-dev\reference\apis-test-kit\js-apis-uitest.md | import { Driver } from '@kit.TestKit';
async function demo() {
let driver: Driver = Driver.create();
await driver.longClick(100,100);
} |
application-dev\reference\apis-test-kit\js-apis-uitest.md | import { Driver } from '@kit.TestKit';
async function demo() {
let driver: Driver = Driver.create();
await driver.swipe(100,100,200,200,600);
} |
application-dev\reference\apis-test-kit\js-apis-uitest.md | import { Driver } from '@kit.TestKit';
async function demo() {
let driver: Driver = Driver.create();
await driver.drag(100,100,200,200,600);
} |
application-dev\reference\apis-test-kit\js-apis-uitest.md | import { Driver } from '@kit.TestKit';
async function demo() {
let driver: Driver = Driver.create();
await driver.screenCap('/data/storage/el2/base/cache/1.png');
} |
application-dev\reference\apis-test-kit\js-apis-uitest.md | import { Driver, DisplayRotation } from '@kit.TestKit';
async function demo() {
let driver: Driver = Driver.create();
await driver.setDisplayRotation(DisplayRotation.ROTATION_180);
} |
application-dev\reference\apis-test-kit\js-apis-uitest.md | import { DisplayRotation, Driver } from '@kit.TestKit';
async function demo() {
let driver: Driver = Driver.create();
let rotation: DisplayRotation = await driver.getDisplayRotation();
} |
application-dev\reference\apis-test-kit\js-apis-uitest.md | import { Driver } from '@kit.TestKit';
async function demo() {
let driver: Driver = Driver.create();
await driver.setDisplayRotationEnabled(false);
} |
application-dev\reference\apis-test-kit\js-apis-uitest.md | import { Driver, } from '@kit.TestKit';
async function demo() {
let driver: Driver = Driver.create();
let size = await driver.getDisplaySize();
} |
application-dev\reference\apis-test-kit\js-apis-uitest.md | import { Driver } from '@kit.TestKit';
async function demo() {
let driver: Driver = Driver.create();
let density = await driver.getDisplayDensity();
} |
application-dev\reference\apis-test-kit\js-apis-uitest.md | import { Driver } from '@kit.TestKit';
async function demo() {
let driver: Driver = Driver.create();
await driver.wakeUpDisplay();
} |
application-dev\reference\apis-test-kit\js-apis-uitest.md | import { Driver } from '@kit.TestKit';
async function demo() {
let driver: Driver = Driver.create();
await driver.pressHome();
} |
application-dev\reference\apis-test-kit\js-apis-uitest.md | import { Driver } from '@kit.TestKit';
async function demo() {
let driver: Driver = Driver.create();
let idled:boolean = await driver.waitForIdle(4000,5000);
} |
application-dev\reference\apis-test-kit\js-apis-uitest.md | import { Driver } from '@kit.TestKit';
async function demo() {
let driver: Driver = Driver.create();
await driver.fling({x: 500, y: 480},{x: 450, y: 480},5,600);
} |
application-dev\reference\apis-test-kit\js-apis-uitest.md | import { Driver, PointerMatrix } from '@kit.TestKit';
async function demo() {
let driver: Driver = Driver.create();
let pointers: PointerMatrix = PointerMatrix.create(2,5);
pointers.setPoint(0,0,{x:250,y:480});
pointers.setPoint(0,1,{x:250,y:440});
pointers.setPoint(0,2,{x:250,y:400});
pointers.setPoint(0,3... |
application-dev\reference\apis-test-kit\js-apis-uitest.md | import { Driver, UiDirection } from '@kit.TestKit';
async function demo() {
let driver: Driver = Driver.create();
await driver.fling(UiDirection.DOWN, 10000);
} |
application-dev\reference\apis-test-kit\js-apis-uitest.md | import { Driver } from '@kit.TestKit';
async function demo() {
let driver: Driver = Driver.create();
await driver.screenCapture('/data/storage/el2/base/cache/1.png', {left: 0, top: 0, right: 100, bottom: 100});
} |
application-dev\reference\apis-test-kit\js-apis-uitest.md | import { Driver,MouseButton } from '@kit.TestKit';
async function demo() {
let driver: Driver = Driver.create();
await driver.mouseClick({x:248, y:194}, MouseButton.MOUSE_BUTTON_LEFT, 2072);
} |
application-dev\reference\apis-test-kit\js-apis-uitest.md | import { Driver } from '@kit.TestKit';
async function demo() {
let driver: Driver = Driver.create();
await driver.mouseScroll({x:360, y:640}, true, 30, 2072)
} |
application-dev\reference\apis-test-kit\js-apis-uitest.md | import { Driver } from '@kit.TestKit';
async function demo() {
let driver: Driver = Driver.create();
await driver.mouseMoveTo({x:100, y:100})
} |
application-dev\reference\apis-test-kit\js-apis-uitest.md | import { Driver, UIEventObserver } from '@kit.TestKit';
async function demo() {
let driver: Driver = Driver.create();
let observer: UIEventObserver = await driver.createUIEventObserver()
} |
application-dev\reference\apis-test-kit\js-apis-uitest.md | import { Driver } from '@kit.TestKit';
async function demo() {
let driver: Driver = Driver.create();
await driver.mouseScroll({x:360, y:640}, true, 30, 2072,20)
} |
application-dev\reference\apis-test-kit\js-apis-uitest.md | import { Driver,MouseButton } from '@kit.TestKit';
async function demo() {
let driver: Driver = Driver.create();
await driver.mouseDoubleClick({x:248, y:194}, MouseButton.MOUSE_BUTTON_LEFT, 2072);
} |
application-dev\reference\apis-test-kit\js-apis-uitest.md | import { Driver,MouseButton } from '@kit.TestKit';
async function demo() {
let driver:Driver = Driver.create();
await driver.mouseLongClick({x:248, y:194}, MouseButton.MOUSE_BUTTON_LEFT, 2072);
} |
application-dev\reference\apis-test-kit\js-apis-uitest.md | import { Driver } from '@kit.TestKit';
async function demo() {
let driver: Driver = Driver.create();
await driver.mouseMoveWithTrack({x:100, y:100},{x:200, y:200},600);
} |
application-dev\reference\apis-test-kit\js-apis-uitest.md | import { Driver } from '@kit.TestKit';
async function demo() {
let driver: Driver = Driver.create();
await driver.mouseDrag({x:100, y:100},{x:200, y:200},600);
} |
application-dev\reference\apis-test-kit\js-apis-uitest.md | import { Component, Driver, ON } from '@kit.TestKit';
async function demo() {
let driver:Driver = Driver.create();
let text: Component = await driver.findComponent(ON.type('TextInput'));
let point = await text.getBoundsCenter();
await driver.inputText(point, '123');
} |
application-dev\reference\apis-test-kit\js-apis-uitest.md | import { Driver, UiDirection } from '@kit.TestKit';
async function demo() {
let driver:Driver = Driver.create();
await driver.touchPadMultiFingerSwipe(3, UiDirection.UP);
} |
application-dev\reference\apis-test-kit\js-apis-uitest.md | import { Driver } from '@kit.TestKit';
async function demo() {
let driver: Driver = Driver.create();
await driver.penClick({x: 100, y: 100});
} |
application-dev\reference\apis-test-kit\js-apis-uitest.md | import { Driver } from '@kit.TestKit';
async function demo() {
let driver: Driver = Driver.create();
await driver.penLongClick({x: 100, y: 100}, 0.5);
} |
application-dev\reference\apis-test-kit\js-apis-uitest.md | import { Driver } from '@kit.TestKit';
async function demo() {
let driver: Driver = Driver.create();
await driver.penDoubleClick({x: 100, y: 100});
} |
application-dev\reference\apis-test-kit\js-apis-uitest.md | import { Driver } from '@kit.TestKit';
async function demo() {
let driver: Driver = Driver.create();
await driver.penSwipe({x: 100, y: 100}, {x: 100, y: 500}, 600, 0.5);
} |
application-dev\reference\apis-test-kit\js-apis-uitest.md | import { Driver, PointerMatrix } from '@kit.TestKit';
async function demo() {
let driver: Driver = Driver.create();
let pointer = PointerMatrix.create(1,8);
for (let step = 0; step < 8; step++) {
pointer.setPoint(0, step, {x: 500, y: 1100 - 100 *step});
}
await driver.injectPenPointerAction(pointer, 600, ... |
application-dev\reference\apis-test-kit\js-apis-uitest.md | import { PointerMatrix } from '@kit.TestKit';
async function demo() {
let pointerMatrix: PointerMatrix = PointerMatrix.create(2,3);
} |
application-dev\reference\apis-test-kit\js-apis-uitest.md | import { PointerMatrix } from '@kit.TestKit';
async function demo() {
let pointers: PointerMatrix = PointerMatrix.create(2,5);
pointers.setPoint(0,0,{x:250,y:480});
pointers.setPoint(0,1,{x:250,y:440});
pointers.setPoint(0,2,{x:250,y:400});
pointers.setPoint(0,3,{x:250,y:360});
pointers.setPoint(0,4,{x:250,... |
application-dev\reference\apis-test-kit\js-apis-uitest.md | import { Driver, UiWindow } from '@kit.TestKit';
async function demo() {
let driver: Driver = Driver.create();
let window: UiWindow = await driver.findWindow({actived: true});
let name: string = await window.getBundleName();
} |
application-dev\reference\apis-test-kit\js-apis-uitest.md | import { Driver, UiWindow } from '@kit.TestKit';
async function demo() {
let driver: Driver = Driver.create();
let window: UiWindow = await driver.findWindow({actived: true});
let rect = await window.getBounds();
} |
application-dev\reference\apis-test-kit\js-apis-uitest.md | import { Driver, UiWindow } from '@kit.TestKit';
async function demo() {
let driver: Driver = Driver.create();
let window: UiWindow = await driver.findWindow({actived: true});
let rect = await window.getTitle();
} |
application-dev\reference\apis-test-kit\js-apis-uitest.md | import { Driver, UiWindow } from '@kit.TestKit';
async function demo() {
let driver: Driver = Driver.create();
let window: UiWindow = await driver.findWindow({actived: true});
let mode = await window.getWindowMode();
} |
application-dev\reference\apis-test-kit\js-apis-uitest.md | import { Driver, UiWindow } from '@kit.TestKit';
async function demo() {
let driver: Driver = Driver.create();
let window: UiWindow = await driver.findWindow({actived: true});
let focused = await window.isFocused();
} |
application-dev\reference\apis-test-kit\js-apis-uitest.md | import { Driver, UiWindow } from '@kit.TestKit';
async function demo() {
let driver: Driver = Driver.create();
let window: UiWindow = await driver.findWindow({actived: true});
let focused = await window.isActived();
} |
application-dev\reference\apis-test-kit\js-apis-uitest.md | import { Driver, UiWindow } from '@kit.TestKit';
async function demo() {
let driver: Driver = Driver.create();
let window: UiWindow = await driver.findWindow({actived: true});
await window.focus();
} |
application-dev\reference\apis-test-kit\js-apis-uitest.md | import { Driver, UiWindow } from '@kit.TestKit';
async function demo() {
let driver: Driver = Driver.create();
let window: UiWindow = await driver.findWindow({actived: true});
await window.moveTo(100, 100);
} |
application-dev\reference\apis-test-kit\js-apis-uitest.md | import { Driver, ResizeDirection, UiWindow } from '@kit.TestKit';
async function demo() {
let driver: Driver = Driver.create();
let window: UiWindow = await driver.findWindow({actived: true});
await window.resize(100, 100, ResizeDirection.LEFT);
} |
application-dev\reference\apis-test-kit\js-apis-uitest.md | import { Driver, UiWindow } from '@kit.TestKit';
async function demo() {
let driver: Driver = Driver.create();
let window: UiWindow = await driver.findWindow({actived: true});
await window.split();
} |
application-dev\reference\apis-test-kit\js-apis-uitest.md | import { Driver, UiWindow } from '@kit.TestKit';
async function demo() {
let driver: Driver = Driver.create();
let window: UiWindow = await driver.findWindow({actived: true});
await window.maximize();
} |
application-dev\reference\apis-test-kit\js-apis-uitest.md | import { Driver, UiWindow } from '@kit.TestKit';
async function demo() {
let driver: Driver = Driver.create();
let window: UiWindow = await driver.findWindow({actived: true});
await window.minimize();
} |
application-dev\reference\apis-test-kit\js-apis-uitest.md | import { Driver, UiWindow } from '@kit.TestKit';
async function demo() {
let driver: Driver = Driver.create();
let window: UiWindow = await driver.findWindow({actived: true});
await window.resume();
} |
application-dev\reference\apis-test-kit\js-apis-uitest.md | import { Driver, UiWindow } from '@kit.TestKit';
async function demo() {
let driver:Driver = Driver.create();
let window: UiWindow = await driver.findWindow({actived: true});
await window.close();
} |
application-dev\reference\apis-test-kit\js-apis-uitest.md | import { Driver, UiWindow } from '@kit.TestKit';
async function demo() {
let driver: Driver = Driver.create();
let window: UiWindow = await driver.findWindow({active: true});
let focused = await window.isActive();
} |
application-dev\reference\apis-test-kit\js-apis-uitest.md | import { Driver, UIElementInfo, UIEventObserver } from '@kit.TestKit';
async function demo() {
let driver: Driver = Driver.create();
let observer: UIEventObserver = await driver.createUIEventObserver()
let callback = (UIElementInfo: UIElementInfo)=>{
console.info(UIElementInfo.bundleName)
console.info(U... |
application-dev\reference\apis-test-kit\js-apis-uitest.md | import { Driver, UIElementInfo, UIEventObserver } from '@kit.TestKit';
async function demo() {
let driver: Driver = Driver.create();
let observer: UIEventObserver = await driver.createUIEventObserver()
let callback = (UIElementInfo: UIElementInfo)=>{
console.info(UIElementInfo.bundleName)
console.info(UI... |
application-dev\reference\apis-test-kit\js-apis-uitest.md | import { BY } from '@kit.TestKit';
BY.text('123').type('Button'); |
application-dev\reference\apis-test-kit\js-apis-uitest.md | import { BY, By } from '@kit.TestKit';
let by: By = BY.text('123'); // Use the static constructor BY to create a By object and specify the text attribute of the target component. |
application-dev\reference\apis-test-kit\js-apis-uitest.md | import { By, BY } from '@kit.TestKit';
let by: By = BY.key('123'); // Use the static constructor BY to create a By object and specify the key attribute of the target component. |
application-dev\reference\apis-test-kit\js-apis-uitest.md | import { By, BY } from '@kit.TestKit';
let by: By = BY.id(123); // Use the static constructor BY to create a By object and specify the id attribute of the target component. |
application-dev\reference\apis-test-kit\js-apis-uitest.md | import { By, BY } from '@kit.TestKit';
let by: By = BY.type('Button'); // Use the static constructor BY to create a By object and specify the type attribute of the target component. |
application-dev\reference\apis-test-kit\js-apis-uitest.md | import { By, BY } from '@kit.TestKit';
let by: By = BY.clickable(true); // Use the static constructor BY to create a By object and specify the clickable attribute of the target component. |
application-dev\reference\apis-test-kit\js-apis-uitest.md | import { By, BY } from '@kit.TestKit';
let by: By = BY.scrollable(true); // Use the static constructor BY to create a By object and specify the scrollable attribute of the target component. |
application-dev\reference\apis-test-kit\js-apis-uitest.md | import { By, BY } from '@kit.TestKit';
let by: By = BY.enabled(true); // Use the static constructor BY to create a By object and specify the enabled attribute of the target component. |
application-dev\reference\apis-test-kit\js-apis-uitest.md | import { By, BY } from '@kit.TestKit';
let by: By = BY.focused(true); // Use the static constructor BY to create a By object and specify the focused attribute of the target component. |
application-dev\reference\apis-test-kit\js-apis-uitest.md | import { By, BY } from '@kit.TestKit';
let by: By = BY.selected(true); // Use the static constructor BY to create a By object and specify the selected attribute of the target component. |
application-dev\reference\apis-test-kit\js-apis-uitest.md | import { By, BY } from '@kit.TestKit';
// Use the static constructor BY to create a by object and specify that the target component is located before the given attribute component.
let by: By = BY.type('Button').isBefore(BY.text('123')); // Search for the first <Button> component located before the component whose tex... |
application-dev\reference\apis-test-kit\js-apis-uitest.md | import { By, BY } from '@kit.TestKit';
// Use the static constructor BY to create a by object and specify that the target component is located after the given attribute component.
let by: By = BY.type('Text').isAfter(BY.text('123')); // Search for the first <Text> component located after the component whose text is 12... |
application-dev\reference\apis-test-kit\js-apis-uitest.md | import { UiDriver, BY, Driver, UiComponent } from '@kit.TestKit';
async function demo() {
let driver: UiDriver = UiDriver.create();
let button: UiComponent = await driver.findComponent(BY.type('Button'));
await button.click();
} |
application-dev\reference\apis-test-kit\js-apis-uitest.md | import { UiDriver, BY, UiComponent } from '@kit.TestKit';
async function demo() {
let driver: UiDriver = UiDriver.create();
let button: UiComponent = await driver.findComponent(BY.type('Button'));
await button.doubleClick();
} |
application-dev\reference\apis-test-kit\js-apis-uitest.md | import { UiDriver, BY, UiComponent } from '@kit.TestKit';
async function demo() {
let driver: UiDriver = UiDriver.create();
let button: UiComponent = await driver.findComponent(BY.type('Button'));
await button.longClick();
} |
application-dev\reference\apis-test-kit\js-apis-uitest.md | import { UiDriver, BY, UiComponent } from '@kit.TestKit';
async function demo() {
let driver: UiDriver = UiDriver.create();
let button: UiComponent = await driver.findComponent(BY.type('Button'));
let id = await button.getId();
} |
application-dev\reference\apis-test-kit\js-apis-uitest.md | import { UiDriver, BY, UiComponent } from '@kit.TestKit';
async function demo() {
let driver: UiDriver = UiDriver.create();
let button: UiComponent = await driver.findComponent(BY.type('Button'));
let str_key = await button.getKey();
} |
application-dev\reference\apis-test-kit\js-apis-uitest.md | import { UiDriver, BY, UiComponent } from '@kit.TestKit';
async function demo() {
let driver: UiDriver = UiDriver.create();
let button: UiComponent = await driver.findComponent(BY.type('Button'));
let text = await button.getText();
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.