This repository was 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
TypeScript changes - change the protractor/globals
import to just protractor
#3564
Labels
Comments
juliemr
added a commit
to juliemr/protractor
that referenced
this issue
Sep 16, 2016
…globals to protractor 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 angular#3564
cnishina
pushed a commit
that referenced
this issue
Sep 16, 2016
#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
Why not make |
@thorn0 I think you can do so by using typings. I mean by installing type script definitons |
Hi @juliemr, I'd like to know how I can define those globals vars on protractor with typescript, do you have any guide fo that? since right now I'm facing this issue: My code: |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
As discussed offline:
To simplify the story for TypeScript users and eliminate confusion about globals, export global singletons from
protractor
instead ofprotractor/globals
.Before:
After
The configuration option
noGlobals
will continue to do the same thing - iftrue
, Protractor will only defineglobal.protractor
, otherwise, it will define all ofglobal.protractor, global.browser, global.element, global.by, global.$, global.$$
. Whether it is enabled or not should have no effect on TS users.The text was updated successfully, but these errors were encountered: