Esempio n. 1
0
        public string TestCardActionsPresent(params string[] cardContent)
        {
            bool   buttonFound     = false;
            string buttonsNotFound = string.Empty;
            string action;

            for (int i = 0; i < cardContent.Length; i++)
            {
                action = cardContent[i];
                List <IWebElement> buttons = CardActions.FindElements(GetFindBy(LocatorTypes.CSS, "button"));

                foreach (IWebElement Button in buttons)
                {
                    if (Button.Text.Contains(action))
                    {
                        buttonFound = true;
                        break;
                    }
                }
                if (!buttonFound)
                {
                    if (buttonsNotFound == null)
                    {
                        buttonsNotFound = action;
                    }
                    else
                    {
                        buttonsNotFound = buttonsNotFound + ":" + action;
                    }
                }
            }

            return(buttonsNotFound);
        }
Esempio n. 2
0
        public bool CardActionClick(string buttonName)
        {
            bool buttonFound = false;

            CardActions.WaitTilDoneLoading();
            foreach (BRButton Button in CardActions.FindElements(GetFindBy(LocatorTypes.CSS, "button")))
            {
                if (Button.Text().Contains(buttonName))
                {
                    Button.WaitTilIsClickable();
                    Button.Click();
                    buttonFound = true;
                    break;
                }
            }
            if (buttonFound)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }