java - 如何在 Mac 上运行黄瓜教程时修复错误
问题描述
我正在尝试在 Mac 上运行黄瓜教程示例。我按照教程的说明进入该给定页面(据我理解的说明),并按照该页面上的说明创建了文件(即 files和),annotation.java
如.runTest.java
outline.feature
Annotation
src/test/java
使用的版本:
- macOS 10.13.6
- eclipse: 2019-03 (?) (找不到eclipse版本,真烦!)
- 六月 4.10
- 小黄瓜 2.9.3
eclipse
文件被保存并且在编辑器中没有显示任何明显的错误。但是当我这样做时runTest.java
-> runAs
->JUnit test
我收到以下错误:
Feature: annotation
#This is how background can be used to eliminate duplicate steps
Background: [90m# Annotation/outline.feature:4[0m
User navigates to Facebook Given
I am on Facebook login page
#Scenario with AND
Scenario: [90m# Annotation/outline.feature:9[0m
[90mWhen [0m[90mI enter username as "[0m[90m[1mTOM[0m[90m"[0m [90m# annotation.enterUsername(String)[0m
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by cucumber.runtime.xstream.converters.collections.TreeMapConverter (file:/Users/adietz/.m2/repository/info/cukes/cucumber-core/1.0.2/cucumber-core-1.0.2.jar) to field java.util.TreeMap.comparator
WARNING: Please consider reporting this to the maintainers of cucumber.runtime.xstream.converters.collections.TreeMapConverter
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
[1A [31mWhen [0m[31mI enter username as "[0m[31m[1mTOM[0m[31m"[0m [90m# annotation.enterUsername(String)[0m
[31mjava.lang.NullPointerException
at Annotation.annotation.enterUsername(annotation.java:22)
at ✽.When I enter username as "TOM"(Annotation/outline.feature:10)
[0m
[90mAnd [0m[90mI enter password as "[0m[90m[1mJERRY[0m[90m"[0m [90m# annotation.enterPassword(String)[0m
[1A [36mAnd [0m[36mI enter password as "[0m[36m[1mJERRY[0m[36m"[0m [90m# annotation.enterPassword(String)[0m
[90mThen [0m[90mLogin should fail[0m [90m# annotation.checkFail()[0m
[1A [36mThen [0m[36mLogin should fail[0m [90m# annotation.checkFail()[0m
#This is how background can be used to eliminate duplicate steps
Background: [90m# Annotation/outline.feature:4[0m
User navigates to Facebook Given
I am on Facebook login page
#Scenario with BUT
Scenario: [90m# Annotation/outline.feature:15[0m
[90mWhen [0m[90mI enter username as "[0m[90m[1mTOM[0m[90m"[0m [90m# annotation.enterUsername(String)[0m
[1A [31mWhen [0m[31mI enter username as "[0m[31m[1mTOM[0m[31m"[0m [90m# annotation.enterUsername(String)[0m
[31mjava.lang.NullPointerException
at Annotation.annotation.enterUsername(annotation.java:22)
at ✽.When I enter username as "TOM"(Annotation/outline.feature:16)
[0m
[90mAnd [0m[90mI enter password as "[0m[90m[1mJERRY[0m[90m"[0m [90m# annotation.enterPassword(String)[0m
[1A [36mAnd [0m[36mI enter password as "[0m[36m[1mJERRY[0m[36m"[0m [90m# annotation.enterPassword(String)[0m
[90mThen [0m[90mLogin should fail[0m [90m# annotation.checkFail()[0m
[1A [36mThen [0m[36mLogin should fail[0m [90m# annotation.checkFail()[0m
[90mBut [0m[90mRelogin option should be available[0m [90m# annotation.checkRelogin()[0m
[1A [36mBut [0m[36mRelogin option should be available[0m [90m# annotation.checkRelogin()[0m
java.lang.NullPointerException
at Annotation.annotation.enterUsername(annotation.java:22)
at ✽.When I enter username as "TOM"(Annotation/outline.feature:10)
java.lang.NullPointerException
at Annotation.annotation.enterUsername(annotation.java:22)
at ✽.When I enter username as "TOM"(Annotation/outline.feature:16)
我不是专家java
,当然也不是专家eclipse
。那么我该如何解决这个错误呢?以及如何与该教程的创建者取得联系,以便他们更新教程(使其更清晰)?
解决方案
推荐阅读
- flutter - Flutter - 尝试使用 Tensorflowlite - FloatEfficientNet
- c# - 如何使用 c# 将 DTO 添加到列表对象
- java - 如何在对象列表中推送值?
- flutter - 如何使用 Flutter 在 AnalogClock() 小部件中显示不同时区的时间?
- react-native - 如何创建一个滚动视图,它在某个特定视图处停止?
- sql-server - 用于了解 SQL Server 中用户权限的简单备用查询
- kubernetes - 在非 AWS Kubernetes 集群上使用 aws-virtual-gpu-device-plugin
- android - Android 11位置权限弹出,用户点击“仅这一次”选项时,为什么操作系统不再询问权限
- typescript - 有没有办法在以下打字稿代码中写单行?
- python - 错误:方法获取不允许用于 url scrapy