正在发送请求的html文件组件
<paper-button class="indigo" style="margin-top:1em; width:15%"
on-tap="sendLoginRequest">Login</paper-button>
<iron-ajax id="loginAjaxRequest" handle-as="json" on-
response="loginResponse" on-error="showToast"></iron-ajax>
sendloginRequest函数在其中触发请求的部分
sendLoginRequest() {
//some code
this.$.loginAjaxRequest.url = "http://localhost:8080/api/login"
this.$.loginAjaxRequest.body = JSON.stringify(loginJson)
this.$.loginAjaxRequest.method = "POST"
this.$.loginAjaxRequest.generateRequest()
}
如何编写测试用例