Skip to content

Commit babfbca

Browse files
authored
Merge pull request #272 from maksym-moshniaha/WAT-5355
WAT-5355: Add possibility to take screenshots of elements
2 parents e018778 + b227149 commit babfbca

4 files changed

Lines changed: 201 additions & 86 deletions

File tree

core/types/src/browser-proxy/enums.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ export const enum BrowserProxyActions {
5757
getText = 'getText',
5858
elementIdSelected = 'elementIdSelected',
5959
makeScreenshot = 'makeScreenshot',
60+
makeElementScreenshot = 'makeElementScreenshot',
6061
uploadFile = 'uploadFile',
6162
end = 'end',
6263
kill = 'kill',

core/types/src/browser-proxy/index.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,14 @@ export type ShadowCssSelector = {
1313
isShadowElement: true;
1414
};
1515

16-
export type Selector =
16+
export type Selector =
1717
| XpathSelector
1818
| ShadowCssSelector;
1919

20-
export const isXpathSelector = (selector: Selector): selector is XpathSelector =>
20+
export const isXpathSelector = (selector: Selector): selector is XpathSelector =>
2121
selector.type === 'xpath';
2222

23-
export const isShadowCssSelector = (selector: Selector): selector is ShadowCssSelector =>
23+
export const isShadowCssSelector = (selector: Selector): selector is ShadowCssSelector =>
2424
selector.type === 'shadow-css';
2525

2626
export interface IBrowserProxyController {
@@ -175,6 +175,8 @@ export interface IBrowserProxyPlugin {
175175

176176
makeScreenshot(applicant: string): Promise<string | void>;
177177

178+
makeElementScreenshot(applicant: string, selector: Selector, scroll?: boolean): Promise<string | void>;
179+
178180
uploadFile(applicant: string, filePath: string): Promise<string | void>;
179181

180182
getCssProperty(

0 commit comments

Comments
 (0)