Ejemplo n.º 1
0
        public void SwitchingContexts()
        {
            WatsUpUserActions     UA = new WatsUpUserActions();
            WatsUpUserCheckPoints CP = new WatsUpUserCheckPoints();

            try
            {
                timer.Restart();

                UA.Click_On_Button(WatsUpWelcomePage.termsAndConditionsBtn, CommonActions.LocatorType.byname, "Terms And Conditions", "Terms And Conditions Buttons", 120);
                testSteps.Add("Successfully clicked on Terms And Conditions");
                UA.WaitAction(CommonActions.Wait.WaitForElement, CommonActions.LocatorType.byid, WatsUpWelcomePage.TermaAndConditions.tabSwitcherBtn, "Tab Swicther", 180);
                testSteps.Add("Successfully waited fot element");
                UA.Switching_Contexts(CommonActions.Action.SwitchContext, "WEBVIEW");
                testSteps.Add("Successfully switched to WEBVIEW_1");
                UA.Click_On_Button(WatsUpWelcomePage.TermaAndConditions.rightMenuBtn, CommonActions.LocatorType.byxpath, "Show Menu", "Show Menu Control");
                testSteps.Add("Successfully clicked on Show Menu");
                timer.Stop();
                ReportLibrary.logResult(ResultStatus.Pass, testSteps, null, null, this.timer.Elapsed.Minutes.ToString() + " Mins");
            }
            catch (Exception ex)
            {
                ReportLibrary.logResult(ResultStatus.Fail, testSteps, ex.Message, appiumDriver, this.timer.Elapsed.Seconds.ToString() + " Seconds");
                throw ex;
            }
        }
Ejemplo n.º 2
0
        public void TapElement()
        {
            WatsUpUserActions     UA = new WatsUpUserActions();
            WatsUpUserCheckPoints CP = new WatsUpUserCheckPoints();

            try
            {
                timer.Restart();

                //UA.Click_On_Button("Terms And Conditions", WatsUpWelcomePage.termsAndConditionsBtn, "Name", "Terms And Conditions Buttons", 120);
                //testSteps.Add("Successfully clicked on Terms And Conditions");
                UA.Click_On_Button(WatsUpWelcomePage.agreeAndContinueBtn, CommonActions.LocatorType.byname, "Agree and continue", "Agree And Continue Button", 120);
                testSteps.Add("Successfully landed on Country List View");
                UA.TapElement();
                testSteps.Add("Successfully Taped");

                timer.Stop();
                ReportLibrary.logResult(ResultStatus.Pass, testSteps, null, null, this.timer.Elapsed.Minutes.ToString() + " Mins");
            }
            catch (Exception ex)
            {
                ReportLibrary.logResult(ResultStatus.Fail, testSteps, ex.Message, appiumDriver, this.timer.Elapsed.Seconds.ToString() + " Seconds");
                throw ex;
            }
        }
        public override Telerik.Reporting.Report getBarChartLayout(ReportLibrary.RowData[] data)
        {
            ReportTemplates.BarChartTwoGroup r = new ReportTemplates.BarChartTwoGroup("Bar Chart");
            r.populateGroup1(majorgroup, "gid");
            r.populateGroup2(minorgroup, minor_group_header);
            r.populateBarChart(section, data, category_group, series_group, graph_X, filterOne, "", category_group_header, flag);

            return r;
        }
 /*
 * Populates the Bar Chart in the details panel
 *
 * @return void
 *
 */
 public void populateBarChart(Dictionary<String, String> minisection, ReportLibrary.RowData[] data, String category_group, String series_group, String graph_X, String filterOne, String filterTwo, String category_group_header, int flag)
 {
     if (minisection.Count > 0)
     {
         this.Groups[3].Groupings.Add(category_group_header);
         this.populateBarChart(this.graph_section, minisection, data, category_group, series_group, graph_X, filterOne, filterTwo, flag);
         //groupFooterSection.PageBreak = PageBreak.After;
         this.Items.Remove(this.detailSection);
     }
     else {
         this.Items.Remove(this.groupHeaderSection);
         this.Items.Remove(this.groupFooterSection);
     }
 }
