Exemple #1
0
 public void TestInitialize()
 {
     GraphBrowser.Goto(GraphBrowser.BaseAddress);
     GraphBrowser.SetWindowSize(0, 0, true);
     GraphBrowser.Goto(GraphUtility.RemoveRedundantPartsfromExtractBaseAddress() + "/code-samples-and-sdks");
     this._codeSamplesPage = new GraphCodeSamplesPage();
 }
        public void Comps_Graph_S04_TC01_CanToggleArrowWorkInSmallDocumentaionPage()
        {
            int currentWidth  = 0;
            int currentHeight = 0;

            GraphBrowser.GetWindowSize(out currentWidth, out currentHeight);
            GraphPages.Navigation.Select("Documentation");

            Size windowSize;
            //Set as the screen size of IPad2
            double deviceScreenSize = double.Parse(GraphUtility.GetConfigurationValue("IPad2Size"));

            GraphBrowser.TransferPhysicalSizeToPixelSize(
                deviceScreenSize,
                new Size
            {
                Width  = int.Parse(GraphUtility.GetConfigurationValue("IPad2ScreenResolutionWidth")),
                Height = int.Parse(GraphUtility.GetConfigurationValue("IPad2ScreenResolutionHeight"))
            },
                out windowSize);
            GraphBrowser.SetWindowSize(windowSize.Width, windowSize.Height);

            Assert.IsTrue(
                GraphUtility.IsToggleArrowDisplayed(),
                "An IPad2 window size ({0} inches) can make table of content arrow appear.",
                deviceScreenSize);
            Assert.IsFalse(GraphUtility.IsMenuContentDisplayed(),
                           "When the arrows exists, table of content should be hidden.");

            GraphUtility.ToggleMenu();
            Assert.IsTrue(GraphUtility.IsMenuContentDisplayed(),
                          "When the arrows exists and table of content is hidden,clicking the arrow should show table of content.");

            GraphUtility.ToggleMenu();
            Assert.IsFalse(GraphUtility.IsMenuContentDisplayed(),
                           "When the arrows exists and table of content is shown,clicking the arrow should hide table of content.");

            //Set as the screen size of IPhone6 plus
            deviceScreenSize = double.Parse(GraphUtility.GetConfigurationValue("IPhone6PlusSize"));
            //Since mobile phone width<Height, invert the output values
            GraphBrowser.TransferPhysicalSizeToPixelSize(
                deviceScreenSize,
                new Size
            {
                Width  = int.Parse(GraphUtility.GetConfigurationValue("IPhone6PlusScreenResolutionWidth")),
                Height = int.Parse(GraphUtility.GetConfigurationValue("IPhone6PlusScreenResolutionHeight"))
            },
                out windowSize);
            //Since mobile phone widh<height, invert height and width
            GraphBrowser.SetWindowSize(windowSize.Height, windowSize.Width);

            Assert.IsTrue(
                GraphUtility.IsToggleArrowDisplayed(),
                "An IPhone6 Plus window size ({0} inches) can make table of content arrow appear.",
                deviceScreenSize);

            //Recover the window size
            GraphBrowser.SetWindowSize(currentWidth, currentHeight);
        }
        public void CanTraverseTocAndAccessDocs()
        {
            GraphBrowser.SetWindowSize(0, 0, true);
            GraphPages.Navigation.Select("Documentation");
            //If the table of content is replaced by the toggle arrow, click the arrow to display table of content
            //if (GraphUtility.IsToggleArrowDisplayed())
            //{
            //    GraphUtility.ToggleMenu();
            //}

            //int layerCount = Utility.GetTOCLayer();
            //var failedDocList = Utility.CheckAllDocuments(layerCount);
            var failedDocList = GraphUtility.TraverseTocAndGetFailedDocs();

            Assert.IsTrue(failedDocList.Count == 0, "Failed documents: " + String.Join("; ", failedDocList));
        }
        public void Comps_Graph_S07_TC01_CheckInThisArticle()
        {
            GraphPages.Navigation.Select("Documentation");
            GraphBrowser.ZoomToPercent(50);
            GraphBrowser.Wait(TimeSpan.FromSeconds(3)); //In this article renders after the doc renders, so must wait
            Assert.IsTrue(GraphUtility.IsInThisArticleDisplayed(),
                          "On a large screen, in this article should be displayed");
            GraphBrowser.ZoomToPercent(100);

            Size windowSize;
            //Set as the screen size of IPad2
            double deviceScreenSize = double.Parse(GraphUtility.GetConfigurationValue("IPad2Size"));

            GraphBrowser.TransferPhysicalSizeToPixelSize(
                deviceScreenSize,
                new Size
            {
                Width  = int.Parse(GraphUtility.GetConfigurationValue("IPad2ScreenResolutionWidth")),
                Height = int.Parse(GraphUtility.GetConfigurationValue("IPad2ScreenResolutionHeight"))
            },
                out windowSize);
            GraphBrowser.SetWindowSize(windowSize.Width, windowSize.Height);

            Assert.IsFalse(GraphUtility.IsInThisArticleDisplayed(),
                           "On an iPad, in this article should not be displayed");

            //Set as the screen size of IPhone6 plus
            deviceScreenSize = double.Parse(GraphUtility.GetConfigurationValue("IPhone6PlusSize"));
            //Since mobile phone width<Height, invert the output values
            GraphBrowser.TransferPhysicalSizeToPixelSize(
                deviceScreenSize,
                new Size
            {
                Width  = int.Parse(GraphUtility.GetConfigurationValue("IPhone6PlusScreenResolutionWidth")),
                Height = int.Parse(GraphUtility.GetConfigurationValue("IPhone6PlusScreenResolutionHeight"))
            },
                out windowSize);
            //Since mobile phone widh<height, invert height and width
            GraphBrowser.SetWindowSize(windowSize.Height, windowSize.Width);

            Assert.IsFalse(GraphUtility.IsInThisArticleDisplayed(),
                           "On an iPhone, in this article should not be displayed");
        }
 public void TestInitialize()
 {
     GraphBrowser.Goto(GraphBrowser.BaseAddress);
     GraphBrowser.SetWindowSize(0, 0, true);
 }