コード例 #1
0
        public void inserirTextoSendKeys_Test()
        {
            ForceUpdateScreen();
            Exec.Instance.AddEvent("inserirTexto");

            string[] selectors = new string[0];
            string   contingencyXPathSelector = "";

            if (ProjectConfig.PlataformName == "Android")
            {
                selectors = new string[] { @"//*[@text='What needs to be done?' or @value='What needs to be done?']" };
                contingencyXPathSelector = "hierarchy/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.webkit.WebView/android.webkit.WebView/android.view.View/android.view.View/android.widget.EditText";
            }
            else if (ProjectConfig.PlataformName == "iOS")
            {
                selectors = new string[] { @"//*[@text='What needs to be done?' or @value='What needs to be done?']" };
                contingencyXPathSelector = "XCUIElementTypeWindow/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeTextField";
            }

            string[] selectorsType = new string[] { @"CrossPlatform" };

            IWebElement e = _locator.FindElementByXPath(selectors[0], selectorsType[0]);

            if (e == null)
            {
                e = _locator.FindElementByContingencyXPath(contingencyXPathSelector);
                if (e != null)
                {
                    Exec.Instance.CurrentEvent.UsedContingencyXPathSelector = true;
                }
            }

            e.Click();
            e.Clear();
            e.SendKeys("Tarefa1");
            try
            {
                if (ProjectConfig.PlataformName == "Android")
                {
                    _driver.HideKeyboard();
                }
                else if (ProjectConfig.PlataformName == "iOS")
                {
                    _driver.FindElementByXPath("//*[@name='Hide keyboard']").Click();
                }
            }
            catch { }

            /*Insert your assert here*/

            Exec.Instance.CurrentEvent.EndSucessfull();
        }
コード例 #2
0
        public void btnMenuSendClick_Test()
        {
            ForceUpdateScreen();
            Exec.Instance.AddEvent("btnMenu");

            string[] selectors = new string[0];
            string   contingencyXPathSelector = "";

            if (ProjectConfig.PlataformName == "Android")
            {
                selectors = new string[] { @"hierarchy/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.RelativeLayout/android.support.v4.widget.DrawerLayout/android.widget.RelativeLayout/android.widget.RelativeLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.view.ViewGroup/android.widget.ImageButton" };
                contingencyXPathSelector = "hierarchy/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.RelativeLayout/android.support.v4.widget.DrawerLayout/android.widget.RelativeLayout/android.widget.RelativeLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.view.ViewGroup/android.widget.ImageButton";
            }
            else if (ProjectConfig.PlataformName == "iOS")
            {
                selectors = new string[] { @"XCUIElementTypeWindow/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeNavigationBar/XCUIElementTypeStaticText" };
                contingencyXPathSelector = "XCUIElementTypeWindow/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeNavigationBar/XCUIElementTypeStaticText";
            }

            string[] selectorsType = new string[] { @"AbsolutePath" };

            IWebElement e = _locator.FindElementByXPath(selectors[0], selectorsType[0]);

            if (e == null)
            {
                e = _locator.FindElementByContingencyXPath(contingencyXPathSelector);
                if (e != null)
                {
                    Exec.Instance.CurrentEvent.UsedContingencyXPathSelector = true;
                }
            }

            if (new int[] { 2 }.Contains(ProjectConfig.IndexDeviceUnderTest))
            {
            }
            else
            {
                e.Click();
            }

            /*Insert your assert here*/

            Exec.Instance.CurrentEvent.EndSucessfull();
        }
コード例 #3
0
        public void btnselSendClick_Test()
        {
            ForceUpdateScreen();
            Exec.Instance.AddEvent("btnsel");

            string[] selectors = new string[0];
            string   contingencyXPathSelector = "";

            if (ProjectConfig.PlataformName == "Android")
            {
                selectors = new string[] { @"//*[@text='Teste Empresa' or @label='Teste Empresa']" };
                contingencyXPathSelector = "hierarchy/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.RelativeLayout/android.view.ViewGroup/android.view.ViewGroup/android.view.ViewGroup[2]/android.view.ViewGroup/android.view.ViewGroup/android.view.ViewGroup/android.view.ViewGroup/android.widget.ListView/android.widget.LinearLayout[2]/android.view.ViewGroup/android.view.ViewGroup/android.view.ViewGroup/android.view.ViewGroup[2]/android.view.ViewGroup/android.view.ViewGroup/android.widget.TextView";
            }
            else if (ProjectConfig.PlataformName == "iOS")
            {
                selectors = new string[] { @"//*[@text='Teste Empresa' or @label='Teste Empresa']" };
                contingencyXPathSelector = "AppiumAUT/UIAApplication/UIAWindow/UIATableView/UIATableCell[2]/UIAButton/UIAStaticText";
            }

            string[] selectorsType = new string[] { @"CrossPlatform" };

            IWebElement e = _locator.FindElementByXPath(selectors[0], selectorsType[0]);

            if (e == null)
            {
                e = _locator.FindElementByContingencyXPath(contingencyXPathSelector);
                if (e != null)
                {
                    Exec.Instance.CurrentEvent.UsedContingencyXPathSelector = true;
                }
            }

            e.Click();

            /*Insert your assert here*/

            Exec.Instance.CurrentEvent.EndSucessfull();
        }