Ejemplo n.º 5
0
        public void WebViewAndNativeApp()
        {
            CommonUserActions     UA = new CommonUserActions();
            CommonUserCheckPoints CP = new CommonUserCheckPoints();

            try
            {
                timer.Restart();

                UA.WaitAction(CommonActions.Wait.WaitForElement, CommonActions.LocatorType.byxpath, LinkedInPage.LinkedInHomePage.joinnowBtn, "Join Now", 120);
                testSteps.Add("Successfully waited for Join Now button");
                UA.WaitAction(CommonActions.Wait.WaitForElement, CommonActions.LocatorType.byid, LinkedInPage.LinkedInHomePage.linkedInScreen, "Home Screen", 30);
                #region Swipe screen left side
                UA.SwipeActions(CommonActions.Action.SwipeScreenLeft, LinkedInPage.LinkedInHomePage.linkedInScreen, CommonActions.LocatorType.byid);
                UA.WaitAction(CommonActions.Wait.WaitForElement, CommonActions.LocatorType.byid, LinkedInPage.LinkedInHomePage.linkedInScreen, "Home Screen", 30);
                UA.SwipeActions(CommonActions.Action.SwipeScreenLeft, LinkedInPage.LinkedInHomePage.linkedInScreen, CommonActions.LocatorType.byid);
                UA.WaitAction(CommonActions.Wait.WaitForElement, CommonActions.LocatorType.byid, LinkedInPage.LinkedInHomePage.linkedInScreen, "Home Screen", 30);
                UA.SwipeActions(CommonActions.Action.SwipeScreenLeft, LinkedInPage.LinkedInHomePage.linkedInScreen, CommonActions.LocatorType.byid);
                UA.WaitAction(CommonActions.Wait.WaitForElement, CommonActions.LocatorType.byid, LinkedInPage.LinkedInHomePage.linkedInScreen, "Home Screen", 30);
                UA.SwipeActions(CommonActions.Action.SwipeScreenLeft, LinkedInPage.LinkedInHomePage.linkedInScreen, CommonActions.LocatorType.byid);
                #endregion
                UA.Click_On_Button(LinkedInPage.LinkedInHomePage.joinnowBtn, CommonActions.LocatorType.xpath, "Join Now", "Join Now");
                testSteps.Add("Successfully clicked on Join Now button");
                UA.WaitAction(CommonActions.Wait.TimeWait, CommonActions.LocatorType.emptyLocatorType, string.Empty, string.Empty, 120);
                testSteps.Add("Successfully implimented Implicit Wait");
                UA.GetText(CommonActions.Action.GetText, LinkedInPage.LinkedInRegistration.browserURL, CommonActions.LocatorType.byid, "URL");
                //UA.Switching_Contexts(CommonActions.Action.SwitchToDefaultContext, string.Empty);
                //testSteps.Add("Successfully switched from Native App");
                //UA.Switching_Contexts(CommonActions.Action.SwitchContext, "WEBVIEW_com.android.browser");
                //testSteps.Add("Successfully switched from Native App to WEBVIEW App");
                ////UA.Switching_Contexts(CommonActions.Action.SwitchContext, "WEBVIEW");
                //testSteps.Add("Successfully switched from Native App to WEBVIEW App");
                //UA.WaitAction(CommonActions.Wait.WaitForElement, CommonActions.LocatorType.name, LinkedInPage.LinkedInRegistration.lastNameTxt, "Last Name", 120);
                ////UA.Enter_Text(CommonActions.LocatorType.name, LinkedInPage.LinkedInRegistration.firstNameTxt, "First Name", "Praveenreddy");
                ////UA.Enter_Text(CommonActions.LocatorType.name, LinkedInPage.LinkedInRegistration.lastNameTxt, "Last Name", "Narala");
                ////UA.Enter_Text(CommonActions.LocatorType.id, LinkedInPage.LinkedInRegistration.emailTxt, "Email", "*****@*****.**");

                timer.Stop();
                ReportLibrary.logResult(ResultStatus.Pass, testSteps, null, null, this.timer.Elapsed.Minutes.ToString() + " Mins");
            }
            catch (Exception ex)
            {
                ReportLibrary.logResult(ResultStatus.Fail, testSteps, ex.Message, appiumDriver, this.timer.Elapsed.Seconds.ToString() + " Seconds");
                throw ex;
            }
        }
