Commit 172ce35 1 parent 619d177 commit 172ce35 Copy full SHA for 172ce35
File tree 2 files changed +19
-0
lines changed
2 files changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -75,3 +75,21 @@ export async function mobileScreenshots (opts = {}) {
75
75
}
76
76
return infos ;
77
77
}
78
+
79
+ /**
80
+ * Return the base 64 encoded screenshot data.
81
+ * This method is called only when `appium:nativeWebScreenshot` is enabled
82
+ * to avoid proxying requests to the chromedriver.
83
+ * Without `appium:nativeWebScreenshot` or disabled, espresso driver
84
+ * proxies screenshot endpoint requests to the espresso server directly.
85
+ *
86
+ * @this {import('../driver').EspressoDriver}
87
+ * @returns {Promise<String> }
88
+ */
89
+ export async function getScreenshot ( ) {
90
+ return String (
91
+ await /** @type {import('../espresso-runner').EspressoRunner } */ (
92
+ this . espresso
93
+ ) . jwproxy . command ( '/screenshot' , 'GET' )
94
+ ) ;
95
+ }
Original file line number Diff line number Diff line change @@ -735,6 +735,7 @@ export class EspressoDriver extends AndroidDriver implements ExternalDriver<
735
735
mobileStartService = servicesCmds . mobileStartService ;
736
736
mobileStopService = servicesCmds . mobileStopService ;
737
737
738
+ getScreenshot = screenshotCmds . getScreenshot ;
738
739
mobileScreenshots = screenshotCmds . mobileScreenshots ;
739
740
740
741
mobileRegisterIdlingResources = idlingResourcesCmds . mobileRegisterIdlingResources ;
You can’t perform that action at this time.
0 commit comments