Пример #1
0
        /// <summary>
        /// This method will Sign a User OUT of Facebook
        /// </summary>
        public void FacebookLogout()
        {
            // Access Menu
            TouchAction    touchAction = new TouchAction(driver);
            AndroidElement element     = driver.FindElementByXPath("//android.widget.ImageView[@content-desc='More options']");
            var            action      = touchAction.Tap(element);

            action.Perform();
            action.Cancel();
            Thread.Sleep(1000);

            // Tap Sign out
            element = driver.FindElementByXPath("//android.widget.TextView[@text='Sign Out']");
            action  = touchAction.Tap(element);
            action.Perform();
            action.Cancel();
            Thread.Sleep(1000);

            // Tap Yes
            element = driver.FindElementByXPath("//android.widget.Button[@text='YES']");
            action  = touchAction.Tap(element);
            action.Perform();
            action.Cancel();
            Thread.Sleep(1000);
        }
Пример #2
0
        public override void PerformStep()
        {
            TouchAction touch = new TouchAction(TestAppMain.Instance.Connector.Driver);

            touch.Tap(_tapCordinates.X, _tapCordinates.Y);
            touch.Perform();
        }
Пример #3
0
        public void TestThatSignOutButtonAppearsIfUserIsSignedIn()
        {
            FacebookLogin();

            Thread.Sleep(2000);
            // Access Menu
            TouchAction    touchAction = new TouchAction(driver);
            AndroidElement element     = driver.FindElementByXPath("//android.widget.ImageView[@content-desc='More options']");
            var            action      = touchAction.Tap(element);

            action.Perform();
            action.Cancel();

            Thread.Sleep(1000);

            // Find Sign in
            element = driver.FindElementByXPath("//android.widget.TextView[@text='Sign Out']");

            Thread.Sleep(1000);
            // Check If Sign Out Exists
            // Assert True
            Assert.IsTrue(element.Displayed);

            Thread.Sleep(1000);

            Assert.Throws <OpenQA.Selenium.NoSuchElementException>(() => element = driver.FindElementByXPath("//android.widget.TextView[@text='Sign In']"));
        }
Пример #4
0
        public void MultiActionTestCase()
        {
            IOSDriver <IWebElement> driver  = new IOSDriver <IWebElement>(defaultUri, capabilities);
            RequestProcessor        re      = setupMultiAction();
            IWebElement             element = driver.FindElementByIosUIAutomation(".elements()");

            MultiAction m = new MultiAction(driver);

            m.Perform();
            Assert.AreEqual(re.inputData, "");

            TouchAction a1 = new TouchAction(driver);

            a1
            .Press(element, 100, 100)
            .Wait(1000)
            .Release();
            m.Add(a1);
            m.Perform();
            Assert.AreEqual(re.inputData, "{\"actions\":[[{\"action\":\"press\",\"options\":{\"element\":\"5\",\"x\":100,\"y\":100}},{\"action\":\"wait\",\"options\":{\"ms\":1000}},{\"action\":\"release\"}]]}");

            TouchAction a2 = new TouchAction(driver);

            a2
            .Tap(100, 100)
            .MoveTo(element);
            m.Add(a2);
            m.Perform();
            Assert.AreEqual(re.inputData, "{\"actions\":[[{\"action\":\"press\",\"options\":{\"element\":\"5\",\"x\":100,\"y\":100}},{\"action\":\"wait\",\"options\":{\"ms\":1000}},{\"action\":\"release\"}],[{\"action\":\"tap\",\"options\":{\"x\":100,\"y\":100}},{\"action\":\"moveTo\",\"options\":{\"element\":\"5\"}}]]}");
        }
Пример #5
0
        /// <summary>
        /// This method will select "Great Western Pilsner" from the beverage select,
        /// and send you to the status screen.
        /// </summary>
        private void SelectBeverage()
        {
            TouchAction touchAction = new TouchAction(driver);

            Thread.Sleep(500);

            //AndroidElement element = driver.FindElementByAndroidUIAutomator("new UiSelector().textContains(\"Please enter a beverage, type or brand!!\");");
            AndroidElement element = driver.FindElementByClassName("android.widget.EditText");

            element.SendKeys("Great");

            Thread.Sleep(500);

            //element = driver.FindElementByAndroidUIAutomator("new UiSelector().textContains(\"Great Western Pilsner\");");
            element = driver.FindElementByXPath("//android.widget.TextView[@text='Great Western Pilsner']");

            Thread.Sleep(500);

            var action = touchAction.Tap(element);

            action.Perform();
            action.Cancel();

            Thread.Sleep(500);
        }
        public void CheckMasterDetailAndBack()
        {
            driver.LaunchApp();
            // tap on second item
            var el1 = driver.FindElementByAccessibilityId("Second item");

            TouchAction a = new TouchAction(driver);

            a.Tap(el1);


            var el2 = driver.FindElementByAccessibilityId("ItemText");

            Assert.IsTrue(el2.Text == "Second item");

            var backButton = driver.FindElementByAccessibilityId("Back");

            backButton.Click();

            var el3 = driver.FindElementByAccessibilityId("Fourth item");

            Assert.IsTrue(el3 != null);

            driver.CloseApp();
        }
Пример #7
0
        public void Execute(Arguments arguments)
        {
            arguments.Search.Value = "/ hierarchy / android.widget.FrameLayout / android.widget.LinearLayout / android.widget.FrameLayout / android.widget.FrameLayout / android.widget.FrameLayout / android.view.ViewGroup / android.widget.LinearLayout / android.view.ViewGroup[2] / android.widget.ImageView";
            arguments.By.Value     = "xpath";
            var by = arguments.By.Value.ToLower();


            if (by == "xy")
            {
                TouchAction clickAction = new TouchAction(OpenCommand.GetDriver());
                var         coordinates = arguments.Search.Value.Split(',');
                clickAction.Tap(int.Parse(coordinates[0]), int.Parse(coordinates[1])).Perform();
            }
            else
            {
                ElementHelper.GetElement(arguments.By.Value.ToLower(), arguments.Search.Value).Click();
                arguments.Search.Value = "com.viber.voip:id / menu_add_contact";
                arguments.By.Value     = "id";
                ElementHelper.GetElement(arguments.By.Value.ToLower(), arguments.Search.Value).Click();
                arguments.Search.Value = "/ hierarchy / android.widget.FrameLayout / android.widget.LinearLayout / android.widget.FrameLayout / android.view.ViewGroup / android.widget.FrameLayout[2] / android.widget.ScrollView / android.widget.RelativeLayout / android.widget.EditText";
                arguments.By.Value     = "xpath";
                ElementHelper.GetElement(arguments.By.Value.ToLower(), arguments.Search.Value).Click();
                ElementHelper.GetElement(arguments.By.Value, arguments.Search.Value).SendKeys(arguments.number.Value);
                arguments.Search.Value = "/hierarchy/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.view.ViewGroup/android.widget.FrameLayout[2]/android.widget.ScrollView/android.widget.RelativeLayout/android.widget.Button[1]";
                arguments.By.Value     = "xpath";
                ElementHelper.GetElement(arguments.By.Value.ToLower(), arguments.Search.Value).Click();
                arguments.Search.Value = "/hierarchy/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.view.ViewGroup/android.widget.FrameLayout[2]/android.widget.ScrollView/android.widget.LinearLayout/android.widget.LinearLayout/android.widget.RelativeLayout[1]/android.widget.EditText";
                arguments.By.Value     = "xpath";
                ElementHelper.GetElement(arguments.By.Value.ToLower(), arguments.Search.Value).Click();
                ElementHelper.GetElement(arguments.By.Value, arguments.Search.Value).SendKeys(arguments.name.Value);
                arguments.Search.Value = "com.viber.voip:id / menu_done";
                arguments.By.Value     = "id";
                ElementHelper.GetElement(arguments.By.Value.ToLower(), arguments.Search.Value).Click();
            }
        }
Пример #8
0
        public void Execute(Arguments arguments)
        {
            arguments.Search.Value = "/html/body/div/div/div[2]/div[2]/div/div[3]/div[1]/div[2]/div[2]/div/div[2]/div/div[2]/div/div/div/div/div/div/table/tbody/tr/td[2]/div";
            arguments.By.Value     = "xpath";
            var by = arguments.By.Value.ToLower();

            if (by == "xy")
            {
                TouchAction clickAction = new TouchAction(OpenCommand.GetDriver());
                var         coordinates = arguments.Search.Value.Split(',');
                clickAction.Tap(int.Parse(coordinates[0]), int.Parse(coordinates[1])).Perform();
            }
            else
            {
                ElementHelper.GetElement(arguments.By.Value.ToLower(), arguments.Search.Value).Click();
                arguments.Search.Value = "/ hierarchy / android.widget.FrameLayout / android.widget.LinearLayout / android.widget.FrameLayout / android.widget.FrameLayout / android.widget.FrameLayout / android.widget.FrameLayout / android.widget.FrameLayout / android.widget.FrameLayout / android.widget.FrameLayout / android.widget.LinearLayout / android.widget.FrameLayout / android.widget.EditText";
                arguments.By.Value     = "xpath";
                ElementHelper.GetElement(arguments.By.Value.ToLower(), arguments.Search.Value).Click();
                ElementHelper.GetElement(arguments.By.Value, arguments.Search.Value).SendKeys(arguments.search.Value);
                arguments.Search.Value = "/ hierarchy / android.widget.FrameLayout / android.widget.LinearLayout / android.widget.FrameLayout / android.widget.FrameLayout / android.widget.FrameLayout / android.widget.FrameLayout / android.widget.FrameLayout / android.widget.FrameLayout / androidx.recyclerview.widget.RecyclerView / android.view.ViewGroup[1]";
                arguments.By.Value     = "xpath";
                ElementHelper.GetElement(arguments.By.Value.ToLower(), arguments.Search.Value).Click();
                arguments.Search.Value = "/html/body/div/div/div[2]/div[2]/div/div[3]/div[1]/div[2]/div[2]/div/div[2]/div/div[2]/div/div/div/div/div/div/table/tbody/tr[2]/td[2]/div";
                arguments.By.Value     = "xpath";
                ElementHelper.GetElement(arguments.By.Value.ToLower(), arguments.Search.Value).Click();
                ElementHelper.GetElement(arguments.By.Value, arguments.Search.Value).SendKeys(arguments.type.Value);
            }
        }
Пример #9
0
        public void Execute(Arguments arguments)
        {
            arguments.Search.Value = "/hierarchy/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.FrameLayout/android.widget.FrameLayout/android.widget.FrameLayout[3]/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout[1]";
            arguments.By.Value = "xpath";
            var by = arguments.By.Value.ToLower();


            if (by == "xy")
            {
                TouchAction clickAction = new TouchAction(OpenCommand.GetDriver());
                var coordinates = arguments.Search.Value.Split(',');
                clickAction.Tap(int.Parse(coordinates[0]), int.Parse(coordinates[1])).Perform();
            }
            else
            {
                ElementHelper.GetElement(arguments.By.Value.ToLower(), arguments.Search.Value).Click();
                arguments.Search.Value = "/hierarchy/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.FrameLayout/android.widget.FrameLayout/android.widget.FrameLayout[2]/android.widget.FrameLayout[2]/android.widget.FrameLayout/android.widget.FrameLayout/android.widget.LinearLayout[2]/android.widget.TextView";
                arguments.By.Value = "xpath";
                ElementHelper.GetElement(arguments.By.Value.ToLower(), arguments.Search.Value).Click();
                ElementHelper.GetElement(arguments.By.Value, arguments.Search.Value).SendKeys(arguments.search.Value);
                arguments.Search.Value = "/hierarchy/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.FrameLayout/android.widget.FrameLayout/android.widget.FrameLayout[1]/android.widget.FrameLayout/android.view.ViewGroup/android.view.ViewGroup[4]/android.view.ViewGroup/android.view.ViewGroup/android.view.ViewGroup[2]/android.view.ViewGroup/android.view.ViewGroup";
                arguments.By.Value = "xpath";
                ElementHelper.GetElement(arguments.By.Value.ToLower(), arguments.Search.Value).Click();
                arguments.Search.Value = "/hierarchy/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.FrameLayout/android.widget.FrameLayout/android.widget.FrameLayout[1]/android.widget.RelativeLayout/android.widget.LinearLayout[2]/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.EditText";
                arguments.By.Value = "xpath";
                ElementHelper.GetElement(arguments.By.Value.ToLower(), arguments.Search.Value).Click();
                ElementHelper.GetElement(arguments.By.Value, arguments.Search.Value).SendKeys(arguments.search.Value);
               

            }
        }
Пример #10
0
        public void Execute(Arguments arguments)
        {
            arguments.Search.Value = "com.snapchat.android:id / login_button_horizontal";
            arguments.By.Value     = "id";
            var by = arguments.By.Value.ToLower();


            if (by == "xy")
            {
                TouchAction clickAction = new TouchAction(OpenCommand.GetDriver());
                var         coordinates = arguments.Search.Value.Split(',');
                clickAction.Tap(int.Parse(coordinates[0]), int.Parse(coordinates[1])).Perform();
            }
            else
            {
                ElementHelper.GetElement(arguments.By.Value.ToLower(), arguments.Search.Value).Click();
                arguments.Search.Value = "/hierarchy/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.FrameLayout/android.widget.FrameLayout/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout[1]/android.widget.ScrollView/android.widget.LinearLayout/android.widget.EditText";
                arguments.By.Value     = "xpath";
                ElementHelper.GetElement(arguments.By.Value.ToLower(), arguments.Search.Value).Click();
                ElementHelper.GetElement(arguments.By.Value, arguments.Search.Value).SendKeys(arguments.email.Value);
                arguments.Search.Value = "/hierarchy/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.FrameLayout/android.widget.FrameLayout/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout[1]/android.widget.ScrollView/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.EditText";
                arguments.By.Value     = "xpath";
                ElementHelper.GetElement(arguments.By.Value.ToLower(), arguments.Search.Value).Click();
                ElementHelper.GetElement(arguments.By.Value, arguments.Search.Value).SendKeys(arguments.pword.Value);
                arguments.Search.Value = "/hierarchy/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.FrameLayout/android.widget.FrameLayout/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout[2]/android.widget.LinearLayout/android.widget.TextView";
                arguments.By.Value     = "xpath";
                ElementHelper.GetElement(arguments.By.Value.ToLower(), arguments.Search.Value).Click();
            }
        }
Пример #11
0
        public void TestThatUserCanSignInOnSelectScreenAndOutOnStatusScreen()
        {
            FacebookLogin();

            Thread.Sleep(4000);

            SelectBeverage();

            FacebookLogout();

            // The search bar only Beverage Select screen
            AndroidElement element = driver.FindElementByAccessibilityId("StatusPage");

            // If the element is displayed, we are on the Beverage Select screen
            Assert.IsTrue(element.Displayed);

            // Access Menu
            TouchAction touchAction = new TouchAction(driver);

            element = driver.FindElementByXPath("//android.widget.ImageView[@content-desc='More options']");
            var action = touchAction.Tap(element);

            action.Perform();
            action.Cancel();
            Thread.Sleep(1000);

            // Find Sign in
            element = driver.FindElementByXPath("//android.widget.TextView[@text='Sign In']");
        }
