Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
"webdriverio": "^5.18.7"
},
"dependencies": {
"webdriver-image-comparison": "0.13.1"
"webdriver-image-comparison": "0.13.2"
},
"repository": {
"type": "git",
Expand Down
99 changes: 58 additions & 41 deletions types/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,43 +1,60 @@
declare module WebdriverIO {
interface Browser {
/**
* Saves an image of an element
*/
saveElement(element: Element, tag: string, saveElementOptions?: {});

/**
* Saves an image of a viewport
*/
saveScreen(tag: string, saveScreenOptions?: {});

/**
* Saves an image of the complete screen
*/
saveFullPageScreen(tag: string, saveFullPageScreenOptions?: {});

/**
* Saves an image of the complete screen with the tabbable lines and dots
*/
saveTabbablePage(tag: string, saveTabbableOptions?: {});

/**
* Compare an image of an element
*/
checkElement(element: Element, tag: string, checkElementOptions?: {});

/**
* Compares an image of a viewport
*/
checkScreen(tag: string, checkScreenOptions?: {});

/**
* Compares an image of the complete screen
*/
checkFullPageScreen(tag: string, checkFullPageOptions?: {});

/**
* Compares an image of the complete screen with the tabbable lines and dots
*/
checkTabbablePage(tag: string, checkTabbableOptions?: {});
import {ScreenshotOutput} from "webdriver-image-comparison/build/helpers/afterScreenshot.interfaces";
import {ImageCompareResult} from "webdriver-image-comparison";
import {
CheckScreenMethodOptions,
SaveScreenMethodOptions
} from "webdriver-image-comparison/build/commands/screen.interfaces";
import {
CheckElementMethodOptions,
SaveElementMethodOptions,
} from "webdriver-image-comparison/build/commands/element.interfaces";
import {
CheckFullPageMethodOptions,
SaveFullPageMethodOptions
} from "webdriver-image-comparison/build/commands/fullPage.interfaces";

declare global {
namespace WebdriverIO {
interface Browser {
/**
* Saves an image of an element
*/
saveElement(element: Element, tag: string, saveElementOptions?: SaveElementMethodOptions): ScreenshotOutput;

/**
* Saves an image of a viewport
*/
saveScreen(tag: string, saveScreenOptions?: SaveScreenMethodOptions): ScreenshotOutput;

/**
* Saves an image of the complete screen
*/
saveFullPageScreen(tag: string, saveFullPageScreenOptions?: SaveFullPageMethodOptions): ScreenshotOutput;

/**
* Saves an image of the complete screen with the tabbable lines and dots
*/
saveTabbablePage(tag: string, saveTabbableOptions?: SaveFullPageMethodOptions): ScreenshotOutput;

/**
* Compare an image of an element
*/
checkElement(element: Element, tag: string, checkElementOptions?: CheckElementMethodOptions): (ImageCompareResult | number);

/**
* Compares an image of a viewport
*/
checkScreen(tag: string, checkScreenOptions?: CheckScreenMethodOptions): (ImageCompareResult | number);

/**
* Compares an image of the complete screen
*/
checkFullPageScreen(tag: string, checkFullPageOptions?: CheckFullPageMethodOptions): (ImageCompareResult | number);

/**
* Compares an image of the complete screen with the tabbable lines and dots
*/
checkTabbablePage(tag: string, checkTabbableOptions?: CheckFullPageMethodOptions): (ImageCompareResult | number);
}
}
}