コード例 #1
0
ファイル: EyesLibrary.cs プロジェクト: lstoiser/Packages
 public static void SetBatch(string batchName, string batchId)
 {
     EyesWrapper.SetBatchName(batchName);
     if (!string.IsNullOrEmpty(batchId))
     {
         EyesWrapper.SetBatchId(batchId);
     }
 }
コード例 #2
0
ファイル: EyesLibrary.cs プロジェクト: lstoiser/Packages
        public static void VisualCheckpoint(string fileOrFolderPath)
        {
            // Handling of filename / folder
            fileOrFolderPath = fileOrFolderPath.Trim();
            if (!System.IO.File.Exists(fileOrFolderPath) && !System.IO.Directory.Exists(fileOrFolderPath))
            {
                fileOrFolderPath = System.IO.Directory.GetCurrentDirectory() + @"\" + fileOrFolderPath;
            }

            EyesWrapper.StartOrContinueTest(GetTestCaseName());
            EyesWrapper.CheckFolder(fileOrFolderPath);
        }
コード例 #3
0
ファイル: EyesLibrary.cs プロジェクト: lstoiser/Packages
        public static void VisualCheckpoint(Adapter adapter, string stepDescription)
        {
            if (adapter == null)
            {
                throw new ArgumentNullException("adapter");
            }

            EyesWrapper.StartOrContinueTest(GetTestCaseName());
            Report.Info(string.Format("Applitools 'CheckImage' called with screenshot from repository item '{0}'.", adapter));

            try
            {
                ProgressForm.SetOpacity(0);

                Bitmap image;
                if (adapter.Element.HasCapability("webdocument"))
                {
                    var webDocument = adapter.As <WebDocument>();
                    EyesWrapper.SetBrowserName(webDocument.BrowserName);
                    if (EyesWrapper.ViewPortWidth > 0 && EyesWrapper.ViewPortHeight > 0)
                    {
                        webDocument.Browser.Resize(EyesWrapper.ViewPortWidth, EyesWrapper.ViewPortHeight);
                    }

                    webDocument.WaitForDocumentLoaded();
                    image = webDocument.CaptureFullPageScreenshot(screenshotCaptureFlag);
                }
                else
                {
                    var browserName = string.Empty;
                    if (adapter.Element.HasCapability("webelement"))
                    {
                        var parent = adapter.Parent;
                        while (parent.As <WebDocument>() == null)
                        {
                            parent = parent.Parent;
                        }

                        browserName = parent.As <WebDocument>().BrowserName;
                    }

                    EyesWrapper.SetBrowserName(browserName);
                    image = Imaging.CaptureImage(adapter.Element);
                }

                EyesWrapper.CheckImage(image, stepDescription);
            }
            finally
            {
                ProgressForm.SetOpacity(100);
            }
        }
コード例 #4
0
ファイル: InitializeEyes.cs プロジェクト: rajeesudh/Packages
        /// <summary>
        /// Performs the playback of actions in this module.
        /// </summary>
        /// <remarks>You should not call this method directly, instead pass the module
        /// instance to the <see cref="TestModuleRunner.Run(ITestModule)"/> method
        /// that will in turn invoke this method.</remarks>
        void ITestModule.Run()
        {
            int portHeight, portWidth;

            int.TryParse(ViewPortHeight, out portHeight);
            int.TryParse(ViewPortWidth, out portWidth);

            if (string.IsNullOrEmpty(AppName))
            {
                if (TestSuite.Current != null)
                {
                    AppName = TestSuite.Current.Name;
                }
            }

            EyesWrapper.Initialize(
                EyesApiKey, AppName, ServerURL, EyesBatchID, portWidth, portHeight, MatchLevel);
        }
コード例 #5
0
 /// <summary>
 /// Performs the playback of actions in this module.
 /// </summary>
 /// <remarks>You should not call this method directly, instead pass the module
 /// instance to the <see cref="TestModuleRunner.Run(ITestModule)"/> method
 /// that will in turn invoke this method.</remarks>
 void ITestModule.Run()
 {
     Report.Info("Applitools: Closing Eyes.");
     EyesWrapper.CloseTest();
 }
コード例 #6
0
ファイル: EyesLibrary.cs プロジェクト: lstoiser/Packages
 public static void ChangeMatchLevel(string matchLevel)
 {
     EyesWrapper.SetMatchLevel(matchLevel);
 }
コード例 #7
0
ファイル: EyesLibrary.cs プロジェクト: lstoiser/Packages
 public static void ChangeAppName(string newAppName)
 {
     EyesWrapper.SetAppName(newAppName);
 }