如何从web应用程序运行量角器?量角器、应用程序、web

2023-09-13 03:21:22 作者:渡°

我有一些量角器测试(针对angularApp),我想运行。要做到这一点,我已经创建了一个提示输入脚本文件的用户的用户界面。然后我需要的,不知何故,使量角器启动和运行测试。

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 ?

推荐答案

您可以通过文件到您的后端(并保存),然后执行测试,你通常会量角器conf.js

You can pass the file to your backend (and save it), which then executes the test as you normally would protractor conf.js.

如果你没有,可以通过节点运行量角器一个后端,那么你需要到餐桌自己量角器的副本,去掉任何节点的API,并做类似什么的 https://github.com/angular/protractor/blob/master/lib/runnerCli.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.