Пример #1
0
        public void IInsertValidBaseChoiceIntoElement(BaseChoiceType baseChoiceType, SelectorPathType selector, string path)
        {
            By elementBy = WebElementUtils.GetElementAsBy(selector, path);

            WaitUtils.elementState(_driverWait, elementBy, ElementState.EXISTS);

            switch (baseChoiceType)
            {
            case BaseChoiceType.INT:
                TypingUtils.TypeElement(_driver, elementBy, DataUtils.RandInt().ToString());
                break;

            case BaseChoiceType.DOUBLE:
                TypingUtils.TypeElement(_driver, elementBy, DataUtils.RandDouble().ToString());
                break;

            case BaseChoiceType.BOOL:
                TypingUtils.TypeElement(_driver, elementBy, DataUtils.RandBool().ToString());
                break;

            case BaseChoiceType.EMAIL:
                TypingUtils.TypeElement(_driver, elementBy, DataUtils.RandEmail());
                break;
            }
        }
Пример #2
0
        public void WhenEnterEnumFilterWithTheValueCreated(string enumColumnName)
        {
            if (_entityFactory == null)
            {
                throw new Exception("_entityFactory has not been instantiated");
            }

            string enumValue = _entityFactory.GetEnumValue(_createdEntityForTestFiltering, enumColumnName);

            TypingUtils.InputEntityAttributeByClass(_driver, $"filter-{enumColumnName}", enumValue, _isFastText);

            var builder = new Actions(_driver);

            builder.SendKeys(Keys.Enter).SendKeys(Keys.Escape).Perform();
            _genericEntityPage.ApplyFilterButton.Click();
        }
Пример #3
0
        public void IInsertValidStringBaseChoiceIntoElement(string baseChoiceType, int min, int max, SelectorPathType selector, string path)
        {
            var elementBy = WebElementUtils.GetElementAsBy(selector, path);

            WaitUtils.elementState(_driverWait, elementBy, ElementState.EXISTS);

            switch (baseChoiceType)
            {
            case "wordystring":
                TypingUtils.TypeElement(_driver, elementBy, DataUtils.RandString(min, max));
                break;

            case "string":
                TypingUtils.TypeElement(_driver, elementBy, DataUtils.RandString(min, max));
                break;
            }
        }
Пример #4
0
        public void TypeElementBy(string text, SelectorPathType selector, string path)
        {
            By elementBy = WebElementUtils.GetElementAsBy(selector, path);

            TypingUtils.TypeElement(_driver, elementBy, text);
        }