Jasmine Test页面测试工具

发表于:2017-1-19 11:36

字体: | 上一篇 | 下一篇 | 我要投稿

 作者:minwei    来源:51Testing软件测试网采编

before((request, response) -> {
response.header("Access-Control-Allow-Origin", "http://localhost");
response.header("Access-Control-Allow-Credentials ", "true");
response.header("Access-Control-Allow-Methods", "POST, GET, PUT, DELETE, OPTIONS");
response.header("Access-Control-Allow-Headers",
"X-Requested-With, X-HTTP-Method-Override, Content-Type, Accept");
});
  1. chrome 开本地访问网络命令行 : open /Applications/Google\ Chrome.app/ --args --disable-web-security (版本在49以上,还须添加--user-data-dir)
  2. 还需要添加跨域
  3. 测试本地需要修改html 里面的url
  4. 现在ajax返回的测试用的是 settimeout 判断返回值
  5. 需要调用ajax可以放到xmapp项目里面
  ex:
describe("异常参数测试", function() {
var data;
beforeEach(function() {
b2cCustomerLogin();
var currentUrl = url;
var params = {
name: test_name,
province: test_province,
city: test_city,
address : test_address,
telephone : test_telephone
}
data = ajaxReq(currentUrl, params);
});
afterEach(function() {
});
it("create promotion success", function() {
expect(data.status).toEqual(1);
});
});
《2023软件测试行业现状调查报告》独家发布~

关注51Testing

联系我们

快捷面板 站点地图 联系我们 广告服务 关于我们 站长统计 发展历程

法律顾问:上海兰迪律师事务所 项棋律师
版权所有 上海博为峰软件技术股份有限公司 Copyright©51testing.com 2003-2024
投诉及意见反馈:webmaster@51testing.com; 业务联系:service@51testing.com 021-64471599-8017

沪ICP备05003035号

沪公网安备 31010102002173号