我有一个黄瓜功能像这样的: @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
我想要得到的每一步都多少次黄瓜测试中使用的一些统计数据 所以可以说我有一个步骤定义这样的步骤 this.When(/^"([^"]*)" is clicked$/, function (someElementId, callback){});
和2用法(在一个或多个特征文件) "a" is clicked
"b" is clicked
我想知道,这一步"([^"]*)" is click
背景 我想我最好弄清楚CucumberJS 2.0.0黄瓜表情,颇有几分自1.3.0改变。 黄瓜表达式可以在步骤的定义可以用来代替正则表达式: When(/^I search for "{searchTerm}"$/, function (searchTerm) {
相反的: When(/^I search for "([^"]*)"$/, function (searchTerm) {
所以,我实现了一个Cucumberjs数据表,但我不认为我这样做是正确的。这里我有什么 this.And(/^If I click the row "([^"]*)" then I should the following nested information$/, function (rowName, data) {
resultPage.clickRow(rowName);
因此,我们在我们相当新鲜的Angular2项目中引入了Cucumber + Gherkin来探索e2e测试。我们决定在JS中编写步骤定义。我试图在步骤定义中相当通用。 这就是我想实现: 我们有 this.Then(/^I should see (.*) on the page$/, function(componentName, callback) { expect(element(by.id(c