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? (用這個例子編輯你的答案,你會發現有問題。) –