2016-09-19 13 views
1

webdriverio、selenium standalone、およびGulpを使用してテストオートメーションを作成しようとしています。アプリ内でSeleniumが実行されていますが、Seleniumのタイムアウトのデフォルト値を編集することはできません。ページはうまくロードされますが、それは非常に遅いですし、私はデフォルトの10秒のタイムアウトを取得します。 TimeOutを編集するにはどうしたらいいですか?セレンスタンドアロンでタイムアウトを編集できません

ここに私のコードは、セレンのサーバーをロードすることです。 gulpfile.babel

import gulp from 'gulp'; 
import selenium from 'selenium-standalone'; 
import webdriver from 'gulp-webdriver'; 

let seleniumServer; 

gulp.task('selenium:start', (done) => { 
    selenium.install({ logger: function(message) {} },() => { 
     selenium.start((err, child) => { 
      if (err) { return done(err); } 
      seleniumServer = child; 
      done(); 
     }); 
    }); 

}); 

gulp.task('config:setup', ['selenium:start'],() => { 
    return gulp.src('wdio.conf.js') 
     .pipe(webdriver({ 
      waitforTimeout: 60000 
     })).on('error',() => { 
      seleniumServer.kill(); 
      process.exit(1); 
     }); 
}); 
gulp.task('handler', ['config:setup'],() => { 
    seleniumServer.kill(); 
}); 

私のテストケース事前に

describe('Creating a new invitation request', function() { 
    let _page, _container; 
    before(() => { 
     _page = new page.page(); 
     _container = new container.container(); 

    }); 
    it('request invitation', function() { 
     _page.navigate(_container.urlBase); 
     expect(_page.createNewRequest(_container.userToCreate)); 
    }); 
}); 

感謝。

編集は、mochaOpts属性に、wdio.conf.jsにwdio.conf.jsファイルで

exports.config = { 
    specs: [ 
     './testcases/*.js' 
    ], 
    exclude: [  
     './excluded/out/*.js' 
    ], 
    maxInstances: 1, 
capabilities: 
    capabilities: [{  
     maxInstances: 1, 
     browserName: 'chrome' 
    }], 
    sync: true, 
    logLevel: 'silent', 
    coloredLogs: true, 
    screenshotPath: './errorShots/', 
    baseUrl: 'http://localhost', 
    waitforTimeout: 90000, 
    connectionRetryTimeout: 90000, 
    connectionRetryCount: 3, 
    framework: 'mocha', 
    mochaOpts: { 
     compilers: ['js:babel-core/register'] 
    } 
} 
+0

'wdio.conf.js'ファイルのデフォルトのタイムアウトは何ですか?それを変更しようとしましたか? – user1207289

+0

また、コマンド実行のために 'client.pause(milliseconds);'を使用しようとしました。 – user1207289

+0

'wdio.conf.js'を変更しました。私は90秒をかけましたが、セレンドライバは10秒間だけ待機します。 –

答えて

0

を追加compilerオプションの下で希望ミリ秒でtimeoutを追加しました。 設定は次のようになりました:

exports.config = { 
    specs: [ 
     './testcases/*.js' 
    ], 
    exclude: [  
     './excluded/out/*.js' 
    ], 
    maxInstances: 1, 
capabilities: 
    capabilities: [{  
     maxInstances: 1, 
     browserName: 'chrome' 
    }], 
    sync: true, 
    logLevel: 'silent', 
    coloredLogs: true, 
    screenshotPath: './errorShots/', 
    baseUrl: 'http://localhost', 
    waitforTimeout: 90000, 
    connectionRetryTimeout: 90000, 
    connectionRetryCount: 3, 
    framework: 'mocha', 
    mochaOpts: { 
     compilers: ['js:babel-core/register'], 
     timeout: 90000 
    } 
} 
+0

だから、フレームワークタイムアウトになった – user1207289

関連する問題