TrilonIO / aspnetcore-angular-universal

ASP.NET Core & Angular Universal advanced starter - PWA w/ server-side rendering for SEO, Bootstrap, i18n internationalization, TypeScript, unit testing, WebAPI REST setup, SignalR, Swagger docs, and more! By @TrilonIO
https://www.trilon.io
MIT License
1.46k stars 433 forks source link

Protractor #438

Closed jrmcdona closed 6 years ago

jrmcdona commented 7 years ago

I see that Protractor is an upcoming feature.

Does anybody have any basic info of how to get that going or seen an article for setting that up in our Angular/dotnet world? I am tryin to make it happen but adding back in the angular cli but so far haven't been able to piece it altogether. Thanks!

MarkPieszak commented 7 years ago

It should be basically just how the CLI has it setup, since we have the basics of the CLI (the angular-cli.json) in here, it should just be that main protractor file. Afterwards ng e2e should work.

jrmcdona commented 7 years ago

I tried that @MarkPieszak but it is looking for the entry point index.html which we don't have. So that is the first error I am hitting and trying to figure out what to provide as entry point in angular cli settings for e2e

ERROR in Error: Child compilation failed: Entry module not found: Error: Can't resolve 'C:\Users\v-jormc\Source\Repos\Xbox.Ambassadors\Microsoft.Ambassadors\Microsoft.Ambassadors.Web.Client\ClientApp\src\index.html' in 'C:\Users\v-jormc\Source\Repos\Xbox.Ambassadors\Microsoft.Ambassadors\Microsoft.Ambassadors.Web.Client\node_modules\@angular\cli\models\webpack-configs': Error: Can't resolve 'C:\Users\v-jormc\Source\Repos\Xbox.Ambassadors\Microsoft.Ambassadors\Microsoft.Ambassadors.Web.Client\ClientApp\src\index.html' in 'C:\Users\v-jormc\Sou rce\Repos\Xbox.Ambassadors\Microsoft.Ambassadors\Microsoft.Ambassadors.Web.Client\node_modules\@angular\cli\models\webpack-configs'

BillSheldon-HunterIndustries commented 7 years ago

Here at Hunter Industries, we are working with a version of this repository on one of our projects. It was possible to get protractor working on the local dev machine. There were several steps around setting up the environment. (ex. it has a dependency on JRE)

However, when we looked at our updating our GOCD pipeline, getting protractor running on those machines became prohibitively expensive. We ended up walking away from Protractor and just using the tools in Visual Studio to automate/manage our BDD testing.

MarkPieszak commented 7 years ago

I used to have Protractor setup when it was the older 2.x version, you can check out the protractor file and package.json and see if it can help you get it setup!

https://github.com/MarkPieszak/aspnetcore-angular2-universal/tree/old-2.x-universal-branch/src/Angular2Spa

@jrmcdona It'd be great to have it as part of the repo again for sure! PRs always welcome :)

jrmcdona commented 7 years ago

@MarkPieszak that helped a lot. However, that old project doesn't use the angular cli to run the tests. It just executes protractor it looks like. I was trying to use "ng e2e" earlier in my own project and hit issues.

I got it to work with your old npm run e2e command which runs protractor.

However, I had to launch the app first so that localhost:5000 was actually available before I ran the tests. Is that always the case? Is there a better way to automate that piece?

I am happy to PR again once we work through this.

If anybody else has ideas about running it through Angular CLI, let us know!

MarkPieszak commented 6 years ago

CLI based template will have protractor all wired up, so closing this out for now :+1: