Skip to content

Commit

Permalink
Add screenshots for debugging
Browse files Browse the repository at this point in the history
  • Loading branch information
t1m0thyj committed Jan 3, 2025
1 parent 015078f commit bcd7c70
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion test/SystemTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using OpenQA.Selenium;
using OpenQA.Selenium.Appium;
using OpenQA.Selenium.Appium.Windows;
using OpenQA.Selenium.Support.Extensions;

namespace WinDynamicDesktop.Tests
{
Expand Down Expand Up @@ -35,10 +36,14 @@ public void ShouldUpdateWallpaper()
driver.FindElementByXPath("//Button[@Name='OK']").Click();
Thread.Sleep(TimeSpan.FromSeconds(5));
driver.SwitchTo().Window(driver.WindowHandles.Last());
driver.TakeScreenshot().SaveAsFile(@"..\..\..\screenshot1.png", ScreenshotImageFormat.Png);
driver.FindElementByXPath("//Button[@Name='Yes']").Click();
Thread.Sleep(TimeSpan.FromSeconds(60));
driver.TakeScreenshot().SaveAsFile(@"..\..\..\screenshot2.png", ScreenshotImageFormat.Png);
Thread.Sleep(TimeSpan.FromSeconds(20));
driver.TakeScreenshot().SaveAsFile(@"..\..\..\screenshot3.png", ScreenshotImageFormat.Png);

driver.SwitchTo().Window(driver.WindowHandles[0]);
driver.TakeScreenshot().SaveAsFile(@"..\..\..\screenshot4.png", ScreenshotImageFormat.Png);
driver.FindElementByXPath("//Window[@Name='Select Theme']").Click();
driver.FindElementByAccessibilityId("listView1").SendKeys(Keys.Control + Keys.End);
driver.FindElementByXPath("//ListItem[@Name='Windows 11']").Click();
Expand Down

0 comments on commit bcd7c70

Please sign in to comment.