InternのWebアプリケーションの機能テストを記述します。 私はテストにすべてのアクションを記述したファイルを持って、そしてまた、例えば、これらのアクションは関数setFindTimeoutが機能しません
と呼ばれているテストがある:
Action.tsがで
ファイルがありますそれは順次
//1
//open the registration window
openRegistration(): Command<void> {
return Action.openRegistration(this.parent);
}
static openRegistration(command: Command<any>): Command<void> {
return command
// click on the authorization menu
.setPageLoadTimeout (10000)
.get(intern.args.url)
.end()
}
//2
inputTextByCssSelector(selector: string, value: string): Command <void> {
return Input.inputTextByCssSelector(this.parent, selector, value);
}
static inputTextByCssSelector(
command: Command<any>,
selector: string,
value: string
): Command<void> {
return command
.setFindTimeout(10000)
.findByCssSelector(selector)
.click()
.type(value)
.end()
.end()
}
この
.then(() => action.openRegistration())
.then(() => input.inputTextByCssSelector(
"input [name = userName]",
intern.args.username
))
.then(() => input.inputTextByCssSelector(
"input [name = password]",
intern.args.password
))
などと呼ばれている試験において機能します
しかし、私がテストを実行すると、それは落ちます。私はこの
openRegistration(): Command<void> {
return Action.openRegistration(this.parent);
}
static openRegistration(command: Command<any>): Command<void> {
return command
.setPageLoadTimeout(10000)
.get(intern.args.url)
.sleep(7000)
.end()
}
のように例えばopenRegistrationの最後に明示的な遅延を設定した場合
その後、すべてが
はなぜinputTextByCssSelector
でsetFindTimeout(10000)
を動作しません動作しますが、openRegistration
でsleep(7000)
で