简体   繁体   English

尝试运行 cucumber 功能文件时控制台空白

[英]Blank console upon trying to run cucumber feature file

I am trying to run a Cucumber feature file by Right Click > Run As > Feature File.我正在尝试通过右键单击 > 运行方式 > 功能文件来运行 Cucumber 功能文件。 But no action is triggered.但是没有触发任何动作。 Blank console output. What may be the case?空白控制台 output。可能是什么情况?

I have installed the following dependencies in pom.xml:我在 pom.xml 中安装了以下依赖项:

  1. Junit Junit
  2. Cucumber-Java黄瓜-Java
  3. Cucumber-Junit黄瓜-Junit

在此处输入图像描述

Your file structure has to meet certain conditions to let cucumber run everything smoothly.您的文件结构必须满足某些条件才能让 Cucumber 顺利运行。

  1. Put your feature file to resources folder将您的功能文件放入resources文件夹
  2. You step definition file(s) has to reside at the same package as your runner class (or in sub-packages)您的步骤定义文件必须与您的 runner 类位于同一个包中(或在子包中)
  3. Your feature file in resource folder has to be at the folder that reproduces package structure where your runner class is (or subfolders)您在resource文件夹中的功能文件必须位于再现运行程序类所在的包结构(或子文件夹)的文件夹中

Say you have a package my.test.package where your runner class resides.假设您有一个包my.test.package ,您的 runner 类驻留在其中。 That means that your feature file has to be under resources/my/test/package folder or its sub-folders.这意味着您的功能文件必须位于resources/my/test/package文件夹或其子文件夹下。 At the same time your step definition file has to be under my.test.package or its sub-packages.同时您的步骤定义文件必须在my.test.package或其子包下。

Right click on feature file -> Run as -> Run Configurations -> Cucumber Feature -> select the feature file -> Run右键单击功能文件 -> 运行方式 -> 运行配置 -> Cucumber 功能 -> select 功能文件 -> 运行

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM