// Common Tests

        /// <summary>
        /// Standard Transform Test
        /// </summary>
        /// <param name="version"></param>
        /// <param name="fullPageLayoutMapping"></param>
        /// <param name="pageNameStartsWith"></param>
        private void TransformPage(SPPlatformVersion version, string fullPageLayoutMapping = "", string pageNameStartsWith = "Common")
        {
            using (var targetClientContext = TestCommon.CreateClientContext(TestCommon.AppSetting("SPOTargetSiteUrl")))
            {
                using (var sourceClientContext = TestCommon.CreateSPPlatformClientContext(version, TransformType.PublishingPage))
                {
                    var pageTransformator = new PublishingPageTransformator(sourceClientContext, targetClientContext, fullPageLayoutMapping);
                    pageTransformator.RegisterObserver(new MarkdownObserver(folder: TestContext.ResultsDirectory, includeVerbose: true));
                    pageTransformator.RegisterObserver(new UnitTestLogObserver());

                    var pages = sourceClientContext.Web.GetPagesFromList("Pages", pageNameStartsWith);
                    pages.FailTestIfZero();

                    foreach (var page in pages)
                    {
                        var pageName = page.FieldValues["FileLeafRef"].ToString();

                        PublishingPageTransformationInformation pti = new PublishingPageTransformationInformation(page)
                        {
                            // If target page exists, then overwrite it
                            Overwrite = true,

                            // Don't log test runs
                            SkipTelemetry = true,

                            //Permissions are unlikely to work given cross domain
                            KeepPageSpecificPermissions = false,

                            //Update target to include SP version
                            TargetPageName = TestCommon.UpdatePageToIncludeVersion(version, pageName)
                        };

                        Console.WriteLine("SharePoint Version: {0}", pti.SourceVersion);

                        pti.MappingProperties["SummaryLinksToQuickLinks"] = "true";
                        pti.MappingProperties["UseCommunityScriptEditor"] = "true";

                        var result = pageTransformator.Transform(pti);

                        Assert.IsTrue(!string.IsNullOrEmpty(result));
                    }

                    pageTransformator.FlushObservers();
                }
            }
        }
        /// <summary>
        /// Export workaround tests
        /// </summary>
        /// <param name="version"></param>
        /// <param name="pageNameStartsWith"></param>
        private void ExportWebPartByWorkaround(SPPlatformVersion version, string pageNameStartsWith = "Common")
        {
            using (var context = TestCommon.CreateSPPlatformClientContext(version, TransformType.PublishingPage))
            {
                var pages = context.Web.GetPagesFromList("Pages", pageNameStartsWith);

                foreach (var page in pages)
                {
                    page.EnsureProperties(p => p.File, p => p.File.ServerRelativeUrl);

                    TestBasePage testBase        = new TestBasePage(page, page.File, null, null);
                    var          webPartEntities = testBase.LoadPublishingPageFromWebServices(page.File.ServerRelativeUrl);

                    foreach (var webPart in webPartEntities)
                    {
                        var result = testBase.ExportWebPartXmlWorkaround(page.File.ServerRelativeUrl, webPart.Id.ToString());

                        Assert.IsTrue(!string.IsNullOrEmpty(result));
                    }
                }
            }
        }
        /// <summary>
        /// Standard Load Web Part Document with Web Services Test
        /// </summary>
        /// <param name="version"></param>
        /// <param name="pageNameStartsWith"></param>
        private void LoadWebPartDocumentViaWebServicesTest(SPPlatformVersion version, string pageNameStartsWith = "Common")
        {
            using (var context = TestCommon.CreateSPPlatformClientContext(version, TransformType.PublishingPage))
            {
                var pages = context.Web.GetPagesFromList("Pages", pageNameStartsWith);

                foreach (var page in pages)
                {
                    page.EnsureProperties(p => p.File, p => p.File.ServerRelativeUrl);

                    List <string> search = new List <string>()
                    {
                        "WebPartZone"
                    };

                    //Should be one
                    TestBasePage testBase = new TestBasePage(page, page.File, null, null);
                    var          result   = testBase.LoadPublishingPageFromWebServices(page.File.ServerRelativeUrl);

                    Assert.IsTrue(result.Count > 0);
                }
            }
        }