jasmine test 页面测试工具
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); }); });
相关推荐
敏敏张 2020-11-11
SCNUHB 2020-11-10
小木兮子 2020-11-11
wwwsurfphpseocom 2020-10-28
WasteLand 2020-10-18
Cocolada 2020-11-12
杜鲁门 2020-11-05
shirleypaddy 2020-10-19
qingmumu 2020-10-19
Testingba工作室 2020-09-15
周公周金桥 2020-09-13
专注前端开发 2020-08-16
emagtestage 2020-08-16
heniancheng 2020-08-15
hanjinixng00 2020-08-12
小方哥哥 2020-08-09
83327712 2020-07-30
卖小孩的咖啡 2020-07-21
wqiaofujiang 2020-07-05