How to use axios.get method in Appium Base Driver

Best JavaScript code snippet using appium-base-driver

main.js

Source:main.js Github

copy

Full Screen

1import axios from 'axios';2import qs from 'qs';3axios.defaults.validateStatus=(status)=>{4 if (status === 401) {//没登陆5 localStorage.removeItem('role');6 localStorage.removeItem('zlfuserInfo');7 window.location.href='/home.html';8 return false;9 } else {10 return true11 };12}13var TIME_OUT=50000;14var zlf_base_prefix15if(__DEV__){16 zlf_base_prefix = 1?'https://api.zulifangs.com':'http://redliam.51vip.biz:20095/api-zlf';//'http://hjj1.tunnel.echomod.cn/api-zlf';17}else if(__PROD__){18 zlf_base_prefix='https://api.zucube.cn';19}20const base_axios_options = {21 withCredentials:true,22 // timeout:TIME_OUT,23 headers: { 'Content-Type': 'application/json' }24};25const customer_base = `${zlf_base_prefix}`;26const customerAxios = axios.create(Object.assign({}, { baseURL: `${customer_base}`}, base_axios_options));27export const customerModule={28 //新闻列表29 getNewsList:params => { return customerAxios.get('/article/getByPage', {params:params}).then(res => res.data); },30 //新闻详情31 getNewsDetail:params => { return customerAxios.get('/article/getArticleDetail', {params:params}).then(res => res.data); },32 //客户注册接口33 registerCustorm:params => { return customerAxios.post('/customers/register', params).then(res => res.data); },34 //检验公司名字是否注册35 checkInfo:params => { return customerAxios.post('/user/checkInfo', params).then(res => res.data); },36 //获取验证码37 getVerification:params => { return customerAxios.get('/verification', {params:params}).then(res => res.data); },38 //重新绑定邮箱时 获取验证码39 verificationMail:params => { return customerAxios.get('/verificationMail', {params:params}).then(res => res.data); },40 //修改密码 获取验证码41 verificationPass:params => { return customerAxios.get('/verificationPass', {params:params}).then(res => res.data); },42 //绑定邮箱接口43 changeMail:params => { return customerAxios.get('/changeMail', {params:params}).then(res => res.data); },44 //保存客户信息联系人45 saveOrderCustomerInfo:params => { return customerAxios.post('/user/perfectUser', params).then(res => res.data); },46 //租赁测算体验47 calculation:params => { return customerAxios.post('/calcul/calculation', params).then(res => res.data); },48 //客户新建项目49 saveCustomerItem:params => { return customerAxios.post('/customers/save', params).then(res => res.data); },50 //获取所有项目51 getOrderInfoList:params => { return customerAxios.get('/customers/getOrderInfoList').then(res => res.data); },52 //获取租赁服务53 getRentService:params => { return customerAxios.get('/customers/getNewProjectMenu', {params:params}).then(res => res.data); },54 //保存项目联系人55 saveProjectPersonInfo:params => { return customerAxios.post('/customers/saveOrderCustomerInfo', params).then(res => res.data); },56 //获取项目联系人57 getOrderCustomerInfo:params => { return customerAxios.get('/customers/getOrderCustomerInfo', {params:params}).then(res => res.data); },58 //获取租赁物59 getLease:params => { return customerAxios.get('/getLease', {params:params}).then(res => res.data); },60 //保存供应商联系人接口61 changeSupplierUser:params => { return customerAxios.post('/supplier/changeUser', params).then(res => res.data); },62 //保存产品清单63 saveProductComm:params => { return customerAxios.post('/customers/saveProductComm', params).then(res => res.data); },64 //获取项目详情65 getProjectInfo:params => { return customerAxios.get('/customers/getProjectInfo', {params:params}).then(res => res.data); },66 //获取指定供应商信息67 getAppointSupplier:params => { return customerAxios.get('/customers/getAppointSupplier', {params:params}).then(res => res.data); },68 //获取推荐供应商69 getRecommendSupplier:params => { return customerAxios.get('/customers/getRecommendSupplier', {params:params}).then(res => res.data); },70 //获取指定合作供应商产品列表71 getAppointProgress:params => { return customerAxios.get('/customers/getAppointProgress', {params:params}).then(res => res.data); },72 //获取推荐供应商产品列表73 getRecommendProgress:params => { return customerAxios.get('/customers/getRecommendProgress', {params:params}).then(res => res.data); },74 //获取合同与付款75 getContractAndPay:params => { return customerAxios.get('/customers/getContractAndPay', {params:params}).then(res => res.data); },76 //获取客户合同列表77 getCustomerstMainLease:params => { return customerAxios.get('/customers/getMainLease', {params:params}).then(res => res.data); },78 //获取客户合同详情79 getMainLeaseDetail:params => { return customerAxios.get('/customers/getMainLeaseDetail', {params:params}).then(res => res.data); },80 //保存验收信息81 acceptance:params => { return customerAxios.post('/customers/acceptance', params).then(res => res.data); },82 //获取验收信息83 getAcceptanceVO:params => { return customerAxios.get('/customers/getAcceptanceVO', {params:params}).then(res => res.data); },84 //供应商注册85 registerSupplier:params => { return customerAxios.post('/supplier/register', params).then(res => res.data); },86 //登录接口87 login:params => { return customerAxios.post('/login?'+ qs.stringify(params)).then(res => res.data); },88 //退出登陆接口89 logout:params => { return customerAxios.post('/logout').then(res => res.data); },90 //上传接口 91 upload:params => { return customerAxios.post('/updateContent', params).then(res => res.data); },92 //多文件上传93 mulUploadFile:params => { return customerAxios.post('/mulUploadFile', params).then(res => res.data); },94 //获取市场客户登陆人信息95 getCurrentUser:params => { return customerAxios.post('/getUser').then(res => res.data); },96 //获取供应商登陆人信息97 getSupplierUser:params => { return customerAxios.get('/supplier/getUser').then(res => res.data); },98 //获取供应商资料99 getDatum:params => { return customerAxios.get('/supplier/getDatum').then(res => res.data); },100 //获取供应商扩展信息101 getExtSupplier:params => { return customerAxios.get('/supplier/getExtSupplier').then(res => res.data); },102 //推荐值开关103 openRecom:params => { return customerAxios.get('/supplier/openRecom', {params:params}).then(res => res.data); },104 //获取推荐值105 getRecommResult:params => { return customerAxios.get('/supplier/getRecommResult').then(res => res.data); },106 //保存推荐详情107 saveRecommend:params => { return customerAxios.post('/supplier/saveRecommend', params).then(res => res.data); },108 //获取推荐详情109 getRecommend:params => { return customerAxios.get('/supplier/getRecommend', {params:params}).then(res => res.data); },110 //获取交易中心列表111 getRecommDetail:params => { return customerAxios.get('/supplier/getRecommDetail', {params:params}).then(res => res.data); },112 //获取项目客户信息113 getCustomerContact:params => { return customerAxios.get('/supplier/getCustomerContact', {params:params}).then(res => res.data); },114 //获取项目大客户代表115 getPlatformContact:params => { return customerAxios.get('/supplier/getPlatformContact', {params:params}).then(res => res.data); },116 //保存合同进度117 saveContract:params => { return customerAxios.post('/supplier/saveContract', params).then(res => res.data); },118 //获取合同进度详情119 getContractProgress:params => { return customerAxios.get('/supplier/getContractProgress', {params:params}).then(res => res.data); },120 //获取合同列表121 getMainLease:params => { return customerAxios.get('/supplier/getMainLease', {params:params}).then(res => res.data); },122 //获取验收完成接口123 getSupplierAcceptanceVO:params => { return customerAxios.get('/supplier/getAcceptanceVO', {params:params}).then(res => res.data); },124 //保存供应商售后对接人信息125 saveAfterSaleMan:params => { return customerAxios.post('/supplier/saveAfterSaleMan', params).then(res => res.data); },126 //获取供应商售后对接人信息127 getAfterSaleMan:params => { return customerAxios.get('/supplier/getAfterSaleMan', {params:params}).then(res => res.data); },128 //获取交易进展接口129 getProductListComm:params => { return customerAxios.get('/supplier/getProductListComm', {params:params}).then(res => res.data); },130 //获取客户联系人信息131 getCustomerContact:params => { return customerAxios.get('/supplier/getCustomerContact', {params:params}).then(res => res.data); },132 //邀请码133 relationOrder:params => { return customerAxios.get('/supplier/relationOrder', {params:params}).then(res => res.data); },134 //获取消息接口135 getMsg:params => { return customerAxios.get('/msg/getMsg', {params:params}).then(res => res.data); },136 getMsgDetail:params => { return customerAxios.get('/msg/getMsgDetail', {params:params}).then(res => res.data); },137 getNotReadNum:params => { return customerAxios.get('/msg/getNotReadNum', {params:params}).then(res => res.data); },138 //找回密码139 changePwd:params => { return customerAxios.post('/changePwd?'+ qs.stringify(params)).then(res => res.data); },140 //获取营业执照审核状态141 getLicenseStatus:params => { return customerAxios.get('/getLicenseStatus', {params:params}).then(res => res.data); },142 //检验验证码的状态143 checkVerificationCode:params => { return customerAxios.get('/checkVerificationCode', {params:params}).then(res => res.data); },144 //获取验厂的状态145 factoryInspection:params => { return customerAxios.get('/factoryInspection').then(res => res.data); },146 //校验邀请码147 checkInvitation:params => { return customerAxios.get('/supplier/checkInvitation', {params:params}).then(res => res.data); },148}149export const multipleAxios=(postArray,cb)=>{150 return axios.all(postArray).then(axios.spread(function(){151 cb(...arguments);152 }));153}154customerAxios.interceptors.response.use( (response)=> {155 // 对响应数据做点什么156 if(response.data.statusCode=='401'){157 localStorage.removeItem('role');158 localStorage.removeItem('zlfuserInfo');159 window.location.href='/home.html';160 }161 return response;162 }, (error)=>{163 // 对响应错误做点什么164 return Promise.reject(error);...

Full Screen

Full Screen

getData.js

Source:getData.js Github

copy

Full Screen

...4axios.defaults.withCredentials = true;5/**6 * 1、用户身份查询接口7 */8export const getUserId = (params) => axios.get(domain+'/newMemberCenter/user/getUserIdentity',{9 params:params10 })11 .then(function(response) {12 return response.data13 });14/**15 * 2、校园用户身份查询接口16 */17export const getUserCampusId = (params) => axios.get(domain+'/newMemberCenter/user/getUserCampusIdentity',{18 params:params19}).then(function(response) {20 return response.data21});22/**23 * 3、用户信息查询接口24 */25export const getUserInfo = (params) => axios.get(domain+'/newMemberCenter/user/getUserInfo',{26 params:params27}).then(function(response) {28 return response.data29});30/**31 * 4、金币数量查询接口32 */33export const getGoldCoinCount = (params) => axios.get(domain+'/newMemberCenter/getGoldCoinCount',{34 params:params35}).then(function(response) {36 return response.data37});38/**39 * 5、钢镚数量查询接口40 */41export const getGBCount = (params) => axios.get(domain+'/newMemberCenter/getGBCount',{42 params:params43}).then(function(response) {44 return response.data45});46/**47 * 6、卡券数量查询接口48 */49export const getCouponCount = (params) => axios.get(domain+'/newMemberCenter/getCouponCount',{50 params:params51}).then(function(response) {52 return response.data53});54/**55 * 7、UP指数查询接口56 */57export const queryMemberGradeValue = (params) => axios.get(domain+'/newMemberCenter/queryMemberGradeValue',{58 params:params59}).then(function(response) {60 return response.data61});62/**63 * 8、会员权益PM查询接口64 */65export const getMemberRightsPM = (params) => axios.get(domain+'/newMemberCenter/getMemberRightsPM',{66 params:params67}).then(function(response) {68 return response.data69});70/**71 * 9、会员头部广告位PM查询接口72 */73export const getMemberHeadADPM = (params) => axios.get(domain+'/newMemberCenter/getMemberHeadADPM',{74 params:params75}).then(function(response) {76 return response.data77});78/**79 * 10、校园精品广告位PM查询接口80 */81export const getCampusADPM = (params) => axios.get(domain+'/newMemberCenter/getCampusADPM',{82 params:params83}).then(function(response) {84 return response.data85});86/**87 * 11、会员优选广告位PM查询接口88 */89export const getMemberPreferencePM = (params) => axios.get(domain+'/newMemberCenter/getMemberPreferencePM',{90 params:params91}).then(function(response) {92 return response.data93});94/**95 * 12、专属UP计划广告位查询接口96 */97export const getExclusiveUpPlanPM = (params) => axios.get(domain+'/newMemberCenter/getExclusiveUpPlanPM',{98 params:params99}).then(function(response) {100 return response.data101});102/**103 * 13.1查询任务列表104 */105export const queryMission = (params) => axios.get(domain+'/newMemberCenter/mission/queryMission',{106 params:params107}).then(function(response) {108 return response.data109});110/**111 * 13.2查询任务详情112 */113export const queryMissionDetail = (params) => axios.get(domain+'/newMemberCenter/mission/queryMissionDetail',{114 params:params115}).then(function(response) {116 return response.data117});118/**119 * 13.3接受任务120 */121export const receiveMission = (params) => axios.get(domain+'/newMemberCenter/mission/receiveMission',{122 params:params123}).then(function(response) {124 return response.data125});126/**127 * 13.4领取任务奖励128 */129export const rewardMission = (params) => axios.get(domain+'/newMemberCenter/mission/rewardMission',{130 params:params131}).then(function(response) {132 return response.data133});134/**135 * 14.1 查询金币夺宝活动列表信息136 */137export const queryActivityList = (params) => axios.get(domain+'/newMemberCenter/queryActivityList',{138 params:params139}).then(function(response) {140 return response.data141});142/**143 * 14.2 查询金币夺宝活动详情信息144 */145export const queryActivityDetail = (params) => axios.get(domain+'/newMemberCenter/queryActivityDetail',{146 params:params147}).then(function(response) {148 return response.data149});150/**151 * 14.3 用户下单前弹窗接口请求地址152 */153export const queryBasicInfoPreOrder = (params) => axios.get(domain+'/newMemberCenter/activity/queryBasicInfoPreOrder',{154 params:params155}).then(function(response) {156 return response.data157});158/**159 * 14.4 新增或追加金币夺宝接口请求地址160 */161export const createOrRebuyOrder = (params) => axios.get(domain+'/newMemberCenter/activity/createOrRebuyOrder',{162 params:params163}).then(function(response) {164 return response.data165});166/**167 * 15.1 可用兑换商品列表168 */169export const queryExchangeGoods = (params) => axios.get(domain+'/newMemberCenter/queryExchangeGoods',{170 params:params171}).then(function(response) {172 return response.data173});174/**175 * 15.2 查询商品详情176 */177export const queryExchangeGoodDetail = (params) => axios.get(domain+'/newMemberCenter/queryExchangeGoodDetail',{178 params:params179}).then(function(response) {180 return response.data181});182/**183 * 15.3 验证商品是否可兑换184 */185export const checkExchangeGood = (params) => axios.get(domain+'/newMemberCenter/checkExchangeGood',{186 params:params187}).then(function(response) {188 return response.data189});190/**191 * 15.4 商品兑换192 */193export const exchange = (params) => axios.get(domain+'/newMemberCenter/exchange',{194 params:params195}).then(function(response) {196 return response.data197});198/**199 * 16 查询铂金返现未领取接口200 */201export const queryPlatinumRebateRightsInfo = (params) => axios.get(domain+'/newMemberCenter/queryPlatinumRebateRightsInfo',{202 params:params203}).then(function(response) {204 return response.data205});206/**207 * 17 激活黑金身份208 */209export const ActivateBlack = (params) => axios.get('//vip.jr.jd.com/jsonp/jsonpActivateBlack',{210 params:params211}).then(function(response) {212 return response.data...

Full Screen

Full Screen

UserApi.js

Source:UserApi.js Github

copy

Full Screen

...4 static loginUser(user) {5 return axios.post(`${API_BASE}/api/user/login`, user);6 }7 static getCurrentUser() {8 return axios.get(`${API_BASE}/api/user`,{withCredentials:true});9 }10 static logoutUser(user) {11 return axios.post(`${API_BASE}/api/restaurant/search`, {12 username:user.email,13 password:user.password14 });15 }16 static signUpUser(user) {17 return axios.post(`${API_BASE}/api/user/register`, user);18 }19 static createMyAddress(address, userId) {20 return axios.post(`${API_BASE}/api/user/${userId}/address/create`, address);21 }22 static updateMyAddress(address,userId) {23 return axios.post(`${API_BASE}/api/user/${userId}/address/update`, address);24 }25 static createMyPhone(phone,userId) {26 return axios.post(`${API_BASE}/api/user/${userId}/phone/create`, phone);27 }28 static updateMyPhone(phone,userId) {29 return axios.post(`${API_BASE}/api/user/${userId}/phone/update`, phone);30 }31 static getRestaurantsForManagerSignup() {32 return axios.get(`${API_BASE}/api/user/restaurants/unmanaged`);33 }34 static getRestaurantsForOwnerSignup() {35 return axios.get(`${API_BASE}/api/restaurant/db/lazy`);36 }37 // Manager page38 static getRestaurantDetailsForManager(managerId) {39 return axios.get(`${API_BASE}/api/user/${managerId}/restaurant`);40 }41 static getPendingOrdersForManager(managerId) {42 return axios.get(`${API_BASE}/api/user/${managerId}/restaurant/orders/pending`);43 }44 static getAllOrdersForManager(managerId) {45 return axios.get(`${API_BASE}/api/user/${managerId}/restaurant/orders`);46 }47 static getAvailableDeliveryBoys() {48 return axios.get(`${API_BASE}/api/user/deliveryBoys`);49 }50 static assignOrderToDeliveryBoy(deliveryBoyId,orderId) {51 return axios.get(`${API_BASE}/api/user/deliveryBoy/${deliveryBoyId}/${orderId}`);52 }53 static getDeliveryBoyAssignedOrders(deliveryBoyId) {54 return axios.get(`${API_BASE}/api/user/deliveryBoy/order/${deliveryBoyId}`);55 }56 static getOrderAssignedToMe(deliveryBoyId) {57 return axios.get(`${API_BASE}/api/user/${deliveryBoyId}/order`);58 }59 static markOrderAsDelivered(orderId) {60 return axios.get(`${API_BASE}/api/restaurant/order/deliver/${orderId}`);61 }62 static deleteAddress(userId,addressId) {63 return axios.get(`${API_BASE}/api/user/${userId}/address/${addressId}/delete`);64 }65 static deletePhone(userId,phoneId) {66 return axios.get(`${API_BASE}/api/user/${userId}/phone/${phoneId}/delete`);67 }68 static updateMyProfile(user) {69 return axios.post(`${API_BASE}/api/user/profile/update`,user);70 }71 // Admin72 static getAllUsers() {73 return axios.get(`${API_BASE}/api/admin/users`);74 }75 static getAllRestaurants() {76 return axios.get(`${API_BASE}/api/restaurant/db/lazy`);77 }78 static getOwnerRestaurants(ownerId) {79 return axios.get(`${API_BASE}/api/user/owner/restaurants/${ownerId}`);80 }81 static getAllApprovals() {82 return axios.get(`${API_BASE}/api/admin/approvals/pending`);83 }84 static deleteUser(userId) {85 return axios.get(`${API_BASE}/api/admin/user/delete/${userId}`);86 }87 static getSelectedUserDetails(userId) {88 return axios.get(`${API_BASE}/api/user/details/${userId}`);89 }90 // menu item CRUD91 static createMenuItem(menuItem, menuId) {92 return axios.post(`${API_BASE}/api/admin/item/create/${menuId}`, menuItem);93 }94 static updateMenuItem(menuItem) {95 return axios.post(`${API_BASE}/api/admin/item/update`, menuItem);96 }97 static deleteMenuItem(menuItemId) {98 return axios.get(`${API_BASE}/api/admin/item/delete/${menuItemId}`);99 }100 static approveOwnership(ownerId, restaurantKey) {101 return axios.get(`${API_BASE}/api/admin/approval/approve/${ownerId}/${restaurantKey}`);102 }103 static rejectOwnership(ownerId, restaurantKey) {104 return axios.get(`${API_BASE}/api/admin/approval/reject/${ownerId}/${restaurantKey}`);105 }106 static deleteRestaurant(restaurantKey) {107 return axios.get(`${API_BASE}/api/admin/restaurant/delete/${restaurantKey}`);108 }109 static requestOwnerShip(ownerId, restaurantKey) {110 return axios.get(`${API_BASE}/api/user/${ownerId}/own/restaurant/${restaurantKey}`);111 }112 static unAssignOwnership(ownerId, restaurantKey) {113 return axios.get(`${API_BASE}/api/user/owner/unassign/${ownerId}/${restaurantKey}`);114 }115 static getUnOwnedRestaurants(ownerId) {116 return axios.get(`${API_BASE}/api/user/restaurants/unowned/${ownerId}`);117 }118 // Followers119 static getIamFollowing(userId) {120 return axios.get(`${API_BASE}/api/user/followings/${userId}`);121 }122 static followCustomer(userId, toBeFollowedId) {123 return axios.get(`${API_BASE}/api/user/follow/${userId}/${toBeFollowedId}`);124 }125 static unfollowCustomer(userId, toBeUnFollowedId) {126 return axios.get(`${API_BASE}/api/user/unfollow/${userId}/${toBeUnFollowedId}`);127 }128 static getMyListOfOrders(userId) {129 return axios.get(`${API_BASE}/api/user/order/${userId}`);130 }131 static adminCreateUser(user) {132 return axios.post(`${API_BASE}/api/admin/user/create`, user);133 }134}...

Full Screen

Full Screen

store.js

Source:store.js Github

copy

Full Screen

...12 },13 actions: {14 // eslint-disable-next-line15 getKhg({}){16 return axios.get(`${M_API}/costByActivity`)17 .then(res => {18 return res.data19 })20 // .catch(err => Promise.reject(err))21 },22 getAnggaran({ }){23 return axios.get(`${M_API}/anggaran`)24 .then(res => {25 return res.data26 })27 },28 provinces({ }) {29 return axios.get(`${M_API}/provinces`)30 .then(res => {31 return res.data32 })33 },34 getPlanningAnggaran({ }) {35 return axios.get(`${M_API}/peatlandrewetting`)36 .then(res => {37 return res.data38 })39 40 },41 getPlanningrevegetasi({ }) {42 return axios.get(`${M_API}/revegetation`)43 .then(res => {44 return res.data45 })46 47 },48 getPlanningrevitalization({ }) {49 return axios.get(`${M_API}/revitalization`)50 .then(res => {51 return res.data52 })53 54 },55 56 getPlanningStabilization({ }) {57 return axios.get(`${M_API}/baseStabilization`)58 .then(res => {59 return res.data60 })61 62 },63 getPlanninginstStrengthening({ }) {64 return axios.get(`${M_API}/instStrengthening`)65 .then(res => {66 return res.data67 })68 69 },70 getPlanningcoopImprove({ }) {71 return axios.get(`${M_API}/coopImprove`)72 .then(res => {73 return res.data74 })75 76 },77 getPlanningactifRoles({ }) {78 return axios.get(`${M_API}/actifRoles`)79 .then(res => {80 return res.data81 })82 83 },84 getPlanningpeatlandRestoration({ }) {85 return axios.get(`${M_API}/peatlandRestoration`)86 .then(res => {87 return res.data88 })89 90 },91 getPlanningadminstrartionManagement({ }) {92 return axios.get(`${M_API}/administrationManagement`)93 .then(res => {94 return res.data95 })96 97 },98 // eslint-disable-next-line99 getPlanningCost({ }) {100 return axios.get(`${M_API}/totalcost`)101 .then(res => {102 return res.data103 })104 .catch(err => Promise.reject(err))105 },106 totalkegiatan({ }) {107 return axios.get(`${M_API}/totalkegiatan`)108 .then(res => {109 return res.data110 })111 .catch(err => Promise.reject(err))112 },113 114 totallembaga({ }) {115 return axios.get(`${M_API}/totallembaga`)116 .then(res => {117 return res.data118 })119 .catch(err => Promise.reject(err))120 },121 // eslint-disable-next-line122 getPlanningCostByProvince({ }) {123 return axios.get(`${M_API}/costByProvince`)124 .then(res => {125 return res.data126 })127 .catch(err => Promise.reject(err))128 },129 // eslint-disable-next-line130 getPlanningCostByKegiatan({ }) {131 return axios.get(`${M_API}/costByActivity`)132 .then(res => {133 return res.data134 })135 .catch(err => Promise.reject(err))136 },137 // eslint-disable-next-line138 getPlanningAreaByProvince({ }) {139 return axios.get(`${M_API}/area-by-province-plan`)140 .then(res => {141 return res.data142 })143 .catch(err => Promise.reject(err))144 },145 // eslint-disable-next-line146 getPlanningAction({ }) {147 return axios.get(`${M_API}/total-action-plan`)148 .then(res => {149 return res.data150 })151 .catch(err => Promise.reject(err))152 },153 // eslint-disable-next-line154 getPlanningActionByProvince({ }) {155 return axios.get(`${M_API}/action-by-province-plan`)156 .then(res => {157 return res.data158 })159 .catch(err => Promise.reject(err))160 },161 // eslint-disable-next-line162 getPlanningCostByFundingSource({ }) {163 return axios.get(`${M_API}/cost-by-funding-source-plan`)164 .then(res => {165 return res.data166 })167 .catch(err => Promise.reject(err))168 },169 }170}...

Full Screen

Full Screen

api.js

Source:api.js Github

copy

Full Screen

...22export const requestLogin = params => {23 return axios.post(`${base}/user/login`, params).then(res => res.data);24};25export const getFlyerJobListPage = params => {26 return axios.get(`${base}/flyerJob/listpage`, {params: params});27};28export const removeFlyerJob = params => {29 return axios.get(`${base}/flyerjob/remove`, {params: params});30};31export const operateFlyerJob = params => {32 return axios.get(`${base}/flyerjob/operate`, {params: params});33};34export const runFlyerJobNow = params => {35 return axios.get(`${base}/flyerjob/runnow`, {params: params});36};37export const cancelFlyerJobNow = params => {38 return axios.get(`${base}/flyerjob/cancel`, {params: params});39};40export const batchRemoveFlyerJob = params => {41 return axios.get(`${base}/flyerjob/batchremove`, {params: params});42};43export const editFlyerJob = params => {44 return axios.post(`${base}/flyerjob/edit`, params);45};46export const addFlyerJob = params => {47 return axios.get(`${base}/flyerjob/add`, {params: params});48};49export const listClient = params => {50 return axios.get(`${base}/flyerjob/clients`, {params: params});51};52//record53export const listRecord = params => {54 return axios.get(`${base}/record/list`, {params: params});55};56// app57export const getAppListPage = params => {58 return axios.get(`${base}/app/listpage`, {params: params});59};60export const getAppList = params => {61 return axios.get(`${base}/app/list`);62};63export const addApp = params => {64 return axios.get(`${base}/app/add`, {params: params});65};66export const editApp = params => {67 return axios.post(`${base}/app/edit`, params);68};69export const removeApp = params => {70 return axios.get(`${base}/app/remove`, {params: params});71};72export const batchRemoveApp = params => {73 return axios.get(`${base}/app/batchremove`, {params: params});74};75// user76export const getUserListPage = params => {77 return axios.get(`${base}/user/listpage`, {params: params});78};79export const getUserList = params => {80 return axios.get(`${base}/user/list`);81};82export const addUser = params => {83 return axios.get(`${base}/user/add`, {params: params});84};85export const editUser = params => {86 return axios.post(`${base}/user/edit`, params);87};88export const removeUser = params => {89 return axios.get(`${base}/user/remove`, {params: params});90};91//cluster92export const getCluster = params => {93 return axios.get(`${base}/cluster/show`);94};95export const editCluster = params => {96 return axios.get(`${base}/cluster/save`, {params: params});...

Full Screen

Full Screen

spotifyRequest.test.js

Source:spotifyRequest.test.js Github

copy

Full Screen

1const axios = require ('axios');2jest.mock('../database/users.js');3jest.mock('axios')4jest.mock('../spotify/spotifyRequest.js');5process.env.CLIENT_ID = "client_id_mock"6process.env.CLIENT_SECRET = "client_secret_mock"7process.env.SPOTIFY_REDIRECT = "SPOTIFY_REDIRECT_mock"8const spotifyRequest = require ('../spotify/spotifyRequest');9const {10 getFromSpotifyWithLimits,11 getFromSpotify,12 getFromSpotifyByIds13} = jest.requireActual('../spotify/spotifyRequest');14describe('module spotifyRequest', () => {15 beforeEach(() => {16 jest.resetAllMocks('axios')17 })18 describe('function getFromSpotify', () => {19 it('should call axios.get', () => {20 return getFromSpotify('some random url', 'random token')21 .then(results => {22 expect(axios.get).toHaveBeenCalledTimes(1);23 })24 })25 it('should have called axios.get with arguments', () => {26 const args = {27 url: 'urlArg',28 token: 'tokenArg',29 options: {30 params: {31 }32 }33 }34 const request = getFromSpotify(args.url, args.token, args.options);35 return request.then (results => {36 expect(axios.get).toHaveBeenCalledWith(args.url, expect.any(Object))37 })38 })39 it('should have returned a promise', () => {40 expect(getFromSpotify()).toBeInstanceOf(Promise);41 })42 it('should return data property from axios.get', () => {43 const mockedData = {44 arg1: 'test1',45 arg2: 'test2'46 }47 axios.get.mockReturnValueOnce(Promise.resolve({data: mockedData}))48 return getFromSpotify('someUrl', 'token')49 .then(data => {50 expect(data).toStrictEqual(mockedData);51 expect(data).toStrictEqual(expect.objectContaining({52 arg1: 'test1',53 arg2: 'test2'54 }))55 })56 })57 })58 describe('function getFromSpotifyWithLimits', () => {59 it('should return a promise', () => {60 expect(getFromSpotifyWithLimits()).toBeInstanceOf(Promise);61 })62 it('should call axios one time', () => {63 axios.get.mockResolvedValueOnce({data: {items: ['test', 'test2'], next: null}})64 return getFromSpotifyWithLimits('url', 'token', {params: {ids: ['setst', 'ewtewt']}})65 .then(results => {66 return expect(axios.get).toHaveBeenCalledTimes(1);67 })68 })69 it('should call axios 2 times when returned with next url', () => {70 axios.get.mockClear();71 const response1 = {data: {72 items: [],73 next: 'weirdURL'74 }}75 const response2 = {76 data: {77 items: [],78 next: null79 }80 }81 axios.get.mockResolvedValueOnce(response1);82 axios.get.mockResolvedValueOnce(response2);83 return getFromSpotifyWithLimits('url', 'token')84 .then(items => {85 return expect(axios.get).toHaveBeenCalledTimes(2);86 })87 })88 })89 describe('function getFromSpotifyByIds', () => {90 })...

Full Screen

Full Screen

index.js

Source:index.js Github

copy

Full Screen

2const API_ENDPOINT = process.env.API_ENDPOINT;3const TILE_ENDPOINT = process.env.TILE_ENDPOINT;4const CLOUDSEARCH_ENDPOINT = process.env.CLOUDSEARCH_ENDPOINT;5export const exploracion = {6 getLayers: (locationType) => axios.get(`${API_ENDPOINT}/exploracion/layers`, {7 params: { locationType }8 }),9 getLocation: (locationType, id) => axios.get(`${API_ENDPOINT}/exploracion/location`, {10 params: { locationType, id }11 }),12 getSuggestions: str => axios.get(`${CLOUDSEARCH_ENDPOINT}`, {13 params: {14 q: `${str}*|${str}`,15 'q.parser': 'simple',16 'q.options': {17 'defaultOperator': 'and',18 'fields': ['nombre'],19 'operators': ['and', 'escape', 'fuzzy', 'near', 'not', 'or', 'phrase', 'precedence', 'prefix', 'whitespace']20 },21 return: '_all_fields,_score',22 sort: '_score desc',23 'highlight.nombre': {24 'max_phrases': 3,25 'format': 'text',26 'pre_tag': '*#*',27 'post_tag': '*%*'28 }29 }30 }),31 getVector: (field, locationType) => {32 return axios.get(`${API_ENDPOINT}/exploracion/test`, { 33 params: { locationType, field } 34 });35 }36};37export const monitoreo = {38 getVector: (caseID, index ) => axios.get(`${API_ENDPOINT}/monitor/vector`, {39 params: { caseID, index }40 }),41 getLocation: (locationType, id) => axios.get(`${API_ENDPOINT}/exploracion/location`, {42 params: { locationType, id }43 }),44};45export const ubicacion = {46 municipio: {47 getBasicInformation: id => axios.get(`${API_ENDPOINT}/municipio/${id}/general`),48 getConevalInformation: id => axios.get(`${API_ENDPOINT}/municipio/${id}/coneval`),49 getFeatures: id => axios.get(`${API_ENDPOINT}/municipio/${id}/localidades`),50 getGeoJSON: id => axios.get(`${API_ENDPOINT}/municipio/${id}/geojson`),51 getRiesgoMunicipio: id => axios.get(`${API_ENDPOINT}/municipio/${id}/riesgo`),52 getCobertura: id => axios.get(`${API_ENDPOINT}/municipio/${id}/cobertura`),53 getRecomendacion: id => axios.get(`${API_ENDPOINT}/municipio/${id}/recomendacion`),54 getCoberturaDict: id => axios.get(`${API_ENDPOINT}/informacion/cobertura`)55 },56 estado: {57 getBasicInformation: id => axios.get(`${API_ENDPOINT}/estado/${id}/general`),58 getConevalInformation: id => axios.get(`${API_ENDPOINT}/estado/${id}/coneval`),59 getFeatures: id => axios.get(`${API_ENDPOINT}/estado/${id}/municipios`),60 getGeoJSON: id => axios.get(`${API_ENDPOINT}/estado/${id}/geojson`),61 getRiesgoMunicipio: id => axios.get(`${API_ENDPOINT}/estado/${id}/riesgo`),62 getCobertura: id => axios.get(`${API_ENDPOINT}/estado/${id}/cobertura`),63 getRecomendacion: id => axios.get(`${API_ENDPOINT}/estado/${id}/recomendacion`),64 getCoberturaDict: id => axios.get(`${API_ENDPOINT}/informacion/cobertura`)65 }...

Full Screen

Full Screen

used-props.service.js

Source:used-props.service.js Github

copy

Full Screen

1import Axios from 'axios';2const USER = 'users/';3const PROPS = 'props/';4const USED = 'used/';5const COUNT = 'count';6const props = {7 fetch(num, page, approved) {8 return Axios.get(`${PROPS}${USED}?num=${num}&page=${page}&approved=${approved}`);9 },10 fetchAll(num, page) {11 return Axios.get(`${PROPS}${USED}?num=${num}&page=${page}&all=true`);12 },13 fetchByUser(num, page, user, approved) {14 return Axios.get(`${USER}${user}/${PROPS}?num=${num}&page=${page}&approved=${approved}`);15 },16 fetchByUserAll(num, page, user) {17 return Axios.get(`${USER}${user}/${PROPS}?num=${num}&page=${page}&all=true`);18 },19 fetchByCategory(num, page, category, approved) {20 return Axios.get(`${PROPS}${USED}?num=${num}&page=${page}&category=${category}&approved=${approved}`);21 },22 fetchByCategoryAll(num, page, category) {23 return Axios.get(`${PROPS}${USED}?num=${num}&page=${page}&category=${category}&all=true`);24 },25 fetchByUserAndCategory(num, page, user, category, approved) {26 return Axios.get(`${USER}${user}/${PROPS}?num=${num}&page=${page}&category=${category}&approved=${approved}`);27 },28 fetchByUserAndCategoryAll(num, page, user, category) {29 return Axios.get(`${USER}${user}/${PROPS}?num=${num}&page=${page}&category=${category}&all=true`);30 },31 post(data) {32 return Axios.post(`${PROPS}${USED}`, data);33 },34 review(id, data) {35 return Axios.put(`${PROPS}${USED}${id}/review`, data);36 },37 delete(id) {38 return Axios.delete(`${PROPS}${USED}${id}`);39 },40 put(id, data) {41 return Axios.put(`${PROPS}${USED}${id}`, data);42 }43};44const count = {45 fetch(approved) {46 return Axios.get(`${PROPS}${USED}${COUNT}?approved=${approved}`);47 },48 fetchAll() {49 return Axios.get(`${PROPS}${USED}${COUNT}&all=true`);50 },51 fetchByUser(user, approved) {52 return Axios.get(`${USER}${user}/${PROPS}${COUNT}?approved=${approved}`);53 },54 fetchByUserAll(user) {55 return Axios.get(`${USER}${user}/${PROPS}${COUNT}?all=true`);56 },57 fetchByCategory(category, approved) {58 return Axios.get(`${PROPS}${USED}${COUNT}?category=${category}&approved=${approved}`);59 },60 fetchByCategoryAll(category) {61 return Axios.get(`${PROPS}${USED}${COUNT}?category=${category}&all=true`);62 },63 fetchByUserAndCategory(user, category, approved) {64 return Axios.get(`${USER}${user}/${PROPS}${COUNT}?category=${category}&approved=${approved}`);65 },66 fetchByUserAndCategoryAll(user, category) {67 return Axios.get(`${USER}${user}/${PROPS}${COUNT}?category=${category}&all=true`);68 }69};70export {71 props,72 count...

Full Screen

Full Screen

Using AI Code Generation

copy

Full Screen

1var axios = require('axios');2var config = {3 headers: { }4};5axios(config)6.then(function (response) {7 console.log(JSON.stringify(response.data));8})9.catch(function (error) {10 console.log(error);11});12{"build":{"version":"1.20.2","revision":"a6b8d8e","time":"2020-12-08T20:17:09.000Z"},"os":{"arch":"x64","name":"Linux","version":"4.15.0-142-generic"},"java":{"version":"

Full Screen

Using AI Code Generation

copy

Full Screen

1const axios = require('axios');2const axiosInstance = axios.create({3 headers: {4 }5});6const data = {7 "desiredCapabilities": {8 }9};10axiosInstance.post('/session', data)11 .then((response) => {12 console.log(response.data);13 })14 .catch((error) => {15 console.log(error);16 });17const axios = require('axios');18const axiosInstance = axios.create({19 headers: {20 }21});22const data = {23 "desiredCapabilities": {24 }25};26axiosInstance.post('/session', data)27 .then((response) => {28 console.log(response.data);29 })30 .catch((error) => {31 console.log(error);32 });33const axios = require('axios');34const axiosInstance = axios.create({35 headers: {36 }37});38const data = {39 "desiredCapabilities": {

Full Screen

Using AI Code Generation

copy

Full Screen

1var axios = require('axios');2axios.get(url).then(function(response) {3 console.log(response.data);4}).catch(function(error) {5 console.log(error);6});7var axios = require('axios');8axios.post(url).then(function(response) {9 console.log(response.data);10}).catch(function(error) {11 console.log(error);12});13var axios = require('axios');14axios.post(url).then(function(response) {15 console.log(response.data);16}).catch(function(error) {17 console.log(error);18});19var axios = require('axios');20axios.post(url).then(function(response) {21 console.log(response.data);22}).catch(function(error) {23 console.log(error);24});25var axios = require('axios');26axios.post(url).then(function(response) {27 console.log(response.data);28}).catch(function(error) {29 console.log(error);30});31var axios = require('axios');32axios.post(url).then(function(response) {33 console.log(response.data);34}).catch(function(error) {35 console.log(error);36});37var axios = require('axios');38axios.post(url).then(function(response) {39 console.log(response.data);40}).catch(function(error) {41 console.log(error);42});43var axios = require('axios');

Full Screen

Using AI Code Generation

copy

Full Screen

1var axios = require('axios');2axios.get(url)3 .then(function(response) {4 console.log(response.data);5 })6 .catch(function(error) {7 console.log(error);8 });9var axios = require('axios');10axios.post(url, {11 desiredCapabilities: {12 }13})14 .then(function(response) {15 console.log(response.data);16 })17 .catch(function(error) {18 console.log(error);19 });20var axios = require('axios');21axios.delete(url)22 .then(function(response) {23 console.log(response.data);24 })25 .catch(function(error) {26 console.log(error);27 });28var axios = require('axios');29axios.get(url)30 .then(function(response) {31 console.log(response.data);32 })33 .catch(function(error) {34 console.log(error);35 });36var axios = require('axios');37axios.delete(url)38 .then(function(response

Full Screen

Using AI Code Generation

copy

Full Screen

1var axios = require('axios');2console.log(currentActivity.data.value);3var axios = require('axios');4console.log(currentActivity.data.value);5var axios = require('axios');6console.log(currentActivity.data.value);7var axios = require('axios');8console.log(currentActivity.data.value);9var axios = require('axios');10console.log(currentActivity.data.value);11var axios = require('axios');12console.log(currentActivity.data.value);13var axios = require('axios');14console.log(currentActivity.data.value);15var axios = require('axios');16console.log(currentActivity.data.value);

Full Screen

Using AI Code Generation

copy

Full Screen

1const axios = require('axios');2axios.get(url)3 .then((response) => {4 console.log(response.data);5 })6 .catch((error) => {7 console.log(error);8 });

Full Screen

Using AI Code Generation

copy

Full Screen

1var axios = require('axios');2var status = async function () {3 try {4 return response.data.status;5 } catch (error) {6 return error;7 }8};9module.exports = status;10var appiumStatus = require('./appiumStatus');11var assert = require('assert');12describe('Test Appium Status', function () {13 it('should return 0', async function () {14 var res = await appiumStatus();15 assert.equal(res, 0);16 });17});18var axios = require('axios');19var status = async function () {20 try {21 return response.data.status;22 } catch (error) {23 return error;24 }25};26module.exports = status;27var appiumStatus = require('./appiumStatus');28var assert = require('assert');29describe('Test Appium Status', function () {30 it('should return 0', async function () {31 var res = await appiumStatus();32 assert.equal(res, 0);33 });34});35var axios = require('axios');36var status = async function () {37 try {38 return response.data.status;39 } catch (error) {40 return error;41 }42};43module.exports = status;44var appiumStatus = require('./appiumStatus');45var assert = require('assert');46describe('Test Appium Status', function () {47 it('

Full Screen

Using AI Code Generation

copy

Full Screen

1const axios = require('axios');2const axiosConfig = {3 headers: {4 }5};6axios(axiosConfig)7 .then(response => {8 console.log(response.data);9 })10 .catch(error => {11 console.log(error);12 });

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run Appium Base Driver 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