コード例 #1
0
        public void ValidateSwitchingItemInfo()
        {
            using (var setup = new TestSetupHelper("RatingControl Tests")) // This literally clicks the button corresponding to the test page.
            {
                UIObject customImagesTwo = FindElement.ById("StageThreeCheckbox");
                InputHelper.ScrollToElement(customImagesTwo);

                WaitForCheckbox("StageOneCheckbox");

                Log.Comment("Trying to find the named Image: CustomImagesTwo_FirstImageItem");
                UIObject image        = FindElement.ById("CustomImagesTwo_FirstImageItem");
                Image    imageAsImage = image as Image;

                Button changeTypeButton = new Button(FindElement.ById("ChangeCustomImagesTwoType"));
                changeTypeButton.Invoke();
                Wait.ForIdle();

                WaitForCheckbox("StageTwoCheckbox");

                Log.Comment("Trying to find the named Image: CustomImagesTwo_FirstTextItem");
                UIObject  textBlock            = FindElement.ById("CustomImagesTwo_FirstTextItem");
                TextBlock textBlockAsTextBlock = textBlock as TextBlock;

                changeTypeButton.Invoke();
                Wait.ForIdle();

                WaitForCheckbox("StageThreeCheckbox");

                Log.Comment("Trying to find the named Image: CustomImagesTwo_FirstImageItem_Again");
                UIObject image2        = FindElement.ById("CustomImagesTwo_FirstImageItem_Again");
                Image    imageAsImage2 = image2 as Image;
            }
        }
コード例 #2
0
        public void ImageInfoValidation()
        {
            using (var setup = new TestSetupHelper("RatingControl Tests")) // This literally clicks the button corresponding to the test page.
            {
                UIObject customImagesTwo = FindElement.ById("CustomImages");
                InputHelper.ScrollToElement(customImagesTwo);

                WaitForCheckbox("CustomImagesLoadedCheckBox");

                // Verify it has an <Image> child

                // Future: This RawContext doesn't seem to work to make us search the Raw UIA tree,
                // in future, if we can figure out a way to do that, we can stop
                // the "move the image into the content tree" in the test app hack
                // Context.RawContext.Activate();

                Log.Comment("Trying to find the named Image: CustomImages_FirstImageItem");
                UIObject image        = FindElement.ById("CustomImages_FirstImageItem");
                Image    imageAsImage = image as Image;

                // Can't really verify anything else
            }
        }