コード例 #4
0
        public void btnaddSendClick_Test()
        {
            ForceUpdateScreen();
            Exec.Instance.AddEvent("btnadd");

            string[] selectors = new string[0];
            string   contingencyXPathSelector = "";

            if (ProjectConfig.PlataformName == "Android")
            {
                selectors = new string[] { @"//*[@resource-id='com.xamarin.samples.taskyandroid:id/AddButton']" };
                contingencyXPathSelector = "hierarchy/android.widget.FrameLayout/android.view.ViewGroup/android.widget.FrameLayout[2]/android.widget.LinearLayout/android.widget.Button";
            }
            else if (ProjectConfig.PlataformName == "iOS")
            {
                selectors = new string[] { @"//*[@name='Add']" };
                contingencyXPathSelector = "AppiumAUT/UIAApplication/UIAWindow/UIANavigationBar/UIAButton[2]";
            }

            string[] selectorsType = new string[] { @"IdentifyAttributes" };

            IWebElement e = _locator.FindElementByXPath(selectors[0], selectorsType[0]);

            if (e == null)
            {
                e = _locator.FindElementByContingencyXPath(contingencyXPathSelector);
                if (e != null)
                {
                    Exec.Instance.CurrentEvent.UsedContingencyXPathSelector = true;
                }
            }

            e.Click();

            /*Insert your assert here*/

            Exec.Instance.CurrentEvent.EndSucessfull();
        }
コード例 #5
0
        public void btnsearchSendClick_Test()
        {
            ForceUpdateScreen();
            Exec.Instance.AddEvent("btnsearch");

            string[] selectors = new string[0];
            string   contingencyXPathSelector = "";

            if (ProjectConfig.PlataformName == "Android")
            {
                selectors = new string[] { @"//*[@resource-id='defaultView']/*[3]" };
                contingencyXPathSelector = "hierarchy/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.webkit.WebView/android.webkit.WebView/android.view.View/android.view.View/android.view.View[2]/android.view.View/android.view.View/android.view.View[3]";
            }
            else if (ProjectConfig.PlataformName == "iOS")
            {
                selectors = new string[] { @"//*[@label='Search For a Market']/*[1]" };
                contingencyXPathSelector = "AppiumAUT/UIAApplication/UIAWindow/UIAScrollView/UIAWebView/UIALink[2]/UIAStaticText";
            }

            string[] selectorsType = new string[] { @"AncestorIndex" };

            IWebElement e = _locator.FindElementByXPath(selectors[0], selectorsType[0]);

            if (e == null)
            {
                e = _locator.FindElementByContingencyXPath(contingencyXPathSelector);
                if (e != null)
                {
                    Exec.Instance.CurrentEvent.UsedContingencyXPathSelector = true;
                }
            }

            e.Click();

            /*Insert your assert here*/

            Exec.Instance.CurrentEvent.EndSucessfull();
        }
コード例 #6
0
        public void btnMaisTardeSendClick_Test()
        {
            ForceUpdateScreen();
            Exec.Instance.AddEvent("btnMaisTarde");

            string[] selectors = new string[0];
            string   contingencyXPathSelector = "";

            if (ProjectConfig.PlataformName == "Android")
            {
                selectors = new string[] { @"//*[@resource-id='android:id/buttonPanel']/*[1]" };
                contingencyXPathSelector = "hierarchy/android.widget.FrameLayout/android.widget.FrameLayout/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.LinearLayout[2]/android.widget.Button";
            }
            else if (ProjectConfig.PlataformName == "iOS")
            {
                selectors = new string[] { @"//*[@label='Avalie o app']/*[1]/*[2]/*[1]/*[3]/*[2]/*[1]" };
                contingencyXPathSelector = "XCUIElementTypeWindow/XCUIElementTypeOther[2]/XCUIElementTypeAlert/XCUIElementTypeOther/XCUIElementTypeOther[2]/XCUIElementTypeOther/XCUIElementTypeCollectionView/XCUIElementTypeCell[2]/XCUIElementTypeButton";
            }

            string[] selectorsType = new string[] { @"AncestorIndex" };

            IWebElement e = _locator.FindElementByXPath(selectors[0], selectorsType[0]);

            if (e == null)
            {
                e = _locator.FindElementByContingencyXPath(contingencyXPathSelector);
                if (e != null)
                {
                    Exec.Instance.CurrentEvent.UsedContingencyXPathSelector = true;
                }
            }

            e.Click();

            /*Insert your assert here*/

            Exec.Instance.CurrentEvent.EndSucessfull();
        }
コード例 #7
0
        public void btnMenuSendClick_Test()
        {
            ForceUpdateScreen();
            Exec.Instance.AddEvent("btnMenu");

            string[] selectors = new string[0];
            string   contingencyXPathSelector = "";

            if (ProjectConfig.PlataformName == "Android")
            {
                selectors = new string[] { @"//*/android.widget.Button[@content-desc='']" };
                contingencyXPathSelector = "hierarchy/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.webkit.WebView/android.webkit.WebView/android.view.View/android.view.View/android.view.View/android.widget.Button";
            }
            else if (ProjectConfig.PlataformName == "iOS")
            {
                selectors = new string[] { @"//*/XCUIElementTypeButton[@label='']" };
                contingencyXPathSelector = "XCUIElementTypeWindow/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeButton";
            }

            string[] selectorsType = new string[] { @"ElementType" };

            IWebElement e = _locator.FindElementByXPath(selectors[0], selectorsType[0]);

            if (e == null)
            {
                e = _locator.FindElementByContingencyXPath(contingencyXPathSelector);
                if (e != null)
                {
                    Exec.Instance.CurrentEvent.UsedContingencyXPathSelector = true;
                }
            }

            e.Click();

            /*Insert your assert here*/

            Exec.Instance.CurrentEvent.EndSucessfull();
        }
        public void selboloSendClick_Test()
        {
            ForceUpdateScreen();
            Exec.Instance.AddEvent("selbolo");

            string[] selectors = new string[0];
            string   contingencyXPathSelector = "";

            if (ProjectConfig.PlataformName == "Android")
            {
                selectors = new string[] { @"//*[@resource-id='android:id/content']//*[@content-desc='De Brigadeiro apenas R$ 24']" };
                contingencyXPathSelector = "hierarchy/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.webkit.WebView/android.webkit.WebView/android.view.View/android.view.View[3]/android.view.View/android.view.View/android.view.View/android.view.View/android.view.View/android.view.View";
            }
            else if (ProjectConfig.PlataformName == "iOS")
            {
                selectors = new string[] { @"//*[@label='De Brigadeiro apenas R$ 24']//*[@label='De Brigadeiro']" };
                contingencyXPathSelector = "AppiumAUT/UIAApplication/UIAWindow/UIAScrollView[2]/UIAWebView/UIALink[3]/UIALink";
            }

            string[] selectorsType = new string[] { @"AncestorAttributes" };

            IWebElement e = _locator.FindElementByXPath(selectors[0], selectorsType[0]);

            if (e == null)
            {
                e = _locator.FindElementByContingencyXPath(contingencyXPathSelector);
                if (e != null)
                {
                    Exec.Instance.CurrentEvent.UsedContingencyXPathSelector = true;
                }
            }

            e.Click();

            /*Insert your assert here*/

            Exec.Instance.CurrentEvent.EndSucessfull();
        }
コード例 #9
0
        public void btnnovoSendClick_Test()
        {
            ForceUpdateScreen();
            Exec.Instance.AddEvent("btnnovo");

            string[] selectors = new string[0];
            string   contingencyXPathSelector = "";

            if (ProjectConfig.PlataformName == "Android")
            {
                selectors = new string[] { @"" };
                contingencyXPathSelector = "hierarchy/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.FrameLayout/android.view.ViewGroup/android.view.ViewGroup/android.support.v7.widget.LinearLayoutCompat/android.widget.TextView[2]";
            }
            else if (ProjectConfig.PlataformName == "iOS")
            {
                selectors = new string[] { @"//*[@name='More']" };
                contingencyXPathSelector = "AppiumAUT/UIAApplication/UIAWindow/UIATabBar/UIAButton[2]";
            }

            string[] selectorsType = new string[] { @"IdentifyAttributes" };

            IWebElement e = _locator.FindElementByXPath(selectors[0], selectorsType[0]);

            if (e == null)
            {
                e = _locator.FindElementByContingencyXPath(contingencyXPathSelector);
                if (e != null)
                {
                    Exec.Instance.CurrentEvent.UsedContingencyXPathSelector = true;
                }
            }

            e.Click();

            /*Insert your assert here*/

            Exec.Instance.CurrentEvent.EndSucessfull();
        }
コード例 #10
0
        public void btnMenuSendClick_Test()
        {
            ForceUpdateScreen();
            Exec.Instance.AddEvent("btnMenu");

            string[] selectors = new string[0];
            string   contingencyXPathSelector = "";

            if (ProjectConfig.PlataformName == "Android")
            {
                selectors = new string[] { @"//*[@resource-id='android:id/content']//*[]" };
                contingencyXPathSelector = "hierarchy/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.RelativeLayout/android.support.v4.widget.DrawerLayout/android.widget.RelativeLayout/android.widget.RelativeLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.view.ViewGroup/android.widget.ImageButton";
            }
            else if (ProjectConfig.PlataformName == "iOS")
            {
                selectors = new string[] { @"//*[@name='Movies']//*[@label='Movies']" };
                contingencyXPathSelector = "XCUIElementTypeWindow/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeNavigationBar/XCUIElementTypeStaticText";
            }

            string[] selectorsType = new string[] { @"AncestorAttributes" };

            IWebElement e = _locator.FindElementByXPath(selectors[0], selectorsType[0]);

            if (e == null)
            {
                e = _locator.FindElementByContingencyXPath(contingencyXPathSelector);
                if (e != null)
                {
                    Exec.Instance.CurrentEvent.UsedContingencyXPathSelector = true;
                }
            }

            e.Click();

            /*Insert your assert here*/

            Exec.Instance.CurrentEvent.EndSucessfull();
        }
コード例 #11
0
        public void btnTopRatedSendClick_Test()
        {
            ForceUpdateScreen();
            Exec.Instance.AddEvent("btnTopRated");

            string[] selectors = new string[0];
            string   contingencyXPathSelector = "";

            if (ProjectConfig.PlataformName == "Android")
            {
                selectors = new string[] { @"hierarchy/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.RelativeLayout/android.support.v4.widget.DrawerLayout/android.widget.RelativeLayout/android.widget.RelativeLayout/android.widget.FrameLayout/android.view.ViewGroup/android.widget.ScrollView/android.view.ViewGroup/android.view.ViewGroup[4]/android.widget.TextView[2]" };
                contingencyXPathSelector = "hierarchy/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.RelativeLayout/android.support.v4.widget.DrawerLayout/android.widget.RelativeLayout/android.widget.RelativeLayout/android.widget.FrameLayout/android.view.ViewGroup/android.widget.ScrollView/android.view.ViewGroup/android.view.ViewGroup[4]/android.widget.TextView[2]";
            }
            else if (ProjectConfig.PlataformName == "iOS")
            {
                selectors = new string[] { @"XCUIElementTypeWindow/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeScrollView/XCUIElementTypeOther[2]/XCUIElementTypeOther[2]/XCUIElementTypeOther[3]/XCUIElementTypeOther[2]" };
                contingencyXPathSelector = "XCUIElementTypeWindow/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeScrollView/XCUIElementTypeOther[2]/XCUIElementTypeOther[2]/XCUIElementTypeOther[3]/XCUIElementTypeOther[2]";
            }

            string[] selectorsType = new string[] { @"AbsolutePath" };

            IWebElement e = _locator.FindElementByXPath(selectors[0], selectorsType[0]);

            if (e == null)
            {
                e = _locator.FindElementByContingencyXPath(contingencyXPathSelector);
                if (e != null)
                {
                    Exec.Instance.CurrentEvent.UsedContingencyXPathSelector = true;
                }
            }


            e.Click();

            /*Insert your assert here*/

            Exec.Instance.CurrentEvent.EndSucessfull();
        }
コード例 #12
0
        public void btnaddSendClick_Test()
        {
            ForceUpdateScreen();
            Exec.Instance.AddEvent("btnadd");

            string[] selectors = new string[0];
            string   contingencyXPathSelector = "";

            if (ProjectConfig.PlataformName == "Android")
            {
                selectors = new string[] { @"" };
                contingencyXPathSelector = "hierarchy/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.RelativeLayout/android.view.ViewGroup/android.view.ViewGroup/android.view.ViewGroup[2]/android.view.ViewGroup/android.view.ViewGroup/android.view.ViewGroup[2]/android.widget.FrameLayout/android.widget.ImageButton";
            }
            else if (ProjectConfig.PlataformName == "iOS")
            {
                selectors = new string[] { @"//*/UIAButton[@label='add']" };
                contingencyXPathSelector = "AppiumAUT/UIAApplication/UIAWindow/UIANavigationBar/UIAButton[2]";
            }

            string[] selectorsType = new string[] { @"ElementType" };

            IWebElement e = _locator.FindElementByXPath(selectors[0], selectorsType[0]);

            if (e == null)
            {
                e = _locator.FindElementByContingencyXPath(contingencyXPathSelector);
                if (e != null)
                {
                    Exec.Instance.CurrentEvent.UsedContingencyXPathSelector = true;
                }
            }

            e.Click();

            /*Insert your assert here*/

            Exec.Instance.CurrentEvent.EndSucessfull();
        }