Пример #1
0
        public void WriteTest()
        {
            var firstText = tinyMCE.GetContent();

            tinyMCE.Write("Testing 1 2 3" + Keys.Enter + "43." + Keys.Enter);
            var secondText = tinyMCE.GetContent();

            Assert.IsTrue(String.Equals(firstText,
                                        String.Empty,
                                        StringComparison.Ordinal));

            Assert.IsFalse(String.Equals(firstText,
                                         secondText,
                                         StringComparison.Ordinal));

            Assert.IsFalse(String.IsNullOrEmpty(secondText));
        }
Пример #2
0
        public void GetMenuItemAtTest()
        {
            // Use Write here so that clicking
            tinyMCE.Write("Testing 'GetMenuItemAtTest()'.");

            // Should click the undo button.
            toolbar
            .GetMenuItemAt(0)
            .ConvertTo <ButtonGroupMenuItemComponent>()
            .GetMenuItemAt(0)
            .AsElement()
            .Click();

            var content = tinyMCE.GetContent();

            Assert.IsTrue(String.IsNullOrEmpty(content));
        }
        public void GetItemByText()
        {
            var beforeCut = "Testing 1 2 3" + Keys.Enter;

            tinyMCE.Write(beforeCut);
            tinyMCE.HightlightRange(new Point(7, 0), new Point(12, 0));
            menu.GetItemByText("Edit")
            .ConvertTo <DropDownMenuItemComponent>()
            .SelectOption("Cut")
            .AsElement()
            .Click();

            // Highlight all text.
            tinyMCE.HighlightAllText();
            var afterCut = tinyMCE.GetHighlightedText();

            Assert.AreNotEqual(afterCut, beforeCut);
        }