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?']", @"//*/android.widget.EditText[@text='What needs to be done?']", @"//*[@resource-id='new-todo']", @"//*[@resource-id='header']//*[@text='What needs to be done?']", @"//*[@resource-id='header']/*[2]", @"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" }; 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?']", @"//*/XCUIElementTypeTextField[@value='What needs to be done?']", @"", @"//*[@label='region']//*[@value='What needs to be done?']", @"//*[@label='region']/*[1]/*[1]", @"XCUIElementTypeWindow/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeTextField" }; contingencyXPathSelector = "XCUIElementTypeWindow/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeTextField"; } string[] selectorsType = new string[] { @"CrossPlatform", @"ElementType", @"IdentifyAttributes", @"AncestorAttributes", @"AncestorIndex", @"AbsolutePath" }; IWebElement e = _locator.FindElementByXPathInOrder(selectors, selectorsType); 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(); }
public void btnMaisTardeSendClick_Test() { ForceUpdateScreen(); Exec.Instance.AddEvent("btnMaisTarde"); string[] selectors = new string[0]; string contingencyXPathSelector = ""; if (ProjectConfig.PlataformName == "Android") { selectors = new string[] { @"//*[@text='Mais tarde' or @label='Mais tarde']", @"//*/android.widget.Button[@text='Mais tarde']", @"//*[@resource-id='android:id/button3']", @"//*[@resource-id='android:id/buttonPanel']//*[@text='Mais tarde']", @"//*[@resource-id='android:id/buttonPanel']/*[1]", @"hierarchy/android.widget.FrameLayout/android.widget.FrameLayout/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.LinearLayout[2]/android.widget.Button" }; 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[] { @"//*[@text='Mais tarde' or @label='Mais tarde']", @"//*/XCUIElementTypeButton[@label='Mais tarde']", @"//*[@name='Mais tarde']", @"//*[@label='Avalie o app']//*[@label='Mais tarde']", @"//*[@label='Avalie o app']/*[1]/*[2]/*[1]/*[3]/*[2]/*[1]", @"XCUIElementTypeWindow/XCUIElementTypeOther[2]/XCUIElementTypeAlert/XCUIElementTypeOther/XCUIElementTypeOther[2]/XCUIElementTypeOther/XCUIElementTypeCollectionView/XCUIElementTypeCell[2]/XCUIElementTypeButton" }; contingencyXPathSelector = "XCUIElementTypeWindow/XCUIElementTypeOther[2]/XCUIElementTypeAlert/XCUIElementTypeOther/XCUIElementTypeOther[2]/XCUIElementTypeOther/XCUIElementTypeCollectionView/XCUIElementTypeCell[2]/XCUIElementTypeButton"; } string[] selectorsType = new string[] { @"CrossPlatform", @"ElementType", @"IdentifyAttributes", @"AncestorAttributes", @"AncestorIndex", @"AbsolutePath" }; IWebElement e = _locator.FindElementByXPathInOrder(selectors, selectorsType); 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 btnMenuSendClick_Test() { ForceUpdateScreen(); Exec.Instance.AddEvent("btnMenu"); string[] selectors = new string[0]; string contingencyXPathSelector = ""; if (ProjectConfig.PlataformName == "Android") { selectors = new string[] { @"//*[@label='Movies']", @"", @"", @"//*[@resource-id='android:id/content']//*[]", @"//*[@resource-id='android:id/content']/*[1]/*[1]/*[1]/*[2]/*[1]/*[1]/*[1]/*[1]", @"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[] { @"//*[@label='Movies']", @"//*/XCUIElementTypeStaticText[@label='Movies']", @"//*[@name='Movies']", @"//*[@name='Movies']//*[@label='Movies']", @"//*[@name='Movies']/*[3]", @"XCUIElementTypeWindow/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeNavigationBar/XCUIElementTypeStaticText" }; contingencyXPathSelector = "XCUIElementTypeWindow/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeNavigationBar/XCUIElementTypeStaticText"; } string[] selectorsType = new string[] { @"CrossPlatform", @"ElementType", @"IdentifyAttributes", @"AncestorAttributes", @"AncestorIndex", @"AbsolutePath" }; IWebElement e = _locator.FindElementByXPathInOrder(selectors, selectorsType); 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 btnaddSendClick_Test() { ForceUpdateScreen(); Exec.Instance.AddEvent("btnadd"); string[] selectors = new string[0]; string contingencyXPathSelector = ""; if (ProjectConfig.PlataformName == "Android") { selectors = new string[] { @"//*[@text='Add Task' or @label='Add']", @"//*/android.widget.Button[@text='Add Task']", @"//*[@resource-id='com.xamarin.samples.taskyandroid:id/AddButton']", @"//*[@resource-id='android:id/content']//*[@text='Add Task']", @"//*[@resource-id='android:id/content']/*[1]/*[1]", @"hierarchy/android.widget.FrameLayout/android.view.ViewGroup/android.widget.FrameLayout[2]/android.widget.LinearLayout/android.widget.Button" }; 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[] { @"//*[@text='Add Task' or @label='Add']", @"//*/UIAButton[@label='Add']", @"//*[@name='Add']", @"//*[@name='Tasky']//*[@label='Add']", @"//*[@name='Tasky']/*[4]", @"AppiumAUT/UIAApplication/UIAWindow/UIANavigationBar/UIAButton[2]" }; contingencyXPathSelector = "AppiumAUT/UIAApplication/UIAWindow/UIANavigationBar/UIAButton[2]"; } string[] selectorsType = new string[] { @"CrossPlatform", @"ElementType", @"IdentifyAttributes", @"AncestorAttributes", @"AncestorIndex", @"AbsolutePath" }; IWebElement e = _locator.FindElementByXPathInOrder(selectors, selectorsType); 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 btnMenuSendClick_Test() { ForceUpdateScreen(); Exec.Instance.AddEvent("btnMenu"); string[] selectors = new string[0]; string contingencyXPathSelector = ""; if (ProjectConfig.PlataformName == "Android") { selectors = new string[] { @"//*[@content-desc='' or @label='']", @"//*/android.widget.Button[@content-desc='']", @"", @"//*[@content-desc='agenda']//*[@content-desc='']", @"//*[@content-desc='agenda']/*[1]/*[1]/*[1]/*[1]", @"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" }; 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[] { @"//*[@content-desc='' or @label='']", @"//*/XCUIElementTypeButton[@label='']", @"//*[@name='']", @"//*[@label='banner']//*[@label='']", @"//*[@label='banner']/*[1]", @"XCUIElementTypeWindow/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeButton" }; contingencyXPathSelector = "XCUIElementTypeWindow/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeButton"; } string[] selectorsType = new string[] { @"CrossPlatform", @"ElementType", @"IdentifyAttributes", @"AncestorAttributes", @"AncestorIndex", @"AbsolutePath" }; IWebElement e = _locator.FindElementByXPathInOrder(selectors, selectorsType); 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 btnnovoSendClick_Test() { ForceUpdateScreen(); Exec.Instance.AddEvent("btnnovo"); string[] selectors = new string[0]; string contingencyXPathSelector = ""; if (ProjectConfig.PlataformName == "Android") { selectors = new string[] { @"//*[@content-desc='Add' or @label='More']", @"//*/android.widget.TextView[@content-desc='Add']", @"", @"//*[@resource-id='android:id/content']//*[@content-desc='Add']", @"//*[@resource-id='android:id/content']/*[1]/*[1]/*[1]/*[1]/*[2]", @"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]" }; 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[] { @"//*[@content-desc='Add' or @label='More']", @"//*/UIAButton[@label='More']", @"//*[@name='More']", @"//*[@label='todo']//*[@label='More']", @"//*[@label='todo']/*[1]/*[4]/*[4]", @"AppiumAUT/UIAApplication/UIAWindow/UIATabBar/UIAButton[2]" }; contingencyXPathSelector = "AppiumAUT/UIAApplication/UIAWindow/UIATabBar/UIAButton[2]"; } string[] selectorsType = new string[] { @"CrossPlatform", @"ElementType", @"IdentifyAttributes", @"AncestorAttributes", @"AncestorIndex", @"AbsolutePath" }; IWebElement e = _locator.FindElementByXPathInOrder(selectors, selectorsType); 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[] { @"//*[@content-desc='De Brigadeiro apenas R$ 24' or @label='De Brigadeiro']", @"//*/android.view.View[@content-desc='De Brigadeiro apenas R$ 24']", @"", @"//*[@resource-id='android:id/content']//*[@content-desc='De Brigadeiro apenas R$ 24']", @"//*[@resource-id='android:id/content']/*[1]/*[1]/*[1]/*[3]/*[1]/*[1]/*[1]/*[1]/*[1]/*[1]", @"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" }; 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[] { @"//*[@content-desc='De Brigadeiro apenas R$ 24' or @label='De Brigadeiro']", @"//*/UIALink[@label='De Brigadeiro']", @"//*[@name='De Brigadeiro']", @"//*[@label='De Brigadeiro apenas R$ 24']//*[@label='De Brigadeiro']", @"//*[@label='De Brigadeiro apenas R$ 24']/*[2]", @"AppiumAUT/UIAApplication/UIAWindow/UIAScrollView[2]/UIAWebView/UIALink[3]/UIALink" }; contingencyXPathSelector = "AppiumAUT/UIAApplication/UIAWindow/UIAScrollView[2]/UIAWebView/UIALink[3]/UIALink"; } string[] selectorsType = new string[] { @"CrossPlatform", @"ElementType", @"IdentifyAttributes", @"AncestorAttributes", @"AncestorIndex", @"AbsolutePath" }; IWebElement e = _locator.FindElementByXPathInOrder(selectors, selectorsType); 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 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']", @"//*/android.widget.TextView[@text='Teste Empresa']", @"", @"//*[@resource-id='android:id/content']//*[@text='Teste Empresa']", @"//*[@resource-id='android:id/content']/*[1]/*[1]/*[1]/*[2]/*[1]/*[1]/*[1]/*[1]/*[1]/*[2]/*[1]/*[1]/*[1]/*[2]/*[1]/*[1]/*[1]", @"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" }; 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']", @"//*/UIAStaticText[@label='Teste Empresa']", @"//*[@name='Teste Empresa']", @"//*[@value='rows 1 to 2 of 2']//*[@label='Teste Empresa']", @"//*[@value='rows 1 to 2 of 2']/*[2]/*[1]/*[1]", @"AppiumAUT/UIAApplication/UIAWindow/UIATableView/UIATableCell[2]/UIAButton/UIAStaticText" }; contingencyXPathSelector = "AppiumAUT/UIAApplication/UIAWindow/UIATableView/UIATableCell[2]/UIAButton/UIAStaticText"; } string[] selectorsType = new string[] { @"CrossPlatform", @"ElementType", @"IdentifyAttributes", @"AncestorAttributes", @"AncestorIndex", @"AbsolutePath" }; IWebElement e = _locator.FindElementByXPathInOrder(selectors, selectorsType); 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 btnTopRatedSendClick_Test() { ForceUpdateScreen(); Exec.Instance.AddEvent("btnTopRated"); string[] selectors = new string[0]; string contingencyXPathSelector = ""; if (ProjectConfig.PlataformName == "Android") { selectors = new string[] { @"//*[@text='Top Rated' or @label=' Top Rated']", @"//*/android.widget.TextView[@text='Top Rated']", @"", @"//*[@resource-id='android:id/content']//*[@text='Top Rated']", @"//*[@resource-id='android:id/content']/*[1]/*[1]/*[1]/*[2]/*[1]/*[1]/*[1]/*[1]/*[6]/*[2]", @"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[] { @"//*[@text='Top Rated' or @label=' Top Rated']", @"//*/XCUIElementTypeOther[@label=' Top Rated']", @"//*[@name=' Top Rated']", @"//*[@label=' Now Playing Top Rated Upcoming']//*[@label=' Top Rated']", @"//*[@label=' Now Playing Top Rated Upcoming']/*[2]", @"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[] { @"CrossPlatform", @"ElementType", @"IdentifyAttributes", @"AncestorAttributes", @"AncestorIndex", @"AbsolutePath" }; IWebElement e = _locator.FindElementByXPathInOrder(selectors, selectorsType); 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(); }