This repository has been archived by the owner on Jul 29, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(typescript): move typescript variable instances from protractor/… (
#3565) Breaking change for TypeScript: Instead of importing globals like `browser` from `protractor/globals`, import from `protractor`. Before: ```ts import {browser, element} from 'protractor/globals'; import {ElementFinder} from 'protractor'; describe('my app', () => { myElement: ElementFinder; beforeEach(() => { browser.get('example.com'); myElement = element(by.css('foo')); }); }); ``` After ```ts import {browser, element, ElementFinder} from 'protractor'; describe('my app', () => { myElement: ElementFinder; beforeEach(() => { browser.get('example.com'); myElement = element(by.css('foo')); }); }); ``` Closes #3564
- Loading branch information
Showing
12 changed files
with
46 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,5 +14,4 @@ npm-debug.log | |
.idea/ | ||
|
||
*.swp | ||
globals.js | ||
globals.d.ts | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,4 +19,3 @@ libpeerconnection.log | |
npm-debug.log | ||
xmloutput* | ||
release.md | ||
globals.ts |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
/// <reference path="../typings/index.d.ts" /> | ||
|
||
// TODO: we'd like to remove the triple-slash reference, but it's necessary | ||
// until definitely-typed is updated for selenium-webdriver. | ||
|
||
import {ElementHelper, ProtractorBrowser} from './browser'; | ||
import {ElementArrayFinder, ElementFinder} from './element'; | ||
import {ProtractorExpectedConditions} from './expectedConditions'; | ||
import {ProtractorBy} from './locators'; | ||
import {Ptor} from './ptor'; | ||
|
||
// Re-export public types. | ||
export {ElementHelper, ProtractorBrowser} from './browser'; | ||
export {Config} from './config'; | ||
export {ElementArrayFinder, ElementFinder} from './element'; | ||
export {ProtractorExpectedConditions} from './expectedConditions'; | ||
export {ProtractorBy} from './locators'; | ||
export {Ptor} from './ptor'; | ||
|
||
// Export API instances based on the global Protractor object. | ||
// We base this on NodeJS `global` because we do not want to mask | ||
// with a different instance of Protractor if the module is | ||
// installed both globally and locally. | ||
export let protractor: Ptor = (global as any)['protractor']; | ||
export let browser: ProtractorBrowser = protractor.browser; | ||
export let $: (search: string) => ElementFinder = protractor.$; | ||
export let $$: (search: string) => ElementArrayFinder = protractor.$$; | ||
export let element: ElementHelper = protractor.element; | ||
export let By: ProtractorBy = protractor.By; | ||
export let by: ProtractorBy = protractor.by; | ||
export let wrapDriver: | ||
(webdriver: any, baseUrl?: string, rootElement?: string, | ||
untrackOutstandingTimeouts?: boolean) => ProtractorBrowser = | ||
protractor.wrapDriver; | ||
export let ExpectedConditions: ProtractorExpectedConditions = | ||
protractor.ExpectedConditions; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,3 +2,4 @@ node_modules | |
typings | ||
conf.js | ||
typescript_spec.js | ||
npm-debug.log |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters