コード例 #1
0
        public void Setup()
        {
            metlWindow = MeTL.GetMainWindow();

            homeTab = new HomeTabScreen(metlWindow.AutomationElement).OpenTab();
            canvas = new CollapsedCanvasStack(metlWindow.AutomationElement);
        }
コード例 #2
0
        public void InsertBoldText()
        {
            ScreenActionBuilder.Create().WithWindow(metlWindow.AutomationElement)
                .Ensure<HomeTabScreen>((home) =>
                {
                    if (!home.IsActive) home.OpenTab();
                    home.ActivateTextMode().TextInsertMode();
                    return true;
                })
                .With<CollapsedCanvasStack>((canvas) => 
                {
                    var insertedText = canvas.InsertTextbox(canvas.RandomPointWithinMargin(-40, -40), "Bolded text");

                    var home = new HomeTabScreen(metlWindow.AutomationElement).ActivateTextMode();
                    canvas.SelectTextboxWithClick(insertedText);
                    home.ToggleBoldText();
                    var slideNav = new SlideNavigation(metlWindow.AutomationElement);
                    var currentPage = slideNav.CurrentPage;
                    slideNav.WaitForPageChange(currentPage + 1, () => slideNav.Add());
                    slideNav.WaitForPageChange(currentPage, () => slideNav.Back());

                    home.IsBoldChecked.ShouldBeTrue();
                });
        }