Java 以黄瓜功能运行,未在 Eclipse 中显示

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/42399721/
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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-12 00:08:05  来源:igfitidea点击:

Run as cucumber feature not showing in eclipse

javaseleniumcucumberbdd

提问by omer siddiqi

I am new to automation. Im facing this problem while running cucumber feature. It doesnt show run as Cucumber feature option at all

我是自动化的新手。我在运行黄瓜功能时面临这个问题。它根本不显示作为黄瓜功能选项运行

Screen shot of Run as options in eclipse

在 Eclipse 中作为选项运行的屏幕截图

采纳答案by Mahipal

As, when you open a feature file in Eclipse and right-click, then you do not find an option 'Run As->Cucumber Feature', it appears that your Eclipse do not have the required Cucumber Eclipse Plug-in. You can install this plug-in using following steps:

因为,当您在 Eclipse 中打开功能文件并右键单击时,您没有找到“运行方式->Cucumber 功能”选项,您的 Eclipse 似乎没有所需的 Cucumber Eclipse 插件。您可以使用以下步骤安装此插件:

  1. Launch Eclipse and navigate to 'Help->Install New Software'.
  2. Click on 'Add' button
  3. Enter any name e.g. 'Cucumber' and type 'http://cucumber.github.com/cucumber-eclipse/update-site' as location.
  4. Click on OK.
  5. 'Cucumber Eclipse Plugin' option will appear in the available software list.
  6. Select the check box against it and click on 'Next' button.
  7. Read the terms of license agreement and click on 'I accept the terms of the license agreement” if you agree with the license terms.
  8. Click on 'Finish' button.
  9. Let it install, it will take few seconds to complete.
  1. 启动 Eclipse 并导航到“帮助->安装新软件”。
  2. 点击“添加”按钮
  3. 输入任何名称,例如“Cucumber”并键入“ http://cucumber.github.com/cucumber-eclipse/update-site”作为位置。
  4. 单击确定。
  5. 'Cucumber Eclipse Plugin' 选项将出现在可用软件列表中。
  6. 选中它的复选框,然后单击“下一步”按钮。
  7. 阅读许可协议的条款,如果您同意许可条款,请单击“我接受许可协议的条款”。
  8. 单击“完成”按钮。
  9. 让它安装,需要几秒钟才能完成。

After successful installation of this plug-in, if you open any feature file (i.e. file with .feature extension) and right-click, you should see 'Run As->Cucumber Feature' option.

成功安装此插件后,如果您打开任何功能文件(即扩展名为 .feature 的文件)并单击鼠标右键,您应该会看到“Run As->Cucumber Feature”选项。

Update 1

更新 1

In Eclipse, go to 'Windows->Preferences->Run/Debug/Launching/Launch Configuration' and uncheck 'Cucumber Feature' checkbox if it is checked. Refer to below screen shot for more details:

在 Eclipse 中,转到“Windows->首选项->运行/调试/启动/启动配置”并取消选中“Cucumber Feature”复选框(如果已选中)。有关更多详细信息,请参阅以下屏幕截图:

enter image description here

在此处输入图片说明

回答by canpan14

If it is a maven project make sure you have included it as a dependency. If you are running it as automation it would be a good idea to set it up as a maven project.

如果它是一个 Maven 项目,请确保您已将其作为依赖项包含在内。如果您将其作为自动化运行,最好将其设置为 Maven 项目。

It's hard from your brief description, but if you are seeing the 'Run as Cucumber Feature' but it isn't doing anything, I had to open up the feature, right click on the white space in it, and then run as Cucumber Feature there. For some reason that worked for me.

从您的简短描述来看很难,但是如果您看到“以黄瓜功能运行”但它没有做任何事情,我必须打开该功能,右键单击其中的空白区域,然后以黄瓜功能运行那里。出于某种原因,这对我有用。