-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: supports control of iOS and Android devices through appium
- Loading branch information
Showing
39 changed files
with
2,833 additions
and
1,048 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
import type { WebKeyInput } from './common/page'; | ||
import type { ElementInfo } from './extractor/extractor'; | ||
|
||
type encodingType = 'base64' | 'binary'; | ||
type imageType = 'jpeg' | 'png'; | ||
|
||
export type screenshotOptions = { | ||
path?: string; | ||
encoding?: encodingType; | ||
type?: imageType; | ||
quality?: number; | ||
}; | ||
export type MouseButton = 'left' | 'right' | 'middle'; | ||
|
||
export abstract class AbstractPage { | ||
abstract screenshot(options: screenshotOptions): Promise<Uint8Array>; | ||
abstract getElementInfos(): Promise<ElementInfo[]>; | ||
abstract url(): string; | ||
|
||
get mouse() { | ||
return { | ||
click: async ( | ||
x: number, | ||
y: number, | ||
options: { button: MouseButton }, | ||
) => {}, | ||
wheel: async (deltaX: number, deltaY: number) => {}, | ||
move: async (x: number, y: number) => {}, | ||
}; | ||
} | ||
|
||
get keyboard() { | ||
return { | ||
type: async (text: string) => {}, | ||
press: async (key: WebKeyInput) => {}, | ||
}; | ||
} | ||
|
||
async selectAll(): Promise<void> {} | ||
|
||
abstract scrollUntilTop(): Promise<void>; | ||
abstract scrollUntilBottom(): Promise<void>; | ||
abstract scrollUpOneScreen(): Promise<void>; | ||
abstract scrollDownOneScreen(): Promise<void>; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
export { PageAgent as AppiumAgent } from '@/common/agent'; | ||
export { Page as AppiumPage } from './page'; |
Oops, something went wrong.