简体   繁体   English

Selenium 代码(CUCUMBER)未在 Intellij IDEA 上执行

[英]Selenium Code (CUCUMBER) not getting executed on Intellij IDEA

When I run my Cucumber test runner file on Intellij IDEA, I am not able to see any output on the console except the message "Process finished with exit code 0".当我在 Intellij IDEA 上运行我的 Cucumber 测试运行程序文件时,我无法在控制台上看到任何 output,除了消息“进程完成,退出代码 0”。 The actual code will not run can anyone please help me?实际代码将无法运行,任何人都可以帮助我吗?

在此处输入图像描述

mvn test error: mvn 测试错误:mvn 测试错误

Project structure:项目结构:项目结构

Entire Screenshot:整个截图:完整截图

There are several places to fix in your project:您的项目中有几个地方需要修复:

  • Better to keep your test runner and step definitions in tests but not in main最好将测试运行程序和步骤定义保留在tests中,但不要保留在main
  • Folder that contains feature files, package where your test runner is located and package where your step definition files are located have to match in a certain way:包含功能文件的文件夹,您的测试运行器所在的 package 和您的步骤定义文件所在的 package 必须以某种方式匹配:
    • If your test runner is in package my.test.package then your step definition code has to be placed either in my.test.package or to the sub-packages如果您的测试运行程序位于 package my.test.package中,那么您的步骤定义代码必须放在my.test.package中或
    • If your test runner is in package my.test.package then your feature files have to be placed to the folder resources/my/test/package or sub-folders.如果您的测试运行程序位于 package my.test.package中,那么您的功能文件必须放置到文件夹resources/my/test/package或子文件夹中。

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

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