Add typeInterval constructor option and screenshot overload for clipping path

This commit is contained in:
Andrew Lessels
2017-08-18 08:42:17 +10:00
parent 5d6c651a1a
commit 73dd4e148f
2 changed files with 7 additions and 0 deletions
+2
View File
@@ -96,6 +96,7 @@ declare class Nightmare {
removeListener(event: 'error', cb: (msg: string, trace?: Nightmare.IStackTrace[]) => void): Nightmare;
removeListener(event: 'timeout', cb: (msg: string) => void): Nightmare;
screenshot(path: string): Nightmare;
screenshot(path: string, clip: Object): Nightmare;
html(path: string, saveType: string): Nightmare;
html(path: string, saveType: 'HTMLOnly'): Nightmare;
html(path: string, saveType: 'HTMLComplete'): Nightmare;
@@ -134,6 +135,7 @@ declare namespace Nightmare {
cookiesFile?: string;
phantomPath?: string;
show?: boolean;
typeInterval?: number;
}
export interface IRequest {
+5
View File
@@ -167,6 +167,11 @@ new Nightmare()
.screenshot('test/test.png')
.run(done);
new Nightmare()
.goto('http://yahoo.com')
.screenshot('test/test.png', { x: 10, y: 5, width: 10, height: 10})
.run(done);
new Nightmare()
.goto('http://yahoo.com')
.pdf('test/test.pdf')