From 51aa6373a8efd5eac525073129e0f5cc1a9170ee Mon Sep 17 00:00:00 2001 From: Bill Armstrong Date: Thu, 18 Dec 2014 16:12:50 -0500 Subject: [PATCH] Added the testing module back in. --- .../selenium-webdriver-tests.ts | 28 ++++++++ selenium-webdriver/selenium-webdriver.d.ts | 65 +++++++++++++++++++ 2 files changed, 93 insertions(+) diff --git a/selenium-webdriver/selenium-webdriver-tests.ts b/selenium-webdriver/selenium-webdriver-tests.ts index c087267ae..467a01d3b 100644 --- a/selenium-webdriver/selenium-webdriver-tests.ts +++ b/selenium-webdriver/selenium-webdriver-tests.ts @@ -1130,4 +1130,32 @@ function TestError() { state = webdriver.error.Error.State.UNKNOWN_COMMAND; state = webdriver.error.Error.State.UNKNOWN_ERROR; state = webdriver.error.Error.State.UNSUPPORTED_OPERATION; +} + +function TestTestingModule() { + testing.before(function () { + }); + + testing.beforeEach(function () { + }); + + testing.describe("My test suite", function () { + testing.it("My test", function () { + }); + + testing.iit("My exclusive test.", function () { + }); + + }); + + testing.xdescribe("My disabled suite", function () { + testing.xit("My disabled test.", function () { + }); + }); + + testing.after(function () { + }); + + testing.afterEach(function () { + }); } \ No newline at end of file diff --git a/selenium-webdriver/selenium-webdriver.d.ts b/selenium-webdriver/selenium-webdriver.d.ts index a98e19db0..a1b777d59 100644 --- a/selenium-webdriver/selenium-webdriver.d.ts +++ b/selenium-webdriver/selenium-webdriver.d.ts @@ -4727,6 +4727,68 @@ declare module webdriver { } } +declare module testing { + /** + * Registers a new test suite. + * @param name The suite name. + * @param fn The suite function, or {@code undefined} to define a pending test suite. + */ + function describe(name: string, fn: Function): void; + + /** + * Defines a suppressed test suite. + * @param name The suite name. + * @param fn The suite function, or {@code undefined} to define a pending test suite. + */ + function xdescribe(name: string, fn: Function): void; + + /** + * Register a function to call after the current suite finishes. + * @param fn + */ + function after(fn: Function): void; + + /** + * Register a function to call after each test in a suite. + * @param fn + */ + function afterEach(fn: Function): void; + + /** + * Register a function to call before the current suite starts. + * @param fn + */ + function before(fn: Function): void; + + /** + * Register a function to call before each test in a suite. + * @param fn + */ + function beforeEach(fn: Function): void; + + /** + * Add a test to the current suite. + * @param name The test name. + * @param fn The test function, or {@code undefined} to define a pending test case. + */ + function it(name: string, fn: Function): void; + + /** + * An alias for {@link #it()} that flags the test as the only one that should + * be run within the current suite. + * @param name The test name. + * @param fn The test function, or {@code undefined} to define a pending test case. + */ + function iit(name: string, fn: Function): void; + + /** + * Adds a test to the current suite while suppressing it so it is not run. + * @param name The test name. + * @param fn The test function, or {@code undefined} to define a pending test case. + */ + function xit(name: string, fn: Function): void; +} + declare module 'selenium-webdriver/chrome' { export = chrome; } @@ -4743,3 +4805,6 @@ declare module 'selenium-webdriver' { export = webdriver; } +declare module 'selenium-webdriver/testing' { + export = testing; +} \ No newline at end of file