Beispiel #1
0
        public void FluentElementGetBy()
        {
            By            testBy            = By.CssSelector("#ItemsToAutomate");
            FluentElement testFluentElement = new FluentElement(this.TestObject, testBy, "TEST");

            Assert.AreEqual(testBy, testFluentElement.By);
        }
Beispiel #2
0
        public InspectorPrefsUI(InspectorPrefs prefs)
        {
            this.prefs      = prefs;
            this.serialized = new SerializedObject(prefs);

            styleSheets.Add(styleSheet);
            if (!FluentUITK.isProSkin)
            {
                styleSheets.Add(stylesLight);
            }

            ui = this.Fluent();
            ui.OnChange <bool>(OnChange);

            optionsPanel = CreateOptionsPanel();
            patchesPanel = new InspectorPatchesUI();

            var scrollView = new ScrollView().Fluent().Shrink(-100).Add(
                optionsPanel,
                patchesPanel
                );

            ui.Add(
                CreateTopPanel(),
                scrollView
                );

            ui.Bind(serialized);
        }
Beispiel #3
0
        public void FluentWithParentAndWithoutMatch()
        {
            // Get the fluent element without a parent
            FluentElement flowerTableCaptionWithoutParent = new FluentElement(this.TestObject, By.CssSelector("#FlowerTable CAPTION > Strong"), "Flower table");

            // Make sure we are finding the correct table
            Assert.AreEqual("Flower Table", this.FlowerTableCaptionWithParent.Text);

            // Make sure we got the table caption we are looking for
            Assert.AreEqual(this.FlowerTableCaptionWithParent.Text, flowerTableCaptionWithoutParent.Text);
        }
 [Given(@"I create a full Fluent div")] public void GivenCreateFluentDiv()
 {
     FluentDiv = App.GetComponentRoot()
                 .Add <FluentElement <Div> >()
                 .SetAttribute("keyA", "valueA")
                 .SetAttribute("keyB", "valueB")
                 .SetAttribute("keyC", "valueC")
                 .SetText("textA")
                 .RemoveAttribute("keyB")
     ;
 }
Beispiel #5
0
        InjectResult TryInject()
        {
            this.root          = propertyEditor.rootVisualElement;
            this.mainContainer = root.Get(".unity-inspector-main-container");
            this.editorsList   = root.Get(".unity-inspector-editors-list");

            if (editorsList == null)
            {
                return(InjectResult.NoList);
            }

            scrollView      = root.Get <ScrollView>(".unity-inspector-root-scrollview").First();
            scrollbar       = scrollView.Get <Scroller>(".unity-scroller--vertical");
            contentViewport = scrollView.Get("#unity-content-viewport");

            root.Register <MouseMoveEvent>(OnRootMouseMove);
            contentViewport.Register <GeometryChangedEvent>(OnContentViewportLayout);

            SetupScrollView();
            Init();

            if (gameObjectEditor == null)
            {
                return(InjectResult.NoGameObjectEditor);
            }

            toolbar = editorsList.Query <InspectorTabsBar>();

            if (toolbar == null)
            {
                toolbar = new InspectorTabsBar();
            }

            // Insert after InspectorElement and before Footer
            gameObjectEditor.Insert(2, toolbar);

            return(InjectResult.Final);
        }
Beispiel #6
0
        public void FluentElementGetTestObject()
        {
            FluentElement testFluentElement = new FluentElement(this.TestObject, By.CssSelector("#ItemsToAutomate"), "TEST");

            Assert.AreEqual(this.TestObject, testFluentElement.TestObject);
        }