기능 테스트를 위해 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;
});
});
는
'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