为什么这不起作用?
当我将功能文件运行为“以黄瓜特征运行”时,我会收到错误消息
java.lang.AssertionError: Undefined default URL for page object PageObject
页面对象
@DefaultUrl("page:register.page")
public class AccountCreationPage extends PageObject {
...
}
配置文件(serenity.config)
environments {
local {
webdriver.base.url = "https://localhost"
}
demo {
webdriver.base.url = "https://demo.example.com"
}
prod {
webdriver.base.url = "https://example.com"
}
all {
home.page = "#{webdriver.base.url}"
register.page = "#{webdriver.base.url}/register"
}
}
https://johnfergusonsmart.com/environment-specific-configuration-in-serenity-bdd/
显示@DefaultUrl("page:register.page")
宁静黄瓜4。 Java。 Eclipse。
答案 0 :(得分:0)
要求配置文件具有默认值?
environments {
default {
webdriver.base.url = "https://localhost"
}
...
all {
home.page = "#{webdriver.base.url}"
register.page = "#{webdriver.base.url}/register"
}
}