mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-04 23:07:06 +00:00
Add type for asynchronous nightwatch test hooks
This commit is contained in:
Vendored
+12
-5
@@ -2160,16 +2160,23 @@ export interface NightwatchCustomAssertions {}
|
||||
|
||||
export interface NightwatchBrowser extends NightwatchAPI, NightwatchCustomCommands, NightwatchCustomAssertions, NightwatchCustomPageObjects { }
|
||||
|
||||
/**
|
||||
* Performs an assertion
|
||||
*
|
||||
*/
|
||||
export type NightwatchTest = (browser: NightwatchBrowser) => void;
|
||||
|
||||
export interface NightwatchTests {
|
||||
export interface NightwatchTestFunctions {
|
||||
[key: string]: NightwatchTest;
|
||||
}
|
||||
|
||||
export type NightwatchTestHook = (browser: NightwatchBrowser, done: () => void) => void;
|
||||
|
||||
export interface NightwatchTestHooks {
|
||||
before?: NightwatchTestHook;
|
||||
after?: NightwatchTestHook;
|
||||
beforeEach?: NightwatchTestHook;
|
||||
afterEach?: NightwatchTestHook;
|
||||
}
|
||||
|
||||
export type NightwatchTests = NightwatchTestFunctions | NightwatchTestHooks;
|
||||
|
||||
/**
|
||||
* Performs an assertion
|
||||
*
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
import { NightwatchAPI, NightwatchTests } from 'nightwatch';
|
||||
|
||||
const test: NightwatchTests = {
|
||||
before: (browser, done) => {
|
||||
done();
|
||||
},
|
||||
'Demo test Google': (browser) => {
|
||||
browser
|
||||
.url('http://www.google.com')
|
||||
|
||||
Reference in New Issue
Block a user