webdriverJS を使用していくつかのキュウリ テストを作成しています。各シナリオの後に、アフター フックを使用してブラウザー ウィンドウを閉じようとしています。問題は、ウィンドウが閉じますが、再度開かないことです。ウィンドウが「見つからない」というエラーが表示されます。どんな助けや洞察も大歓迎です。
これが私の.featureファイルです
Background
Given I go to the website "..."
Scenario: One
When I click() on "..."
When I getText() of the title "..."
Then the title should be "..."
Scenario: Two
When I click() on "..."
When I getText() of the title "..."
Then the title should be "..."
ここに私のhooks.jsファイルがあります
var ID = null;
module.exports = function(){
this.After( function (err, next){
client
.getCurrentTabId( function(err, tabID){
ID = tabID;
expect(err).to.be.null;
next() })
.close( ID, function(err){
console.log('-------------CLOSE-------------');
next(); });
});
};
.js ファイルの最初の数行を次に示します。
client = webdriverjs.remote({ desiredCapabilities: {browserName: 'safari'}, logLevel:
'verbose'});
module.exports = function()
{
client.init();
this.Given(/^I go to the website "([^"]*)"$/, function (url, next){
client
.url(url)
console.log("BACKGROUND STATEMENT");
next();
});