Ejemplo n.º 1
0
        public void ShouldAddClassToList()
        {
            VisualElement ve = new VisualElement();

            ElementInteractions.SetDefaultStyle(ve);
            Assert.IsTrue(ve.ClassListContains(UxmlClassNames.DefaultStyle));
        }
        public void WhenFalse_ShouldAddClass()
        {
            VisualElement listElement = new VisualElement();

            ElementInteractions.SetAddSectionVisibility(listElement, false);
            Assert.IsTrue(listElement.ClassListContains(UxmlClassNames.HideAddSection));
        }
Ejemplo n.º 3
0
        public void ShouldAddIntField()
        {
            VisualElement root = new VisualElement();

            ElementInteractions.InsertHiddenIntFieldWithPropertyPathSet(root, "");
            Assert.IsNotNull(root.Q <IntegerField>());
        }
Ejemplo n.º 4
0
        public void ShouldSetPath()
        {
            VisualElement root = new VisualElement();

            ElementInteractions.InsertHiddenIntFieldWithPropertyPathSet(root, "test");
            Assert.AreEqual("test", root.Q <IntegerField>().bindingPath);
        }
Ejemplo n.º 5
0
        public void ShouldNotBeVisible()
        {
            VisualElement root = new VisualElement();

            ElementInteractions.InsertHiddenIntFieldWithPropertyPathSet(root, "test");
            Assert.AreEqual(DisplayStyle.None, root.Q <IntegerField>().style.display.value);
        }
        public void WhenTrue_ShouldSetEnabledTrue()
        {
            VisualElement element = new VisualElement();

            ElementInteractions.SetStateBasedOnOption(element, true);

            Assert.IsTrue(element.enabledSelf);
        }
        public void WhenFalse_ShouldSetEnabledFalse()
        {
            VisualElement element = new VisualElement();

            ElementInteractions.SetStateBasedOnOption(element, false);

            Assert.IsFalse(element.enabledSelf);
        }
        public void OnReset(ListResetEvent evt)
        {
            rowEventRaisers.Clear();

            if (evt.target is ListElement listElement)
            {
                PopulateList(listElement);
                ElementInteractions.SetButtonStateBasedOnZeroIndex(
                    listElement.Controls.ClearList, listElement.SerializedProperty.arraySize);
            }
        }
 public void OnRowInserted(RowInsertedEvent evt)
 {
     rowEventRaisers.AddRange(CreateRaiserDefinitionsForRow(evt.Buttons, evt.Index));
     ElementInteractions.SetButtonStateBasedOnZeroIndex(evt.Buttons.MoveUp, evt.Index);
     ElementInteractions.SetButtonStateBasedOnBeingLastPositionInArray(evt.Buttons.MoveDown, evt.Index,
                                                                       evt.ListLength);
     if (evt.target is ListElement le)
     {
         ElementInteractions.SetStateBasedOnOption(evt.PropertyField, le.Options.EnableModify);
     }
 }
Ejemplo n.º 10
0
        public void WhenElementIsNull_ShouldThrowArgumentNullException()
        {
            try
            {
                ElementInteractions.InsertHiddenIntFieldWithPropertyPathSet(null, "test");
            }
            catch (ArgumentNullException e)
            {
                Assert.AreEqual("element", e.ParamName);
                return;
            }

            Assert.Fail($"{nameof(ArgumentNullException)} was not thrown");
        }
        public static void Authenticate(string basicAuthUser, string basicAuthPass, string authType)
        {
            switch (authType.ToLower())
            {
            case "iebasicauthentication":
                if (basicAuthUser != null & basicAuthPass != null)
                {
                    ElementInteractions auth = new ElementInteractions(Driver.Browser, feature);
                    auth.Authenticate(basicAuthUser, basicAuthPass);
                }
                break;

            case "chromebasicauthentication":
                Driver.Browser.Navigate().GoToUrl("https://DE%5" + basicAuthUser + ":" + basicAuthPass + "");
                break;

            default:
                break;
            }
        }
Ejemplo n.º 12
0
        public BasePage(T driver)
        {
            this.driver = driver;
            var test     = BaseStepDefinitions.reportTypes;
            var testName = BaseStepDefinitions.testName;

            if (StringOperations.ReturnString.StringIsPartOfArray(BaseStepDefinitions.reportTypes, "extent"))
            {
                this.actionSe = new ElementInteractions(driver, BaseStepDefinitions.steps, BaseStepDefinitions.reportTypes);
                this.assertSe = new Asserts(driver, BaseStepDefinitions.steps, BaseStepDefinitions.reportTypes);
                this.kendoSe  = new DatePicker(driver, BaseStepDefinitions.steps, BaseStepDefinitions.reportTypes);
                this.reports  = new Reports.Reports(driver, BaseStepDefinitions.steps);
            }
            else
            {
                this.actionSe = new ElementInteractions(driver, BaseStepDefinitions.testName, BaseStepDefinitions.reportTypes);
                this.assertSe = new Asserts(driver, BaseStepDefinitions.testName, BaseStepDefinitions.reportTypes);
                this.kendoSe  = new DatePicker(driver, BaseStepDefinitions.testName, BaseStepDefinitions.reportTypes);
                this.reports  = new Reports.Reports(driver, BaseStepDefinitions.testName);
            }
        }
Ejemplo n.º 13
0
        /// <summary>
        /// Enter text in input(edit) field.
        /// </summary>
        /// <param name="elementFactory">Factory that contains only the element that we want to mouse over.</param>
        /// <param name="text">The text that we want to enter in the element.</param>
        /// <param name="fullElementName">The name(method name) of the element that we want to enter text in.</param>
        /// <param name="secondsToWait">How many second to wait the element to become clickable. By default is 30 seconds</param>
        /// <param name="FatalORFailed">If the parametter is fatal - the test will stop on missing element error. If this parametter is failed - the test will conntinue on missing element error. By default is set to fatal.</param>
        public void SendKeysDatePicker(Func <IWebElement> elementFactory, string text, string fullElementName, int secondsToWait = 30, string fatalORFailed = "Fatal")
        {
            IWebElement         element;
            Asserts             asserts       = new Asserts(driver);
            ElementInteractions elInteraction = new ElementInteractions(driver, extest);

            fullElementName = asserts.DefineFullElementName(elementFactory, fullElementName);

            try
            {
                element = elementFactory();
                elInteraction.WaitForElement(secondsToWait, element);
                element.SendKeys(Keys.ArrowLeft);
                element.SendKeys(Keys.ArrowLeft);
                element.Clear();
                element.SendKeys(text);
            }
            catch (Exception ex)
            {
                elInteraction.MissingElement(fullElementName, ex.Message, fatalORFailed);
                return;
            }
        }
 public void OnClearListRequested(ClearListRequestedEvent evt)
 {
     ElementInteractions.SetConfirmSectionVisibility(outerControls.ClearList,
                                                     outerControls.ClearListConfirmSection, true);
 }
 public void WhenElementIsNull_ShouldNotThrowError()
 {
     ElementInteractions.SetAddSectionVisibility(null, false);
 }
Ejemplo n.º 16
0
 public void WhenElementIsNull_ShouldNotThrowError()
 {
     ElementInteractions.SetDefaultStyle(null);
 }
 public void OnAddItem(AddItemEvent evt)
 {
     Handler?.Add(evt.Item);
     ElementInteractions.SetAddObjectFieldValueToNull(outerControls.AddObjectField);
 }
 public void OnClearListCancelled(ClearListCancelledEvent evt)
 {
     ElementInteractions.SetConfirmSectionVisibility(outerControls.ClearList,
                                                     outerControls.ClearListConfirmSection, false);
 }
 public void OnClearList(ClearListEvent evt)
 {
     ElementInteractions.SetConfirmSectionVisibility(outerControls.ClearList,
                                                     outerControls.ClearListConfirmSection, false);
     Handler?.Clear();
 }
 public void WhenButtonIsNull_ShouldNotThrowError()
 {
     ElementInteractions.SetStateBasedOnOption(null, true);
 }