0
我有一个黄瓜功能像这样的:如何在多个文件上运行一个Cucumber(使用量角器)场景?
@MainSuite
Scenario: Verify that user can login
Given I can see the login form
Then I set a username
And I set a password
And I click in Login button
Then I see the "wrong-password" message
我需要检查用户可以在5个不同的页面登录。 我需要在5个不同的地方运行该功能。 这就像我需要在/login.html,/old_login.html,/after_restore_password.html和更多内容中运行该功能(这只是一个示例)。
你知道该怎么做吗?
目前,我只有一个文件硬编码。显然我需要改变它。
this.Given(/^I can see the login form$/, function(done) {
this.goTo('login.html');
browser.wait(EC.visibilityOf(this.loginFormContainer));
done();
});
Nop。您将有2次执行给定规则,但每个下一行只有一个(当时和之后) –
您是什么意思?给定时间然后并不总是必须在三组中。这本身就是一种误解。它必须具有足够的描述性,这就是为什么“And”和“But”语法规则到位的原因。 –
检查我在主要问题中写的情景。你如何写你的建议黄瓜escenario? (用这个例子编辑你的答案,你会发现有问题。) –