このページの例に従っていますcucumber-js / docs / nodejs_example.md
時々それは通過します、しかし私もたくさんのタイムアウトを受け取ります。 例を更新する必要がありますか、それともこれはテストランナーの問題ですか?
NodeJS v6.9.1
"chromedriver": "^2.28.0",
"cucumber": "2.0.0-rc.9",
"selenium-webdriver": "^3.3.0"
Feature: Example feature
As a user of Cucumber.js
I want to have documentation on Cucumber
So that I can concentrate on building awesome applications
Scenario: Reading documentation
✔ Given I am on the Cucumber.js GitHub repository
✔ When I click on "CLI"
✖ Then I should see "Running specific features"
Failures:
1) Scenario: Reading documentation - features/documentation.feature:6
Step: Then I should see "Running specific features" - features/documentation.feature:9
Step Definition: features/step_definitions/browser_steps.js:15
Message:
Error: function timed out after 5000 milliseconds
at Timeout.<anonymous> (node_modules/cucumber/lib/user_code_runner.js:91:22)
at ontimeout (timers.js:365:14)
at tryOnTimeout (timers.js:237:5)
at Timer.listOnTimeout (timers.js:207:5)
1 scenario (1 failed)
3 steps (1 failed, 2 passed)
md5-2a2c7c10e6fd71308dbd83970eac71b5
Feature: Example feature
As a user of Cucumber.js
I want to have documentation on Cucumber
So that I can concentrate on building awesome applications
Scenario: Reading documentation
✖ Given I am on the Cucumber.js GitHub repository
- When I click on "CLI"
- Then I should see "Running specific features"
Failures:
1) Scenario: Reading documentation - features/documentation.feature:6
Step: Given I am on the Cucumber.js GitHub repository - features/documentation.feature:7
Step Definition: features/step_definitions/browser_steps.js:5
Message:
Error: function timed out after 5000 milliseconds
at Timeout.<anonymous> (node_modules/cucumber/lib/user_code_runner.js:91:22)
at ontimeout (timers.js:365:14)
at tryOnTimeout (timers.js:237:5)
at Timer.listOnTimeout (timers.js:207:5)
1 scenario (1 failed)
3 steps (1 failed, 2 skipped)
私はこれが私のために働いていることを確認しました。 タイムアウトを上げてみてください。
編集:ご迷惑をおかけして申し訳ありません。 このメッセージを投稿してから5分で、ここで説明するステップタイムアウトを増やすための解決策を見つけました。 この問題を見つけた人のためにここにコメントを残してください
@charlierudolph 、どこでタイムアウトを増やしますか? これは、auth0を使用してログインするために作成した関数です。
login(userId, password): void {
let self: any = this;
self.signInButton.click().then(function () {
self.password.sendKeys(password)
// element(by.css('input[name="password"]')).sendKeys(password);
browser.waitForAngularEnabled(false);
self.email.sendKeys(userId);
self.loginSubmitButton.click().then(function() {
browser.driver.wait(function() {
return self.loginConfirmationWindow.isPresent();
}, 15000).then(function() {
return;
}, function(){
console.log(new Error('Login confirmed window did not show up'));
return;
})
self.loginConfirmationClose.click();
});
})
}
browser.driver.wait
関数に15秒のタイムアウトを与えたことは知っていますが、それは問題ではありません。ステップは5秒でタイムアウトします。
次に、config.tsに次の値をグローバルに追加しようとしました
allScriptsTimeout: 60000,
getPageTimeout: 60000,
setDefaultTimeout: 60000,
このすべての後でも、私はまだ次のエラーが発生します
Error: function timed out after 5000 milliseconds
at Timeout.<anonymous> (/Users/mohamedr2/workspace/test_app/node_modules/cucumber/lib/user_code_runner.js:91:22)
at ontimeout (timers.js:386:14)
at tryOnTimeout (timers.js:250:5)
at Timer.listOnTimeout (timers.js:214:5)
このスレッドは、閉じられた後に最近のアクティビティがないため、自動的にロックされています。 関連するバグについては、新しい問題を開いてください。
最も参考になるコメント
編集:ご迷惑をおかけして申し訳ありません。 このメッセージを投稿してから5分で、ここで説明するステップタイムアウトを増やすための解決策を見つけました。 この問題を見つけた人のためにここにコメントを残してください
@charlierudolph 、どこでタイムアウトを増やしますか? これは、auth0を使用してログインするために作成した関数です。
browser.driver.wait
関数に15秒のタイムアウトを与えたことは知っていますが、それは問題ではありません。ステップは5秒でタイムアウトします。次に、config.tsに次の値をグローバルに追加しようとしました
このすべての後でも、私はまだ次のエラーが発生します