问题
I've some protractor tests (against angularApp) that I would like to run. To do that, i've created an user interface that prompts an user for the script file. Then I need, somehow, make protractor start and run the test.
What are my options to achieve this ?
回答1:
You can pass the file to your backend (and save it), which then executes the test as you normally would protractor conf.js
.
If you don't have a backend that can run protractor via node, then you need to fork your own copy of Protractor, strip out any node APIs, and do something similar to what https://github.com/angular/protractor/blob/master/lib/runnerCli.js is doing, but it will be messy.
来源:https://stackoverflow.com/questions/27843015/how-to-run-protractor-from-webapp