我多久需要爲我的功能測試設置setFindTimeout?如何在intern.js中使用setFindTimeout
當我執行setFindTimeout時,有時我需要將它放在其他測試用例中以更改findBy *方法超時。
-----------------編輯------------------------
如果我在不同的文件上有多個套件,會發生什麼。 例如,我有start.js和admin.js 這是您的答案仍然適用於這種情況?
start.js
'use strict';
define([
'intern!object',
'intern/chai!assert',
'intern/dojo/node!fs'
], (registerSuite, assert, fs) => {
registerSuite(() => {
let testData;
let timeout;
let testCases;
testCases = {
name: 'Project Feature Test',
'Log into project': function() {
this.timeout = 60000 * 5;
return this.remote
.get(testData['site'])
.findByXpath('//a[@href="/saml-redirect"]').click().end()
.findById('userName').type(testData['username']).end()
.findById('password').type(testData['password']).end()
.findById('loginButton').click().end();
},
};
return testCases;
});
});
admin.js
'use strict';
define([
'intern!object',
'intern/chai!assert',
'intern/dojo/node!fs'
], (
registerSuite,
assert,
fs
) => {
registerSuite(() => {
testCases = {
name: 'Test Administration Page',
'Check User Functions': function() {
this.timeout = timeout * 3;
return this.remote
.sleep(3000)
.findByClassName('admin-button').click().end() //goto admin page
}
};
return testCases;
});
});
請在問題中添加更多上下文。可能是一些代碼。問題似乎並不十分清楚。 – RBT