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']
}
}
'wdio.conf.js'ファイルのデフォルトのタイムアウトは何ですか?それを変更しようとしましたか? – user1207289
また、コマンド実行のために 'client.pause(milliseconds);'を使用しようとしました。 – user1207289
'wdio.conf.js'を変更しました。私は90秒をかけましたが、セレンドライバは10秒間だけ待機します。 –