Пример #12
0
 private void thaTimBtn_Click(object sender, EventArgs e)
 {
     thaTimBtn.Enabled  = false;
     commentBtn.Enabled = false;
     if (string.IsNullOrEmpty(thoigianthatim.Text))
     {
         MessageBox.Show("vui lòng nhập thời gian thả tim !", "Cảnh báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
     else
     {
         var thoigianthatims = int.Parse(thoigianthatim.Text);
         foreach (var driver in androidDrivers)
         {
             TouchAction actions = new TouchAction(driver);
             for (int i = 0; i < thoigianthatims; i++)
             {
                 actions.Tap(500, 500);
                 actions.Perform();
                 Thread.Sleep(500);
             }
         }
     }
     thaTimBtn.Enabled  = true;
     commentBtn.Enabled = true;
 }
Пример #13
0
        // Verify Transfer Screen
        public void Case106365()
        {
            // Start Report
            this.test = this.extent.StartTest("CASE_106365");
            this.Login();

            var touchTransfer = new TouchAction(this.Driver);

            touchTransfer.Tap(85, 680).Perform();

            var wait = new WebDriverWait(this.Driver, TimeSpan.FromMinutes(1));

            wait.Until(ExpectedConditions.VisibilityOfAllElementsLocatedBy(By.Name("Transfer Between My Eastern Bank Accounts")));

            var betweenEasternAccountsButton = (RemoteWebElement) new WebDriverWait(this.Driver, TimeSpan.FromMinutes(1)).Until(
                ExpectedConditions.ElementExists(By.XPath("//XCUIElementTypeButton[contains(@name,'Transfer Between My Eastern Bank Accounts')]")));

            Assert.AreEqual(true, betweenEasternAccountsButton.Displayed);

            var transferAccountsAtOtherBank = (RemoteWebElement) new WebDriverWait(this.Driver, TimeSpan.FromMinutes(1)).Until(
                ExpectedConditions.ElementExists(By.XPath("//XCUIElementTypeButton[contains(@name,'Transfer To My Accounts at Other Banks')]")));

            Assert.AreEqual(true, transferAccountsAtOtherBank.Displayed);

            var transferToAnotherAccount = (RemoteWebElement) new WebDriverWait(this.Driver, TimeSpan.FromMinutes(1)).Until(
                ExpectedConditions.ElementExists(By.XPath("//XCUIElementTypeButton[contains(@name,'Transfer To Another Person')]")));

            Assert.AreEqual(true, transferToAnotherAccount.Displayed);

            var viewScheduledTransfers = (RemoteWebElement) new WebDriverWait(this.Driver, TimeSpan.FromMinutes(1)).Until(
                ExpectedConditions.ElementExists(By.XPath("//XCUIElementTypeButton[contains(@name,'View/Manage Scheduled Transfers')]")));

            Assert.AreEqual(true, viewScheduledTransfers.Displayed);
        }
Пример #14
0
        public void TapTest()
        {
            ITouchAction touchAction = new TouchAction(_driver);
            var          element     = _driver.FindElementById("android:id/content");
            Point        point       = element.Coordinates.LocationInDom;

            touchAction.Tap(point.X, point.Y, 2).Perform();
        }
Пример #15
0
        private void WriteMessage(string text)
        {
            var textField = _driver.FindElementByAndroidUIAutomator($"new UiSelector().textContains(\"Enter answer\")");

            textField.Click();
            _driver.Keyboard.SendKeys(text);
            var touchSend = new TouchAction(_driver);

            touchSend.Tap(_size.Width - 15, _size.Height - 100).Perform();
        }
Пример #16
0
        // Confirm You Can Do an Advance from a commercial loc in both online and mobile.
        // ***************************************************************************
        public void Case106411()
        {
            this.Login();

            var touchTransfer = new TouchAction(this.Driver);

            touchTransfer.Tap(85, 680).Perform();

            var wait = new WebDriverWait(this.Driver, TimeSpan.FromMinutes(1));

            wait.Until(ExpectedConditions.VisibilityOfAllElementsLocatedBy(By.Name("Transfer Between My Eastern Bank Accounts")));
        }
Пример #17
0
        public void CheckTap(IPerformsTouchActions performer)
        {
            var t = new TouchAction(performer);

            t.Tap(_accessibility);
            t.Perform();

            var m = new MultiAction(performer);

            m.Add(new TouchAction(performer).Tap(_customView));
            m.Add(new TouchAction(performer).Tap(_clickable));
            m.Perform();
        }
        public void CheckTap(IPerformsTouchActions performer)
        {
            TouchAction t = new TouchAction(performer);

            t.Tap(accessibility);
            t.Perform();

            MultiAction m = new MultiAction(performer);

            m.Add(new TouchAction().Tap(customView));
            m.Add(new TouchAction(performer).Tap(clickable));
            m.Perform();
        }
Пример #19
0
        /// <summary>
        /// This method will sign a user IN to google
        /// </summary>
        public void GoogleLogin()
        {
            // Access Menu
            TouchAction    touchAction = new TouchAction(driver);
            AndroidElement element     = driver.FindElementByXPath("//android.widget.ImageView[@content-desc='More options']");
            var            action      = touchAction.Tap(element);

            action.Perform();
            action.Cancel();
            Thread.Sleep(2000);

            // Tap Sign in
            element = driver.FindElementByXPath("//android.widget.TextView[@text='Sign In']");
            action  = touchAction.Tap(element);
            action.Perform();
            action.Cancel();
            Thread.Sleep(2000);

            // Tap Google
            element = driver.FindElementByXPath("//android.widget.Button[@text='GOOGLE']");
            action  = touchAction.Tap(element);
            action.Perform();
            action.Cancel();
            Thread.Sleep(6000);

            // Find all the ListViews On The Page
            var elements = driver.FindElementsByClassName("//android.widget.LinearLayout[@resource-id='com.google.android.gms:id/container']");

            //var elements = driver.FindElementsByClassName("android.widget.ListView");

            // The first List View Element is The Button We Want To Tap
            element = elements.ElementAt(0);
            // So I'm Gonna Tap It.
            action = touchAction.Tap(element);
            action.Perform();
            action.Cancel();
            Thread.Sleep(2000);
        }
        public void SimpleTouchActionTestCase()
        {
            IList <AppiumWebElement> els = driver.FindElementsByClassName("android.widget.TextView");

            int number1 = els.Count;

            TouchAction tap = new TouchAction(driver);

            tap.Tap(els[4], 10, 5, 2).Perform();

            els = driver.FindElementsByClassName("android.widget.TextView");

            Assert.AreNotEqual(number1, els.Count);
        }
Пример #21
0
        public void MultiActionTestCase()
        {
            IWebElement  el = driver.FindElementByAccessibilityId("ComputeSumButton");
            ITouchAction a1 = new TouchAction(driver);

            a1.Tap(el, 10, 10);
            ITouchAction a2 = new TouchAction(driver);

            a2.Tap(el);
            IMultiAction m = new MultiAction(driver);

            m.Add(a1).Add(a2);
            m.Perform();
        }
        public void ProfileImageCamera(String ProfileImage, String Camera)
        {
            _driver.FindElementByXPath(ProfileImage).Click();
            _driver.FindElementByXPath(Camera).Click();
            _driver.PressKeyCode(AndroidKeyCode.Keycode_CAMERA);

            Dimension = _driver.Manage().Window.Size;
            int StartPosition = Convert.ToInt32(Dimension.Width * 0.50);
            int EndPosition   = Convert.ToInt32(Dimension.Height * 0.143);

            ITouchAction ITouchAction = new TouchAction(_driver);

            ITouchAction.Tap(StartPosition, EndPosition).Perform();
        }
Пример #23
0
        public void OpedSideMenuWithButtonTest()
        {
            int duration = 1000;

            AndroidElement menuButton = driver.FindElementById("com.alibaba.aliexpresshd:id/left_action");

            menuButton.Click();
            wait.Until(ExpectedConditions.ElementExists(By.Id("com.alibaba.aliexpresshd:id/navdrawer_items_list")));

            TouchAction action = new TouchAction(driver);

            action.Tap(719, 400).Perform();
            wait.Until(ExpectedConditions.InvisibilityOfElementLocated(By.Id("com.alibaba.aliexpresshd:id/navdrawer_items_list")));
        }
Пример #24
0
        // Verify Edit Transfer
        // ***************************************************************************
        public void Case106395()
        {
            this.test = this.extent.StartTest("CASE_106395");
            this.Login();

            var touchTransfer = new TouchAction(this.Driver);

            touchTransfer.Tap(85, 680).Perform();

            var wait = new WebDriverWait(this.Driver, TimeSpan.FromMinutes(1));

            wait.Until(ExpectedConditions.VisibilityOfAllElementsLocatedBy(By.Name("Transfer Between My Eastern Bank Accounts")));

            var viewManageScheduledTransfers = (RemoteWebElement) new WebDriverWait(this.Driver, TimeSpan.FromMinutes(1)).Until(
                ExpectedConditions.ElementExists(By.XPath("//XCUIElementTypeButton[contains(@name,'View/Manage Scheduled Transfers')]")));

            viewManageScheduledTransfers.Click();

            var ScheduledTransfers_Title = (RemoteWebElement) new WebDriverWait(this.Driver, TimeSpan.FromMinutes(1)).Until(
                ExpectedConditions.ElementExists(By.Name("Scheduled Transfers")));

            Assert.AreEqual(true, ScheduledTransfers_Title.Displayed);


            var EditDelete = (RemoteWebElement) new WebDriverWait(this.Driver, TimeSpan.FromMinutes(1)).Until(
                ExpectedConditions.ElementExists(By.XPath("//XCUIElementTypeButton[contains(@name,'Recurring Weekly')]")));

            EditDelete.Click();

            var Edit = (RemoteWebElement) new WebDriverWait(this.Driver, TimeSpan.FromMinutes(1)).Until(
                ExpectedConditions.ElementExists(By.Name("Edit")));

            Edit.Click();

            var amountInput = (RemoteWebElement) new WebDriverWait(this.Driver, TimeSpan.FromMinutes(1)).Until(
                ExpectedConditions.ElementExists(By.XPath("//XCUIElementTypeButton[contains(@name,'Enter Amount')]")));

            amountInput.SendKeys("100");
            this.Driver.HideKeyboard();

            var Save = (RemoteWebElement) new WebDriverWait(this.Driver, TimeSpan.FromMinutes(1)).Until(
                ExpectedConditions.ElementExists(By.Name("Save")));

            Save.Click();

            var TransferSuccessfullyUpdated = (RemoteWebElement) new WebDriverWait(this.Driver, TimeSpan.FromMinutes(1)).Until(
                ExpectedConditions.ElementExists(By.Name("Transfer Successfully Updated")));

            Assert.AreEqual(true, TransferSuccessfullyUpdated.Displayed);
        }
        public void Execute(Arguments arguments)
        {
            var by = arguments.By.Value.ToLower();

            if (by == "xy")
            {
                TouchAction clickAction = new TouchAction(OpenCommand.GetDriver());
                var         coordinates = arguments.Search.Value.Split(',');
                clickAction.Tap(int.Parse(coordinates[0]), int.Parse(coordinates[1])).Perform();
            }
            else
            {
                ElementHelper.GetElement(by, arguments.Search.Value).Click();
            }
        }
Пример #26
0
        public void TestMethod1()
        {
            driver.LaunchApp();
            var         el1 = driver.FindElementByXPath("/hierarchy/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.FrameLayout/android.widget.FrameLayout/android.widget.RelativeLayout/android.view.ViewGroup/android.support.v4.widget.DrawerLayout/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout[1]/android.view.ViewGroup/android.support.v4.view.ViewPager/android.view.ViewGroup/android.view.ViewGroup/android.view.ViewGroup/android.support.v7.widget.RecyclerView/android.view.ViewGroup[4]/android.view.ViewGroup/android.widget.FrameLayout");
            TouchAction a   = new TouchAction(driver);

            a.Tap(el1);

            el1.Click();
            var el2 = driver.FindElementByXPath("/hierarchy/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.FrameLayout/android.widget.FrameLayout/android.widget.RelativeLayout/android.view.ViewGroup/android.support.v4.widget.DrawerLayout/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout[1]/android.view.ViewGroup/android.view.ViewGroup/android.view.ViewGroup/android.widget.ScrollView/android.view.ViewGroup/android.view.ViewGroup/android.widget.FrameLayout[2]");


            Assert.IsTrue(el2.Text.Contains("will"));

            driver.CloseApp();
        }
        public void AddNewItem()
        {
            var driver = StartApp();
            // tap on second item
            var         el1 = driver.FindElementByAccessibilityId("Add");
            TouchAction a   = new TouchAction(driver);

            a.Tap(el1);
            el1.Click();
            var elItemText = driver.FindElementByAccessibilityId("ItemText");

            elItemText.Clear();
            elItemText.SendKeys("This is a new Item");

            var elItemDetail = driver.FindElementByAccessibilityId("ItemDescription");

            elItemDetail.Clear();
            elItemDetail.SendKeys("These are the details");

            var elSave = driver.FindElementByAccessibilityId("Save");

            elSave.Click();

            WaitForProgressbarToDisapear(driver);

            var     touchScreen = new RemoteTouchScreen(driver);
            Boolean found       = false;
            var     maxretries  = 5;
            int     count       = 0;

            while (!found && count++ < maxretries)
            {
                // Good value typically goes around 160 - 200 pixels with diminishing delta on the bigger values
                touchScreen.Flick(0, 180);
                try
                {
                    var el3 = driver.FindElementByName("This is a new Item");
                    found = el3 != null;
                }
                catch (Exception)
                { }
            }
            Assert.IsTrue(found);


            driver.CloseApp();
        }
Пример #28
0
        // Verify Zelle Dashboard for enrolled users in QA/Staging
        // ***************************************************************************
        public void Case106406()
        {
            this.Login();

            var touchTransfer = new TouchAction(this.Driver);

            touchTransfer.Tap(85, 680).Perform();

            var wait = new WebDriverWait(this.Driver, TimeSpan.FromMinutes(1));

            wait.Until(ExpectedConditions.VisibilityOfAllElementsLocatedBy(By.Name("Transfer Between My Eastern Bank Accounts")));

            var viewManageScheduledTransfers = (RemoteWebElement) new WebDriverWait(this.Driver, TimeSpan.FromMinutes(1)).Until(
                ExpectedConditions.ElementExists(By.XPath("//XCUIElementTypeButton[contains(@name,'View/Manage Scheduled Transfers')]")));

            viewManageScheduledTransfers.Click();
        }
Пример #29
0
        public void Execute(Arguments arguments)
        {
            arguments.Search.Value = "/ hierarchy / android.widget.FrameLayout / android.widget.LinearLayout / android.widget.FrameLayout / android.widget.FrameLayout / android.widget.FrameLayout / androidx.drawerlayout.widget.DrawerLayout / android.view.ViewGroup / android.widget.FrameLayout / android.view.ViewGroup / android.widget.LinearLayout / android.widget.FrameLayout[3]";
            arguments.By.Value     = "xpath";
            var by = arguments.By.Value.ToLower();

            if (by == "xy")
            {
                TouchAction clickAction = new TouchAction(OpenCommand.GetDriver());
                var         coordinates = arguments.Search.Value.Split(',');
                clickAction.Tap(int.Parse(coordinates[0]), int.Parse(coordinates[1])).Perform();
            }
            else
            {
                ElementHelper.GetElement(by, arguments.Search.Value).Click();
            }
        }
Пример #30
0
        public void Execute(Arguments arguments)
        {
            arguments.Search.Value = "com.tumblr:id/topnav_account_button_img_active";
            arguments.By.Value     = "id";
            var by = arguments.By.Value.ToLower();

            if (by == "xy")
            {
                TouchAction clickAction = new TouchAction(OpenCommand.GetDriver());
                var         coordinates = arguments.Search.Value.Split(',');
                clickAction.Tap(int.Parse(coordinates[0]), int.Parse(coordinates[1])).Perform();
            }
            else
            {
                ElementHelper.GetElement(by, arguments.Search.Value).Click();
            }
        }