How to use ajaxExtend method in Cypress

Best JavaScript code snippet using cypress

admin-model.js

Source:admin-model.js Github

copy

Full Screen

1/**2 * @Date:2016.4.263 * @Author: haoyong4 * @Description: verify model层5 */6define([7 "ajaxExtend"8], function (ajaxExtend) {9 "use strict";10 return (function (scope) {11 //是否使用模拟数据12 var _isUseMock = false,13 //设置请求的根路径14 // _serviceHost = "http://localhost:8080/agri_I/",15 //设置请求上下文16 _serviceContext = "/",17 //设置请求的url集合18 _ACTIONS_URL = {19 //有机认证机构20 Get_Ji_Gou: (_isUseMock ? "inc/jigou.json" : "inc/jigou.json"),21 //用户22 Get_Admin_List: (_isUseMock ? "inc/mockAdminList.json" : serviceHost + "user/" + "getAdminList"),23 Add_Admin: (_isUseMock ? "inc/mockAdminList.json" : serviceHost + "user/" + "addUser"),24 Delete_User: (_isUseMock ? "inc/mockAdminList.json" : serviceHost + "user/" + "deleteUser"),25 //产品26 Delete_Product: (_isUseMock ? "inc/mockAdminList.json" : serviceHost + "product/" + "deleteProduct"),27 Get_Company_List: (_isUseMock ? "inc/mockCompanyList.json" : serviceHost + "company/" + "getCompanyList"),28 Delete_Company: (_isUseMock ? "inc/mockCompanyList.json" : serviceHost + "company/" + "deleteCompany"),29 //新闻资讯30 getNewsTypeList: (_isUseMock ? "inc/mockNewsList.json" : serviceHost + "newsType/" + "getNewsTypeList"),31 getNewsTypeById: (_isUseMock ? "inc/mockNewsList.json" : serviceHost + "newsType/" + "getNewsTypeById"),32 addNewsType: (_isUseMock ? "inc/mockNewsList.json" : serviceHost + "newsType/" + "addNewsType"),33 updateNewsType: (_isUseMock ? "inc/mockNewsList.json" : serviceHost + "newsType/" + "updateNewsType"),34 deleteNewsType: (_isUseMock ? "inc/mockNewsList.json" : serviceHost + "newsType/" + "deleteNewsType"),35 //资讯类别36 Get_News_List: (_isUseMock ? "inc/mockNewsList.json" : serviceHost + "news/" + "getNewsList"),37 Add_News: (_isUseMock ? "inc/mockAdminList.json" : serviceHost + "news/" + "addNews"),38 Delete_News: (_isUseMock ? "inc/mockAdminList.json" : serviceHost + "news/" + "deleteNews"),39 Update_News: (_isUseMock ? "inc/mockAdminList.json" : serviceHost + "news/" + "updateNews"),40 Get_News_By_ID: (_isUseMock ? "inc/mockNewsByID.json" : serviceHost + "news/" + "getNewsById"),41 //产品42 Get_Products_List: (_isUseMock ? "inc/mockProductsList.json" : serviceHost + "product/" + "null"),43 Get_Product_List_With_Page: (_isUseMock ? "inc/mockProductsList.json" : serviceHost + "product/" + "getProductListWithPage"),44 Total_Count_Product: (_isUseMock ? "inc/mockProductsList.json" : serviceHost + "product/" + "totalCountProduct"),45 //日志名称46 getProductLogTypeList: (_isUseMock ? "inc/mockProductsList.json" : serviceHost + "productLogType/" + "getProductLogTypeList"),47 getProductLogTypeById: (_isUseMock ? "inc/mockProductsList.json" : serviceHost + "productLogType/" + "getProductLogTypeById"),48 addProductLogType: (_isUseMock ? "inc/mockProductsList.json" : serviceHost + "productLogType/" + "addProductLogType"),49 updateProductLogType: (_isUseMock ? "inc/mockProductsList.json" : serviceHost + "productLogType/" + "updateProductLogType"),50 deleteProductLogType: (_isUseMock ? "inc/mockProductsList.json" : serviceHost + "productLogType/" + "deleteProductLogType"),51 };52 /**53 * 认证机构54 */55 scope.getJigou = function (data,success, error) {56 return ajaxExtend.getData(_ACTIONS_URL.Get_Ji_Gou,data).then(success, error);57 }; /**58 * admin,verify列表的接口59 */60 scope.getAdminList = function (data,success, error) {61 return ajaxExtend.getData(_ACTIONS_URL.Get_Admin_List,data).then(success, error);62 };63 /**64 * 添加一个admin,verify65 */66 scope.addAdmin = function (data,success, error) {67 return ajaxExtend.getData(_ACTIONS_URL.Add_Admin,data).then(success, error);68 };69 /**70 * 删除一个user admin,verify71 */72 scope.deleteUser = function (data,success, error) {73 return ajaxExtend.getData(_ACTIONS_URL.Delete_User,data).then(success, error);74 };75 /**76 * 删除一个产品77 */78 scope.deleteProduct = function (data,success, error) {79 return ajaxExtend.getData(_ACTIONS_URL.Delete_Product,data).then(success, error);80 };81 /**82 * 公司列表的接口83 */84 scope.getCompanyList = function (data,success, error) {85 return ajaxExtend.getData(_ACTIONS_URL.Get_Company_List,data).then(success, error);86 };87 /**88 * 删除一个公司的接口89 */90 scope.deleteCompany = function (data,success, error) {91 return ajaxExtend.getData(_ACTIONS_URL.Delete_Company,data).then(success, error);92 };93 /**94 * news列表的接口95 */96 scope.getNewsList = function (data,success, error) {97 return ajaxExtend.getData(_ACTIONS_URL.Get_News_List,data).then(success, error);98 };99 /**100 * 添加news101 */102 scope.addNews = function (data,success, error) {103 return ajaxExtend.getData(_ACTIONS_URL.Add_News,data).then(success, error);104 };105 /**106 * 编辑更新news107 */108 scope.updateNews = function (data,success, error) {109 return ajaxExtend.getData(_ACTIONS_URL.Update_News,data).then(success, error);110 };111 /**112 * 删除news113 */114 scope.deleteNews = function (data,success, error) {115 return ajaxExtend.getData(_ACTIONS_URL.Delete_News,data).then(success, error);116 };117 /**118 * news id获取119 */120 scope.getNewsById = function (data,success, error) {121 return ajaxExtend.getData(_ACTIONS_URL.Get_News_By_ID,data).then(success, error);122 };123 /**124 *125 */126 scope.getNewsTypeList = function (data,success, error) {127 return ajaxExtend.getData(_ACTIONS_URL.getNewsTypeList,data).then(success, error);128 }; /**129 *130 */131 scope.getNewsTypeById = function (data,success, error) {132 return ajaxExtend.getData(_ACTIONS_URL.getNewsTypeById,data).then(success, error);133 }; /**134 *135 */136 scope.addNewsType = function (data,success, error) {137 return ajaxExtend.getData(_ACTIONS_URL.addNewsType,data).then(success, error);138 }; /**139 *140 */141 scope.updateNewsType = function (data,success, error) {142 return ajaxExtend.getData(_ACTIONS_URL.updateNewsType,data).then(success, error);143 }; /**144 *145 */146 scope.deleteNewsType = function (data,success, error) {147 return ajaxExtend.getData(_ACTIONS_URL.deleteNewsType,data).then(success, error);148 };149 /**150 * 产品列表151 */152 scope.getProductsList = function (data,success, error) {153 return ajaxExtend.getData(_ACTIONS_URL.Get_Products_List,data).then(success, error);154 };155 /**156 * 产品列表分页157 */158 scope.getProductListWithPage = function (data,success, error) {159 return ajaxExtend.getData(_ACTIONS_URL.Get_Product_List_With_Page,data).then(success, error);160 };161 /**162 * 产品总数统计163 */164 scope.totalCountProduct = function (data,success, error) {165 return ajaxExtend.getData(_ACTIONS_URL.Total_Count_Product,data).then(success, error);166 };167 /**168 * ProductLogType列表的接口169 */170 scope.getProductLogTypeList = function (data,success, error) {171 return ajaxExtend.getData(_ACTIONS_URL.getProductLogTypeList,data).then(success, error);172 };173 /**174 * ProductLogType的接口175 */176 scope.getProductLogTypeById = function (data,success, error) {177 return ajaxExtend.getData(_ACTIONS_URL.getProductLogTypeById,data).then(success, error);178 };179 /**180 * ProductLogType的接口181 */182 scope.addProductLogType = function (data,success, error) {183 return ajaxExtend.getData(_ACTIONS_URL.addProductLogType,data).then(success, error);184 };185 /**186 * ProductLogType的接口187 */188 scope.updateProductLogType = function (data,success, error) {189 return ajaxExtend.getData(_ACTIONS_URL.updateProductLogType,data).then(success, error);190 };191 /**192 * ProductLogType的接口193 */194 scope.deleteProductLogType = function (data,success, error) {195 return ajaxExtend.getData(_ACTIONS_URL.deleteProductLogType,data).then(success, error);196 };197 return scope;198 }({}));...

Full Screen

Full Screen

company-model.js

Source:company-model.js Github

copy

Full Screen

1/**2 * @Date:2016.4.203 * @Author: haoyong4 * @Description: company model层5 */6define([7 "ajaxExtend"8], function (ajaxExtend) {9 "use strict";10 return (function (scope) {11 //是否使用模拟数据12 var _isUseMock = false,13 //设置请求的根路径14 //_serviceHost = "/ip地址 + service/",15 //设置请求上下文16 _serviceContext = "",17 //设置请求的url集合18 _ACTIONS_URL = {19 Get_Company_Info_BY_ID: (_isUseMock ? "/inc/monitorSystem.json" : serviceHost + "company/" + "getCompanyById"),20 Update_Company: (_isUseMock ? "inc/mockCheckAllList.json" : serviceHost + "company/" + "updateCompany"),21 Get_Product_List_By_CompanyId: (_isUseMock ? "inc/mockCheckAllList.json" : serviceHost + "product/" + "getProductListByCompanyId"),22 Delete_Product: (_isUseMock ? "inc/mockAdminList.json" : serviceHost + "product/" + "deleteProduct"),23 Add_Product: (_isUseMock ? "inc/mockAdminList.json" : serviceHost + "product/" + "addProduct"),24 //batch25 Get_Batch_List_ByProductID: (_isUseMock ? "inc/mockAdminList.json" : serviceHost + "batch/" + "getBatchListByProductId"),26 Get_Batch_List_ByProductID_AndStatus: (_isUseMock ? "inc/mockAdminList.json" : serviceHost + "batch/" + "getBatchListByProductIdAndStatus"),27 Add_Batch: (_isUseMock ? "inc/mockAdminList.json" : serviceHost + "batch/" + "addBatch"),28 deleteBatch: (_isUseMock ? "inc/mockAdminList.json" : serviceHost + "batch/" + "deleteBatch"),29 getBatchListByWithPage: (_isUseMock ? "inc/mockAdminList.json" : serviceHost + "batch/" + "getBatchListByWithPage"),30 totalCountBatchBy: (_isUseMock ? "inc/mockAdminList.json" : serviceHost + "batch/" + "totalCountBatchBy"),31 //日志32 getProductLogListByBatch: (_isUseMock ? "inc/mockAdminList.json" : serviceHost + "productLog/" + "getProductLogListByBatch"),33 addProductLog: (_isUseMock ? "inc/mockAdminList.json" : serviceHost + "productLog/" + "addProductLog"),34 updateProductLog: (_isUseMock ? "inc/mockAdminList.json" : serviceHost + "productLog/" + "updateProductLog"),35 deleteProductLog: (_isUseMock ? "inc/mockAdminList.json" : serviceHost + "productLog/" + "deleteProductLog"),36 getProductLogTypeList: (_isUseMock ? "inc/mockProductsList.json" : serviceHost + "productLogType/" + "getProductLogTypeList"),37 //留言38 totalCountWord: (_isUseMock ? "inc/mockProductsList.json" : serviceHost + "word/" + "totalCountWord"),39 getWordListByWithPage: (_isUseMock ? "inc/mockProductsList.json" : serviceHost + "word/" + "getWordListByWithPage"),40 getWordById: (_isUseMock ? "inc/mockProductsList.json" : serviceHost + "word/" + "getWordById"),41 addWord: (_isUseMock ? "inc/mockProductsList.json" : serviceHost + "word/" + "addWord"),42 deleteWord: (_isUseMock ? "inc/mockProductsList.json" : serviceHost + "word/" + "deleteWord"),43 updateWord: (_isUseMock ? "inc/mockProductsList.json" : serviceHost + "word/" + "updateWord"),44 };45 /**46 * 获取一个公司47 */48 scope.getCompanyById = function (data,success, error) {49 return ajaxExtend.getData(_ACTIONS_URL.Get_Company_Info_BY_ID, data).then(success, error);50 };51 /**52 * 获取一个公司id 下的产品53 */54 scope.getProductListByCompanyId = function (data,success, error) {55 return ajaxExtend.getData(_ACTIONS_URL.Get_Product_List_By_CompanyId, data).then(success, error);56 };57 /**58 * 添加公司一个产品59 */60 scope.addProduct = function (data,success, error) {61 return ajaxExtend.getData(_ACTIONS_URL.Add_Product,data).then(success, error);62 };63 /**64 * 一个产品所有 批次65 */66 scope.getBatchListByProductId = function (data,success, error) {67 return ajaxExtend.getData(_ACTIONS_URL.Get_Batch_List_ByProductID,data).then(success, error);68 };69 /**70 * 一个产品所有 批次 status71 */72 scope.getBatchListByProductIdAndStatus = function (data,success, error) {73 return ajaxExtend.getData(_ACTIONS_URL.Get_Batch_List_ByProductID_AndStatus,data).then(success, error);74 };75 /**76 * 批次分页77 */78 scope.getBatchListByWithPage = function (data,success, error) {79 return ajaxExtend.getData(_ACTIONS_URL.getBatchListByWithPage,data).then(success, error);80 };81 /**82 * 总数83 */84 scope.totalCountBatchBy = function (data,success, error) {85 return ajaxExtend.getData(_ACTIONS_URL.totalCountBatchBy,data).then(success, error);86 };87 /**88 * 添加 一个产品 批次89 */90 scope.addBatch = function (data,success, error) {91 return ajaxExtend.getData(_ACTIONS_URL.Add_Batch,data).then(success, error);92 };93 /**94 * 删除一个产品 批次95 */96 scope.deleteBatch = function (data,success, error) {97 return ajaxExtend.getData(_ACTIONS_URL.deleteBatch,data).then(success, error);98 };99 /**100 * 删除一个产品101 */102 scope.deleteProduct = function (data,success, error) {103 return ajaxExtend.getData(_ACTIONS_URL.Delete_Product,data).then(success, error);104 };105 /**106 * 编辑公司信息107 */108 scope.updateCompany = function (data,success, error) {109 return ajaxExtend.getData(_ACTIONS_URL.Update_Company, data).then(success, error);110 };111 /**112 * 获取批次日志113 */114 scope.getProductLogListByBatch = function (data,success, error) {115 return ajaxExtend.getData(_ACTIONS_URL.getProductLogListByBatch, data).then(success, error);116 };117 /**118 * 添加日志119 */120 scope.addProductLog = function (data,success, error) {121 return ajaxExtend.getData(_ACTIONS_URL.addProductLog, data).then(success, error);122 };123 /**124 * 更新日志125 */126 scope.updateProductLog = function (data,success, error) {127 return ajaxExtend.getData(_ACTIONS_URL.updateProductLog, data).then(success, error);128 };129 /**130 * 删日志131 */132 scope.deleteProductLog = function (data,success, error) {133 return ajaxExtend.getData(_ACTIONS_URL.deleteProductLog, data).then(success, error);134 };135 /**136 * 日志Type列表的接口137 */138 scope.getProductLogTypeList = function (data,success, error) {139 return ajaxExtend.getData(_ACTIONS_URL.getProductLogTypeList,data).then(success, error);140 };141 /**142 * 统计留言143 */144 scope.totalCountWord = function (data,success, error) {145 return ajaxExtend.getData(_ACTIONS_URL.totalCountWord,data).then(success, error);146 };147 /**148 * 留言列表149 */150 scope.getWordListByWithPage = function (data,success, error) {151 return ajaxExtend.getData(_ACTIONS_URL.getWordListByWithPage,data).then(success, error);152 };153 /**154 * 获取一个留言155 */156 scope.getWordById = function (data,success, error) {157 return ajaxExtend.getData(_ACTIONS_URL.getWordById,data).then(success, error);158 };159 /**160 * 添加留言161 */162 scope.addWord = function (data,success, error) {163 return ajaxExtend.getData(_ACTIONS_URL.addWord,data).then(success, error);164 };165 /**166 * 删除留言167 */168 scope.deleteWord = function (data,success, error) {169 return ajaxExtend.getData(_ACTIONS_URL.deleteWord,data).then(success, error);170 };171 /**172 * 更新留言173 */174 scope.updateWord = function (data,success, error) {175 return ajaxExtend.getData(_ACTIONS_URL.updateWord,data).then(success, error);176 };177 return scope;178 }({}));...

Full Screen

Full Screen

trace-model.js

Source:trace-model.js Github

copy

Full Screen

1/**2 * @Date:2016.4.203 * @Author: haoyong4 * @Description: company model层5 */6define([7 "ajaxExtend"8], function (ajaxExtend) {9 "use strict";10 return (function (scope) {11 //是否使用模拟数据12 var _isUseMock = false,13 //设置请求的根路径14 //_serviceHost = "/ip地址 + service/",15 //设置请求上下文16 _serviceContext = "",17 //设置请求的url集合18 _ACTIONS_URL = {19 Get_Company_Info_BY_ID: (_isUseMock ? "/inc/monitorSystem.json" : serviceHost + "company/" + "getCompanyById"),20 Update_Company: (_isUseMock ? "inc/mockCheckAllList.json" : serviceHost + "company/" + "updateCompany"),21 Get_Product_List_By_CompanyId: (_isUseMock ? "inc/mockCheckAllList.json" : serviceHost + "product/" + "getProductListByCompanyId"),22 Delete_Product: (_isUseMock ? "inc/mockAdminList.json" : serviceHost + "product/" + "deleteProduct"),23 Add_Product: (_isUseMock ? "inc/mockAdminList.json" : serviceHost + "product/" + "addProduct"),24 Get_Batch_List_ByProductID: (_isUseMock ? "inc/mockAdminList.json" : serviceHost + "batch/" + "getBatchListByProductId"),25 Get_Batch_List_ByProductID_AndStatus: (_isUseMock ? "inc/mockAdminList.json" : serviceHost + "batch/" + "getBatchListByProductIdAndStatus"),26 Add_Batch: (_isUseMock ? "inc/mockAdminList.json" : serviceHost + "batch/" + "addBatch"),27 getProductById: (_isUseMock ? "inc/mockAdminList.json" : serviceHost + "product/" + "getProductById"),28 //日志29 getProductLogListByBatch: (_isUseMock ? "inc/mockAdminList.json" : serviceHost + "productLog/" + "getProductLogListByBatch"),30 addProductLog: (_isUseMock ? "inc/mockAdminList.json" : serviceHost + "productLog/" + "addProductLog"),31 updateProductLog: (_isUseMock ? "inc/mockAdminList.json" : serviceHost + "productLog/" + "updateProductLog"),32 deleteProductLog: (_isUseMock ? "inc/mockAdminList.json" : serviceHost + "productLog/" + "deleteProductLog"),33 getProductLogTypeList: (_isUseMock ? "inc/mockProductsList.json" : serviceHost + "productLogType/" + "getProductLogTypeList"),34 };35 /**36 * product from id37 */38 scope.getProductById = function (data,success, error) {39 return ajaxExtend.getData(_ACTIONS_URL.getProductById, data).then(success, error);40 };41 /**42 * 获取一个公司43 */44 scope.getCompanyById = function (data,success, error) {45 return ajaxExtend.getData(_ACTIONS_URL.Get_Company_Info_BY_ID, data).then(success, error);46 };47 /**48 * 获取一个公司id 下的产品49 */50 scope.getProductListByCompanyId = function (data,success, error) {51 return ajaxExtend.getData(_ACTIONS_URL.Get_Product_List_By_CompanyId, data).then(success, error);52 };53 /**54 * 添加公司一个产品55 */56 scope.addProduct = function (data,success, error) {57 return ajaxExtend.getData(_ACTIONS_URL.Add_Product,data).then(success, error);58 };59 /**60 * 一个产品所有 批次61 */62 scope.getBatchListByProductId = function (data,success, error) {63 return ajaxExtend.getData(_ACTIONS_URL.Get_Batch_List_ByProductID,data).then(success, error);64 };65 /**66 * 一个产品所有 批次 status67 */68 scope.getBatchListByProductIdAndStatus = function (data,success, error) {69 return ajaxExtend.getData(_ACTIONS_URL.Get_Batch_List_ByProductID_AndStatus,data).then(success, error);70 };71 /**72 * 添加 一个产品 批次73 */74 scope.addBatch = function (data,success, error) {75 return ajaxExtend.getData(_ACTIONS_URL.Add_Batch,data).then(success, error);76 };77 /**78 * 删除一个产品79 */80 scope.deleteProduct = function (data,success, error) {81 return ajaxExtend.getData(_ACTIONS_URL.Delete_Product,data).then(success, error);82 };83 /**84 * 编辑公司信息85 */86 scope.updateCompany = function (data,success, error) {87 return ajaxExtend.getData(_ACTIONS_URL.Update_Company, data).then(success, error);88 };89 /**90 * 获取批次日志91 */92 scope.getProductLogListByBatch = function (data,success, error) {93 return ajaxExtend.getData(_ACTIONS_URL.getProductLogListByBatch, data).then(success, error);94 };95 /**96 * 添加日志97 */98 scope.addProductLog = function (data,success, error) {99 return ajaxExtend.getData(_ACTIONS_URL.addProductLog, data).then(success, error);100 };101 /**102 * 更新日志103 */104 scope.updateProductLog = function (data,success, error) {105 return ajaxExtend.getData(_ACTIONS_URL.updateProductLog, data).then(success, error);106 };107 /**108 * 删日志109 */110 scope.deleteProductLog = function (data,success, error) {111 return ajaxExtend.getData(_ACTIONS_URL.deleteProductLog, data).then(success, error);112 };113 /**114 * 日志Type列表的接口115 */116 scope.getProductLogTypeList = function (data,success, error) {117 return ajaxExtend.getData(_ACTIONS_URL.getProductLogTypeList,data).then(success, error);118 };119 return scope;120 }({}));...

Full Screen

Full Screen

verify-model.js

Source:verify-model.js Github

copy

Full Screen

1/**2 * @Date:2016.4.263 * @Author: haoyong4 * @Description: verify model层5 */6define([7 "ajaxExtend"8], function (ajaxExtend) {9 "use strict";10 return (function (scope) {11 //是否使用模拟数据12 var _isUseMock = false,13 //设置请求的根路径14 // _serviceHost = "http://localhost:8080/cfsp/",15 //设置请求上下文16 _serviceContext = "",17 //设置请求的url集合18 _ACTIONS_URL = {19 Get_Company_List: (_isUseMock ? "inc/mockCompanyList.json" : serviceHost + "company/" + "getCompanyList"),20 Get_CheckAll_List: (_isUseMock ? "inc/mockCheckAllList.json" : serviceHost + _serviceContext + "null"),21 Verify_Company: (_isUseMock ? "inc/mockCheckAllList.json" : serviceHost + "company/" + "verifyCompany"),22 UnVerify_Company: (_isUseMock ? "inc/mockCheckAllList.json" : serviceHost + "company/" + "unVerifyCompany"),23 Get_ReportAll_List: (_isUseMock ? "inc/mockReportAllList.json" : serviceHost + _serviceContext + "null"),24 Get_ReportOne_List: (_isUseMock ? "inc/mockReportOneList.json" : serviceHost + "product/" + "getProductListByCompanyId"),25 Get_Batch_List_By_Status: (_isUseMock ? "inc/mockReportOneList.json" : serviceHost + "batch/" + "getBatchListByStatus"),26 Update_Batch: (_isUseMock ? "inc/mockReportOneList.json" : serviceHost + "batch/" + "updateBatch"),27 updateProduct: (_isUseMock ? "inc/mockReportOneList.json" : serviceHost + "product/" + "updateProduct"),28 };29 /**30 * 公司列表的接口31 */32 scope.getCompanyList = function (data,success, error) {33 return ajaxExtend.getData(_ACTIONS_URL.Get_Company_List,data).then(success, error);34 };35 /**36 * 审核通过37 */38 scope.verifyCompany = function (data,success, error) {39 return ajaxExtend.getData(_ACTIONS_URL.Verify_Company,data).then(success, error);40 };41 /**42 * 踢下审核43 */44 scope.unVerifyCompany = function (data,success, error) {45 return ajaxExtend.getData(_ACTIONS_URL.UnVerify_Company,data).then(success, error);46 };47 /**48 * 审核列表的接口49 */50 scope.getCheckAllList = function (data,success, error) {51 return ajaxExtend.getData(_ACTIONS_URL.Get_CheckAll_List,data).then(success, error);52 };53 /**54 * 大报表列表的接口55 */56 scope.getReportAllList = function (data,success, error) {57 return ajaxExtend.getData(_ACTIONS_URL.Get_ReportAll_List,data).then(success, error);58 };59 /**60 * 细节报表列表的接口61 */62 scope.getReportOneList = function (data,success, error) {63 return ajaxExtend.getData(_ACTIONS_URL.Get_ReportOne_List,data).then(success, error);64 };65 /**66 * 根据status 获取批次列表(未审核)67 */68 scope.getBatchListByStatus = function (data,success, error) {69 return ajaxExtend.getData(_ACTIONS_URL.Get_Batch_List_By_Status,data).then(success, error);70 };71 /**72 * 修改批次status ( 审核)73 */74 scope.updateBatch = function (data,success, error) {75 return ajaxExtend.getData(_ACTIONS_URL.Update_Batch,data).then(success, error);76 };77 /**78 * 有机认证产品79 */80 scope.updateProduct = function (data,success, error) {81 return ajaxExtend.getData(_ACTIONS_URL.updateProduct,data).then(success, error);82 };83 return scope;84 }({}));...

Full Screen

Full Screen

news-model.js

Source:news-model.js Github

copy

Full Screen

1/**2 * @Date:2016.4.263 * @Author: haoyong4 * @Description: verify model层5 */6define([7 "ajaxExtend"8], function (ajaxExtend) {9 "use strict";10 return (function (scope) {11 //是否使用模拟数据12 var _isUseMock = false,13 //设置请求的根路径14 //_serviceHost = "http://localhost:8080/agri/",15 //设置请求上下文16 _serviceContext = "",17 //设置请求的url集合18 _ACTIONS_URL = {19 Get_News_List: (_isUseMock ? "inc/mockNewsList.json" : serviceHost + "news/" + "getNewsList"),20 Total_Count_News: (_isUseMock ? "inc/mockNewsList.json" : serviceHost + "news/" + "totalCountNews"),21 Get_News_List_With_Page: (_isUseMock ? "inc/mockNewsList.json" : serviceHost + "news/" + "getNewsListWithPage"),22 Get_News_By_ID: (_isUseMock ? "inc/mockNewsByID.json" : serviceHost + "news/" + "getNewsById"),23 Get_News_By_ID_Next: (_isUseMock ? "inc/mockNewsByID.json" : serviceHost + "news/" + "findNewsByIdNext"),24 Get_News_By_ID_Prev: (_isUseMock ? "inc/mockNewsByID.json" : serviceHost + "news/" + "findNewsByIdPrev")25 };26 /**27 * news列表的接口28 */29 scope.getNewsList = function (data,success, error) {30 return ajaxExtend.getData(_ACTIONS_URL.Get_News_List,data).then(success, error);31 };32 /**33 * news统计总数34 */35 scope.totalCountNews = function (data,success, error) {36 return ajaxExtend.getData(_ACTIONS_URL.Total_Count_News,data).then(success, error);37 };38 /**39 * 分页40 * news列表的接口41 */42 scope.getNewsListWithPage = function (data,success, error) {43 return ajaxExtend.getData(_ACTIONS_URL.Get_News_List_With_Page,data).then(success, error);44 };45 /**46 * news id获取47 */48 scope.getNewsById = function (data,success, error) {49 return ajaxExtend.getData(_ACTIONS_URL.Get_News_By_ID,data).then(success, error);50 };51 /**52 * news下一个53 */54 scope.getNewsByIdNext = function (data,success, error) {55 return ajaxExtend.getData(_ACTIONS_URL.Get_News_By_ID_Next,data).then(success, error);56 };57 /**58 * news上一个59 */60 scope.getNewsByIdPrev = function (data,success, error) {61 return ajaxExtend.getData(_ACTIONS_URL.Get_News_By_ID_Prev,data).then(success, error);62 };63 return scope;64 }({}));...

Full Screen

Full Screen

api.js

Source:api.js Github

copy

Full Screen

1api = {2 call: function(endpoint, cb, params, ajaxExtend, type = "POST") {3 // $.LoadingOverlay("show");4 cb = cb || function(res) {};5 params = params || {};6 ajaxExtend = ajaxExtend || {};7 // Extend the data object load sent with API Ajax request.8 var data = {};9 // data.access_token = (localStorage.access_token !== undefined) ? localStorage.access_token : "";10 for (var prop in params) {11 if (params.hasOwnProperty(prop)) {12 data[prop] = params[prop];13 }14 }15 var apiAjax = {16 type: "POST",17 dataType: "json",18 async: false,19 data: data,20 success: function(res) {21 cb(res);22 },23 error: function(e) {24 console.log(e);25 }26 };27 // apiAjax.url = "http://85.214.165.56:81/api/index.php?request=" + endpoint;28 apiAjax.url = "https://costercatalog.com/affiliates/api/index.php?request=" + endpoint;29 for (var prop in ajaxExtend) {30 if (ajaxExtend.hasOwnProperty(prop)) {31 apiAjax[prop] = ajaxExtend[prop];32 }33 }34 $.ajax(apiAjax).fail(function(jqXHR, textStatus, errorThrown) {35 var res = {36 status: "fail",37 type: "Server error",38 endpoint: endpoint,39 xr: JSON.stringify(jqXHR),40 td: JSON.stringify(textStatus),41 err: JSON.stringify(errorThrown)42 }43 cb(res);44 });45 },46 isEmpty: function(obj) {47 for(var key in obj) {48 if(obj.hasOwnProperty(key))49 return false;50 }51 return true;52 }...

Full Screen

Full Screen

api_reports.js

Source:api_reports.js Github

copy

Full Screen

1api_reports = {2 call: function(endpoint, cb, params, ajaxExtend, type = "POST") {3 // $.LoadingOverlay("show");4 cb = cb || function(res) {};5 params = params || {};6 ajaxExtend = ajaxExtend || {};7 // Extend the data object load sent with API Ajax request.8 var data = {};9 // data.access_token = (localStorage.access_token !== undefined) ? localStorage.access_token : "";10 for (var prop in params) {11 if (params.hasOwnProperty(prop)) {12 data[prop] = params[prop];13 }14 }15 var apiAjax = {16 type: "POST",17 dataType: "json",18 async: false,19 data: data,20 success: function(res) {21 cb(res);22 },23 error: function(e) {24 console.log(e);25 }26 };27 // apiAjax.url = "http://85.214.165.56:81/api/index.php?request=" + endpoint;28 apiAjax.url = "http://85.214.165.56:81/api/reports.php?request=" + endpoint;29 for (var prop in ajaxExtend) {30 if (ajaxExtend.hasOwnProperty(prop)) {31 apiAjax[prop] = ajaxExtend[prop];32 }33 }34 $.ajax(apiAjax).fail(function(jqXHR, textStatus, errorThrown) {35 var res = {36 status: "fail",37 type: "Server error",38 endpoint: endpoint,39 xr: JSON.stringify(jqXHR),40 td: JSON.stringify(textStatus),41 err: JSON.stringify(errorThrown)42 }43 cb(res);44 });45 },46 isEmpty: function(obj) {47 for(var key in obj) {48 if(obj.hasOwnProperty(key))49 return false;50 }51 return true;52 }...

Full Screen

Full Screen

api_csv.js

Source:api_csv.js Github

copy

Full Screen

1api_csv = {2 call: function(endpoint, cb, params, ajaxExtend, type = "GET") {3 // $.LoadingOverlay("show");4 cb = cb || function(res) {};5 params = params || {};6 ajaxExtend = ajaxExtend || {};7 // Extend the data object load sent with API Ajax request.8 var data = {};9 // data.access_token = (localStorage.access_token !== undefined) ? localStorage.access_token : "";10 for (var prop in params) {11 if (params.hasOwnProperty(prop)) {12 data[prop] = params[prop];13 }14 }15 var apiAjax = {16 17 type: "GET",18 dataType: "json",19 async: false,20 data: data,21 success: function(res) {22 cb(res);23 },24 error: function(e) {25 console.log(e);26 }27 };28 apiAjax.url = "http://80.211.41.168:5000/?" + endpoint;29 for (var prop in ajaxExtend) {30 if (ajaxExtend.hasOwnProperty(prop)) {31 apiAjax[prop] = ajaxExtend[prop];32 }33 }34 $.ajax(apiAjax).fail(function(jqXHR, textStatus, errorThrown) {35 var res = {36 status: "fail",37 type: "Server error",38 endpoint: endpoint39 }40 cb(res);41 });42 },43 isEmpty: function(obj) {44 for(var key in obj) {45 if(obj.hasOwnProperty(key))46 return false;47 }48 return true;49 }...

Full Screen

Full Screen

Using AI Code Generation

copy

Full Screen

1describe('My First Test', function() {2 it('Does not do much!', function() {3 cy.get('.home-list > :nth-child(1) > .home-list-item').click()4 cy.ajaxExtend({5 headers: {6 },7 }).then((response) => {8 expect(response.status).to.eq(200)9 })10 })11})12### cy.ajaxExtend(options)

Full Screen

Using AI Code Generation

copy

Full Screen

1describe('Test Ajax', function(){2 it('Ajax Test', function(){3 cy.server()4 cy.route({5 response: {error: 'Hey comment not found'},6 }).as('UpdateComment')7 cy.get('.network-put').click()8 cy.wait('@UpdateComment')9 cy.get('.network-put-comment').should('contain', 'Hey comment not found')10 })11})

Full Screen

Using AI Code Generation

copy

Full Screen

1Cypress.Commands.add('ajaxExtend', (method, url, body = {}, headers = {}) => {2 return cy.request({3 })4})5Cypress.Commands.add('ajax', (method, url, body = {}, headers = {}) => {6 return cy.request({7 })8})9Cypress.Commands.add('login', (username, password) => {10 cy.visit('/login')11 cy.get('#username').type(username)12 cy.get('#password').type(password)13 cy.get('button[type=submit]').click()14})15Cypress.Commands.add('logout', () => {16 cy.get('button[aria-label=Account]').click()17 cy.get('button[data-test=logout]').click()18})19Cypress.Commands.add('login', (username, password) => {20 cy.visit('/login')21 cy.get('#username').type(username)22 cy.get('#password').type(password)23 cy.get('button[type=submit]').click()24})25Cypress.Commands.add('logout', () => {26 cy.get('button[aria-label=Account]').click()27 cy.get('button[data-test=logout]').click()28})29Cypress.Commands.add('login', (username, password) => {30 cy.visit('/login')31 cy.get('#username').type(username)32 cy.get('#password').type(password)33 cy.get('button[type=submit]').click()34})35Cypress.Commands.add('logout', () => {36 cy.get('button[aria-label=Account]').click()37 cy.get('button[data-test=

Full Screen

Using AI Code Generation

copy

Full Screen

1describe('Test', () => {2 it('Test', () => {3 cy.server();4 cy.route({5 }).as('getTest');6 cy.wait('@getTest');7 cy.get('.test').should('have.text', 'test');8 });9});10Cypress.Commands.add('ajaxExtend', (options) => {11 if (options.response) {12 cy.fixture(options.response).then((data) => {13 options.response = data;14 cy.server();15 cy.route(options);16 });17 } else {18 cy.server();19 cy.route(options);20 }21});22{23}24{25 "compilerOptions": {26 "importHelpers": true,27 "paths": {28 }29 }30}

Full Screen

Using AI Code Generation

copy

Full Screen

1import { ajaxExtend } from 'cypress-ajax-commands';2describe('AjaxExtend', () => {3 it('should return the response when the request is successful', () => {4 const headers = {5 }6 const body = {7 }8 const options = {9 }10 ajaxExtend(options).then((response) => {11 expect(response.status).to.eq(200)12 expect(response.statusText).to.eq('OK')13 expect(response.body).to.have.property('id', 1)14 expect(response.body).to.have.property('title', 'sunt aut facere repellat provident occaecati excepturi optio reprehenderit')15 expect(response.body).to.have.property('body', 'quia et suscipit\nsuscipit recusandae consequuntur expedita et cum\nreprehenderit molestiae ut ut quas totam\nnostrum rerum est autem sunt rem eveniet architecto')16 expect(response.body).to.have.property('userId', 1)17 })18 })19})20describe('AjaxExtend', () => {21 it('should return the response when the request is successful', () => {22 const headers = {23 }24 const body = {25 }26 const options = {27 }28 cy.request(options).then((response) => {29 expect(response.status).to.eq(200)30 expect(response.statusText).to.eq('OK')31 expect(response.body).to.have.property('id', 1)32 expect(response.body).to.have.property('title', 'sunt aut facere repellat provident occaecati excepturi optio reprehenderit')33 expect(response.body).to.have.property('body

Full Screen

Using AI Code Generation

copy

Full Screen

1describe('Testing', function () {2 it('Ajax', function () {3 cy.get('.sc-hKFxyN').contains('Docs').click()4 cy.get('.sc-hKFxyN').contains('Examples').click()5 cy.get('.sc-hKFxyN').contains('Ajax').click()6 cy.get('.sc-h

Full Screen

Cypress Tutorial

Cypress is a renowned Javascript-based open-source, easy-to-use end-to-end testing framework primarily used for testing web applications. Cypress is a relatively new player in the automation testing space and has been gaining much traction lately, as evidenced by the number of Forks (2.7K) and Stars (42.1K) for the project. LambdaTest’s Cypress Tutorial covers step-by-step guides that will help you learn from the basics till you run automation tests on LambdaTest.

Chapters:

  1. What is Cypress? -
  2. Why Cypress? - Learn why Cypress might be a good choice for testing your web applications.
  3. Features of Cypress Testing - Learn about features that make Cypress a powerful and flexible tool for testing web applications.
  4. Cypress Drawbacks - Although Cypress has many strengths, it has a few limitations that you should be aware of.
  5. Cypress Architecture - Learn more about Cypress architecture and how it is designed to be run directly in the browser, i.e., it does not have any additional servers.
  6. Browsers Supported by Cypress - Cypress is built on top of the Electron browser, supporting all modern web browsers. Learn browsers that support Cypress.
  7. Selenium vs Cypress: A Detailed Comparison - Compare and explore some key differences in terms of their design and features.
  8. Cypress Learning: Best Practices - Take a deep dive into some of the best practices you should use to avoid anti-patterns in your automation tests.
  9. How To Run Cypress Tests on LambdaTest? - Set up a LambdaTest account, and now you are all set to learn how to run Cypress tests.

Certification

You can elevate your expertise with end-to-end testing using the Cypress automation framework and stay one step ahead in your career by earning a Cypress certification. Check out our Cypress 101 Certification.

YouTube

Watch this 3 hours of complete tutorial to learn the basics of Cypress and various Cypress commands with the Cypress testing at LambdaTest.

Run Cypress automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful