Skip to content
This repository was archived by the owner on Jul 29, 2024. It is now read-only.

TypeScript compile error for protractor.promise #3437

Closed
skywalker5727 opened this issue Aug 2, 2016 · 2 comments
Closed

TypeScript compile error for protractor.promise #3437

skywalker5727 opened this issue Aug 2, 2016 · 2 comments
Assignees

Comments

@skywalker5727
Copy link

Bug report

Converting my tests to TypeScript. Test uses Protractor promise
var deferred = protractor.promise.defer();
added 'protractor' to import from protractor/globals.
Getting Typescript error: Property 'promise' does not exist on type 'Protractor'.
Using Visual Studio typescript compiler or gulp-typescript with tsconfig.json
"compilerOptions": {
"target": "es2015",
"module": "commonjs",
"moduleResolution": "node",
"sourceMap": false,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"removeComments": false,
"noImplicitAny": false,
"outDir": "./built"

Are there missing typings to use protractor.promise?

  • Node Version: 6.3.1
  • Protractor Version: 4.0.2
  • Browser(s): ``
  • Operating System and Version Windows 10
  • Your protractor configuration file
  • A relevant example test
  • Output from running the test
  • Steps to reproduce the bug
  • The URL you are running your tests against (if relevant)

Feature Request

  • Reasons for adopting new feature
  • Is this a breaking change? (How will this affect existing functionality)
@cnishina cnishina added this to the 4.0.3 milestone Aug 2, 2016
@cnishina cnishina self-assigned this Aug 2, 2016
@cnishina
Copy link
Contributor

cnishina commented Aug 2, 2016

I believe this is because I created a different interface and applied it to the protractor object. In the global protractor, promise actually exists but then this happened:

globals.ts

export interface Protractor {
  // defined some variables that are associated with Protractor
}
export let protractor: Protractor = global['protractor'];

This should use the Protractor namespace... will be addressed.

@cnishina
Copy link
Contributor

cnishina commented Aug 4, 2016

closed with 5f690fe

@cnishina cnishina closed this as completed Aug 4, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants