如何使用 Eclipse 配置量角器
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/35344636/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
how to Configure protractor using Eclipse
提问by Saurabh
When i have followed steps given on How can we use protractor in eclipse?i did not get any option to run as protractor in eclipse during run. please help me out
当我按照如何在 eclipse 中使用量角器中给出的步骤进行操作时?在运行期间,我没有任何选项可以在 eclipse 中作为量角器运行。请帮帮我
回答by vdrulerz
I was able to configure protractor tests in eclipse and below are the steps which I performed including one error that I resolved with some tweaks.
我能够在 eclipse 中配置量角器测试,以下是我执行的步骤,包括我通过一些调整解决的一个错误。
- Open Eclipse market place > Search for AngularJS Eclipse > Install AngularJS Eclipse 1.X.X
- Create Java Script Project
- Add conf.js and example-spec.js in the java script project (both JS are preloaded inside example folder of protractor directory)
- Now from command prompt navigate inside this java script directory and execute command :- npm install protractor (this command will load node_modules folder inside your project directory)
- Convert Java Script Project to Tern Project (Right click on project
Configure > Convert to Tern Project)
- A new modal window will appear > Select Jasmine & Protractor check box > Apply
- Now go to Run configuration of your project (Right click on your project > Run > Run configuration)
- You would see protractor(in left pane)> Add a new configuration of Protractor > Add path of conf.js (Main tab)> Add path of Working Directory (Main tab)
- From the second sub tab which says protractor > Add path of cli.js (this must be with in protractor folder > built > cli.js)
- Select apply and run
- I came across below error
- 打开 Eclipse 市场 > 搜索 AngularJS Eclipse > 安装 AngularJS Eclipse 1.XX
- 创建 Java 脚本项目
- 在java脚本项目中添加conf.js和example-spec.js(两个JS都预加载在量角器目录的example文件夹中)
- 现在从命令提示符在这个 java 脚本目录中导航并执行命令:- npm install protractor(此命令将加载项目目录中的 node_modules 文件夹)
- 将 Java Script 项目转换为 Tern 项目(右键单击项目
配置 > 转换为 Tern 项目)
- 将出现一个新的模式窗口 > 选择 Jasmine & Protractor 复选框 > 应用
- 现在去运行你的项目配置(右键单击你的项目>运行>运行配置)
- 您将看到量角器(在左窗格中)> 添加量角器的新配置 > 添加 conf.js 路径(主选项卡)> 添加工作目录路径(主选项卡)
- 从第二个子选项卡中显示量角器 > 添加 cli.js 的路径(这必须在量角器文件夹中 > 内置 > cli.js)
- 选择应用并运行
- 我遇到以下错误
E/direct - Error message: Could not find update-config.json. Run 'webdriver-manager update' to download binaries.
E/direct - 错误消息:找不到 update-config.json。运行“webdriver-manager update”以下载二进制文件。
- This error I resolved after pasting webdriver-manager folder from AppData > npm > Node_modules > Protractor > Webdriver-manager to WorkingDirector > Node_modules > protractor > webdriver-manager
- 我在将 webdriver-manager 文件夹从 AppData > npm > Node_modules > Protractor > Webdriver-manager 粘贴到 WorkingDirector > Node_modules > protractor > webdriver-manager 后解决了这个错误
Thanks !
谢谢 !
回答by Saurabh
I have find out the way to configure eclipse to run protractor test cases. it is given in below link https://github.com/angelozerr/angularjs-eclipse/wiki/Protractor
我已经找到了配置 eclipse 以运行量角器测试用例的方法。它在下面的链接 https://github.com/angelozerr/angularjs-eclipse/wiki/Protractor 中给出
回答by Seetaram Hegde
I have tried all of the above but nothing seem to work as my eclipse is the latest one. Latest eclipse has new plugins. AngularJS plugin is deprecated and renamed as Wild Web Developer and there is one more plugin called "Nodeclipse.github.io" which contains Tern project. Here is a link below which gives the detailed installation and configuration of the protractor with the latest eclipse and other plugins.
我已经尝试了上述所有方法,但似乎没有任何效果,因为我的日食是最新的。最新的 eclipse 有新的插件。AngularJS 插件已弃用并重命名为 Wild Web Developer,还有一个名为“Nodeclipse.github.io”的插件,其中包含 Tern 项目。这是下面的链接,它提供了带有最新 eclipse 和其他插件的量角器的详细安装和配置。
http://selftechy.com/2019/12/08/setting-up-protractor-with-latest-eclipse-windows-plugins-settings
http://selftechy.com/2019/12/08/setting-up-protractor-with-latest-eclipse-windows-plugins-settings