示例#1
0
        public void getUserLoginDetails(string username)
        {
            String url;
            string path;

            url = GetServicesUrl() + "/mobileapi/api/logindetails";
            ApiKeywords.InitializeRequest(url);
            ApiKeywords.SetMethod("GET");
            ApiKeywords.SetParameter("username", username);
            string responsce = ApiKeywords.SendRequest();

            path = "actor_Id";
            string actorid = ApiKeywords.GetValueFromJSONObject(responsce, path);

            System.Console.WriteLine("Response of API  " + responsce);
            //System.Console.WriteLine("Response of API  " + actorid);
            GlobalVariables.actorid = actorid;
            path = "user_Id";
            string user_Id = ApiKeywords.GetValueFromJSONObject(responsce, path);

            GlobalVariables.userid = user_Id;
            path = "serviceCycle_Id";
            string serviceCycle_Id = ApiKeywords.GetValueFromJSONObject(responsce, path);

            GlobalVariables.servicecycleid = serviceCycle_Id;
            path = "group_Id";
            string group_Id = ApiKeywords.GetValueFromJSONObject(responsce, path);

            GlobalVariables.groupid = group_Id;
        }
示例#2
0
        public void VerifyLoginDetailsAPI(string username)
        {
            String url;

            url = baseurl + "/mobileapi/api/logindetails";
            ApiKeywords.InitializeRequest(url);
            ApiKeywords.SetMethod("GET");
            ApiKeywords.SetParameter("username", username);
            string responsce = ApiKeywords.SendRequest();
            string path      = "actor_Id";
            string actorid   = ApiKeywords.GetValueFromJSONObject(responsce, path);

            //System.Console.WriteLine("Response of API  " + responsce);
            //System.Console.WriteLine("Response of API  " + actorid);
            GlobalVariables.actorid = actorid;
        }
示例#3
0
        public void VerifyMobileTosAPI()
        {
            String url;

            url = baseurl + "/mobileapi/api/tos?tosType=mobile";
            ApiKeywords.InitializeRequest(url);
            ApiKeywords.SetMethod("GET");
            cma.SetMobileCommonHeader(token);
            // ApiKeywords.SetParameter("tosType","mobile");
            string responsce = ApiKeywords.SendRequest();
            string path      = "content";
            string content   = ApiKeywords.GetValueFromJSONObject(responsce, path);

            softAssertions.Add("TOS content", "Terms of Service", content, "Contains");
            System.Console.WriteLine("Response of API  " + responsce);
            // System.Console.WriteLine("Response of API  " + content);
        }
示例#4
0
        // call in config test
        public void VerifyMobileConfigurationAPI(string username)
        {
            String url;

            url = baseurl + "/mobileapi/api/configuration";
            ApiKeywords.InitializeRequest(url);
            ApiKeywords.SetMethod("GET");
            cma.SetMobileCommonHeader(token);
            string responsce = ApiKeywords.SendRequest();
            string path      = "is_fitness_enabled";
            string value     = ApiKeywords.GetValueFromJSONObject(responsce, path);

            softAssertions.Add("Configuration is_fitness_enabled", "true", value, "equals");
            System.Console.WriteLine("Response of API  " + responsce);
            //System.Console.WriteLine("Response of API  " + actorid);
            //GlobalVariables.actorid = actorid;
        }
示例#5
0
        // Call by Dashboard tile
        public void VerifyDashboardTile()
        {
            String url;

            url = baseurl + "/mobileapi/api/dashboardtiles";
            ApiKeywords.InitializeRequest(url);
            ApiKeywords.SetMethod("POST");
            ApiKeywords.SetParameter("application / json", "{\"date\":\"09\\/19\\/2018\",\"tiles\":[\"points\",\"unread_messages_count\"]}", "body");
            cma.SetMobileCommonHeader(token);
            string responsce = ApiKeywords.SendRequest();

            System.Console.WriteLine("Response of API  " + responsce);
            string path  = "ha_percentage";
            string value = ApiKeywords.GetValueFromJSONObject(responsce, path);

            softAssertions.Add("Configuration ha_percentage", "0", value, "equals", "false");
        }
示例#6
0
        /// <summary>
        ///  Return the User Id
        /// </summary>

        public string GetUserID()
        {
            string path;
            Common cmn    = new Common();
            string env    = cmn.GetEnvFromUrl();
            string apiurl = "https://" + env + "services.onlifehealth.com/mobileapi/api/logindetails?username="******"GET");
            string jsonresponse = ApiKeywords.SendRequest();

            path = "user_Id";
            string userid = ApiKeywords.GetValueFromJSONObject(jsonresponse, path);

            return(userid);
        }