[meta-issue] add Blocking Proxy
Collecting issues that we'll need to reconsider (usually, because they'll be easier/improved) when we switch over to Blocking Proxy.
Background: Blocking Proxy is our plan to move logic that waits for Angular to stabilize into a separate process, a proxy which lives between the test script and the selenium endpoint, and intercept the JSON WebDriver protocol commands.
We can do better logging - https://github.com/angular/protractor/issues/2569
https://github.com/angular/protractor/issues/2986
Note that this will be available in 5.0 behind a flag.
not sure if this is the right place but after upgrading to protractor v5.1.0 typescript reports the following error:
node_modules/blocking-proxy/built/lib/blockingproxy.d.ts(6,32): error TS1039: Initializers are not allowed in ambient contexts.
typescript version: 2.0.10
Blocking Proxy is built with TypeScript 2.1, which is what's generating that definition file. If you do npm upgrade to get the latest version of Protractor's dependencies, you should get TS 2.1 and that error will go away.
thx @mgiambalvo! This means that TS2.1 is required for the current version of Protractor, right? if so, it should maybe be mentioned in the list of breaking changes.
After upgrading TS, AoT does not work.
Error: Error encountered resolving symbol values statically. Could not resolve events relative to projectdir/node_modules/blocking-proxy/built/lib/webdriver_commands.d.ts., resolving symbol WebDriverCommand in projectdir/node_modules/blocking-proxy/built/lib/webdriver_commands.d.ts
at simplifyInContext (projectdir/node_modules/@angular/compiler/bundles/compiler.umd.js:25795:27)
at StaticReflector.simplify (projectdir/node_modules/@angular/compiler/bundles/compiler.umd.js:25807:17)
at StaticReflector.annotations (projectdir/node_modules/@angular/compiler/bundles/compiler.umd.js:25299:84)
at NgModuleResolver.resolve (projectdir/node_modules/@angular/compiler/bundles/compiler.umd.js:17783:86)
at CompileMetadataResolver.getNgModuleMetadata (projectdir/node_modules/@angular/compiler/bundles/compiler.umd.js:18284:64)
at addNgModule (projectdir/node_modules/@angular/compiler/bundles/compiler.umd.js:25065:62)
at projectdir/node_modules/@angular/compiler/bundles/compiler.umd.js:25076:18
at Array.forEach (native)
at _createNgModules (projectdir/node_modules/@angular/compiler/bundles/compiler.umd.js:25075:30)
at analyzeNgModules (projectdir/node_modules/@angular/compiler/bundles/compiler.umd.js:24950:18)
Compilation failed
Ah, that's indeed the case. Angular doesn't support TS 2.1 yet (https://github.com/angular/angular/pull/13294). Sorry about that, making Protractor require TS 2.1 wasn't intentional breaking change. I'll try to get a hotfix out soon that uses a version of blocking-proxy built with TS 2.0.
thx for the clarification and your effort to provide a solution!
After upgrade to 5.1.1 I can compile with TS 2.0 but the AoT error remains
This is odd. It looks like the AoT compiler is picking up Blocking Proxy's definitions, but it shouldn't even need them. After all, Protractor isn't getting compiled into your app.
Could you share more of your project setup? Are you using angular-cli, and if so which version? As a workaround, you could try uninstalling Protractor from your project and installing it globally instead.
On Tue, Feb 7, 2017 at 11:49 AM, karlhaas [email protected] wrote:
After upgrade to 5.1.1 I get the following error during AoT compilation:
Error: Error encountered resolving symbol values statically. Could not resolve events relative to /home/karl/Work/cnc/feedbackr/Frontend/node_modules/blocking-proxy/built/lib/webdriver_commands.d.ts., resolving symbol WebDriverCommand in /home/karl/Work/cnc/feedbackr/Frontend/node_modules/blocking-proxy/built/lib/webdriver_commands.d.ts at SyntaxError.BaseError [as constructor] (/home/karl/Work/cnc/feedbackr/Frontend/node_modules/@angular/compiler/bundles/compiler.umd.js:1597:31) at new SyntaxError (/home/karl/Work/cnc/feedbackr/Frontend/node_modules/@angular/compiler/bundles/compiler.umd.js:1795:20) at simplifyInContext (/home/karl/Work/cnc/feedbackr/Frontend/node_modules/@angular/compiler/bundles/compiler.umd.js:25783:27) at StaticReflector.simplify (/home/karl/Work/cnc/feedbackr/Frontend/node_modules/@angular/compiler/bundles/compiler.umd.js:25795:17) at StaticReflector.annotations (/home/karl/Work/cnc/feedbackr/Frontend/node_modules/@angular/compiler/bundles/compiler.umd.js:25287:84) at NgModuleResolver.resolve (/home/karl/Work/cnc/feedbackr/Frontend/node_modules/@angular/compiler/bundles/compiler.umd.js:17771:86) at CompileMetadataResolver.getNgModuleMetadata (/home/karl/Work/cnc/feedbackr/Frontend/node_modules/@angular/compiler/bundles/compiler.umd.js:18272:64) at addNgModule (/home/karl/Work/cnc/feedbackr/Frontend/node_modules/@angular/compiler/bundles/compiler.umd.js:25053:62) at /home/karl/Work/cnc/feedbackr/Frontend/node_modules/@angular/compiler/bundles/compiler.umd.js:25064:18 at Array.forEach (native) Compilation failed
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/angular/protractor/issues/3375#issuecomment-278081670, or mute the thread https://github.com/notifications/unsubscribe-auth/AAAlR7uQkUi1P30gEXP62-N9DNdSWzlyks5raK6SgaJpZM4JMp5Y .
We are using https://github.com/mgechev/angular-seed (latest version). Maybe the problem is that testing files are compiled. The copy task does:
join(Config.APP_SRC, '**/*.ts'),
join(Config.APP_SRC, '**/*.json'),
'!' + join(Config.APP_SRC, '**/*.spec.ts'),
'!' + join(Config.APP_SRC, '**/*.e2e-spec.ts')
])
This means that it ignores the files ending with e2e-spec.ts but not the page object files. Thx @mgiambalvo !
@mgiambalvo we had protractor typings in tsconfig.json.
I'm also encountering this issue with angular-cli 1.0.0-beta.32. Is there a workaround?
Ah I see.. Entirely removing protractor from the project fixes this for now.
@m4mbart what do you mean by "Entirely removing protractor from the project fixes this for now." how do that?
You shouldn't need to remove protractor from package.json, just from your typings. In other words, make sure protractor's typings aren't in your tsconfig.
Does the default tsconfig from Angular CLI include them? I should fix that if so ...
On Feb 21, 2017 12:42, "shaher" [email protected] wrote:
@m4mbart https://github.com/m4mbart what do you mean by "Entirely removing protractor from the project fixes this for now." how do that?
— You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub https://github.com/angular/protractor/issues/3375#issuecomment-281457128, or mute the thread https://github.com/notifications/unsubscribe-auth/AAAlR9aeRPplFacLrYCRrnHw7YuEHcCWks5rez4JgaJpZM4JMp5Y .