Ejemplo n.º 6
0
        /// <summary>
        /// update
        /// </summary>
        /// <param name="id">id</param>
        /// <param name="resource">resource</param>
        /// <returns>ApiResultReportLibrary</returns>
        public ApiResultReportLibrary UpdateReportLibrary(long?id, ReportLibrary resource)
        {
            // verify the required parameter 'id' is set
            if (id == null)
            {
                throw new ApiException(400, "Missing required parameter 'id' when calling UpdateReportLibrary");
            }

            // verify the required parameter 'resource' is set
            if (resource == null)
            {
                throw new ApiException(400, "Missing required parameter 'resource' when calling UpdateReportLibrary");
            }


            var path = "/reportLibraries/{id}";

            path = path.Replace("{format}", "json");
            path = path.Replace("{" + "id" + "}", ApiClient.ParameterToString(id));

            var    queryParams  = new Dictionary <String, String>();
            var    headerParams = new Dictionary <String, String>();
            var    formParams   = new Dictionary <String, String>();
            var    fileParams   = new Dictionary <String, FileParameter>();
            String postBody     = null;

            postBody = ApiClient.Serialize(resource);                                     // http body (model) parameter

            // authentication setting, if any
            String[] authSettings = new String[] { "FortifyToken" };

            // make the HTTP request
            IRestResponse response = (IRestResponse)ApiClient.CallApi(path, Method.PUT, queryParams, postBody, headerParams, formParams, fileParams, authSettings);

            if (((int)response.StatusCode) >= 400)
            {
                throw new ApiException((int)response.StatusCode, "Error calling UpdateReportLibrary: " + response.Content, response.Content);
            }
            else if (((int)response.StatusCode) == 0)
            {
                throw new ApiException((int)response.StatusCode, "Error calling UpdateReportLibrary: " + response.ErrorMessage, response.ErrorMessage);
            }

            return((ApiResultReportLibrary)ApiClient.Deserialize(response.Content, typeof(ApiResultReportLibrary), response.Headers));
        }
Ejemplo n.º 7
0
        public void TestApp()
        {
            CommonUserActions     UA = new CommonUserActions();
            CommonUserCheckPoints CP = new CommonUserCheckPoints();

            try
            {
                timer.Restart();
                UA.WaitAction(CommonActions.Wait.WaitForElement, CommonActions.LocatorType.byname, LinkedInPage.TestApp.buttonStartWebviewCD, "Chrome Button", 120);
                UA.Click_On_Button(LinkedInPage.TestApp.buttonStartWebviewCD, CommonActions.LocatorType.byname, "Chrome", "ChromeBtn");
                UA.Switching_Contexts(CommonActions.Action.SwitchContext, "WEBVIEW");
                //UA.GetControlText(CommonActions.Action.GetURL, CommonActions.LocatorType.emptyLocatorType);
                UA.Enter_Text(CommonActions.LocatorType.byid, LinkedInPage.TestApp.nameTxt, "Testing", "Testing");
                timer.Stop();
                ReportLibrary.logResult(ResultStatus.Pass, testSteps, null, null, this.timer.Elapsed.Minutes.ToString() + " Mins");
            }
            catch (Exception ex)
            {
                ReportLibrary.logResult(ResultStatus.Fail, testSteps, ex.Message, appiumDriver, this.timer.Elapsed.Seconds.ToString() + " Seconds");
                throw ex;
            }
        }
Ejemplo n.º 8
0
        public void BeforeAll()
        {
            HTMLReportCleaner htmlCleaner = new HTMLReportCleaner();

            htmlCleaner.TSsetUp();

            string fixtureName = this.GetType().Name.ToString();

            FrameGlobals.Init();
            FrameGlobals.isNewFixture = true;
            HtmlAgilityPack.HtmlDocument doc = new HtmlAgilityPack.HtmlDocument();
            fileReport            = FileReader.GetFilePath(FilePath.Report);
            FrameGlobals.htmlPath = fileReport;
            doc.Load(FileReader.GetFilePath(FilePath.Report));
            //doc.Load(FrameGlobals.htmlPath);
            HtmlNode node      = doc.GetElementbyId("list");
            HtmlNode newAnchor = HtmlNode.CreateNode("<Span><a href=\"JavaScript:showDiv('" + fixtureName + "');\" ><h2 class=\"menu-font\">" + fixtureName + "</h2></a></span><br/>");

            node.AppendChild(newAnchor);

            doc.Save(FileReader.GetFilePath(FilePath.Report));
            ReportLibrary.WriteFixtureDivToRepoert(fixtureName);
        }