Skip to content

Commit

Permalink
Revert debugging changes except screenshots
Browse files Browse the repository at this point in the history
  • Loading branch information
t1m0thyj committed Jan 5, 2025
1 parent e8b3163 commit 74f5a99
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 39 deletions.
31 changes: 12 additions & 19 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:

jobs:
build:
runs-on: windows-2022
runs-on: windows-latest
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository

strategy:
Expand All @@ -17,11 +17,6 @@ jobs:
platform: [x86, x64, arm64]

steps:
- run: |
ls C:\Windows\Web
ls C:\Windows\Web\Wallpaper
ls C:\Windows\Web\Wallpaper\Windows
- uses: actions/checkout@v4

- uses: actions/setup-dotnet@v4
Expand All @@ -48,18 +43,18 @@ jobs:
name: exe-${{ matrix.platform }}
path: src\bin\Release\net8.0-windows10.0.19041.0\win-${{ matrix.platform }}\publish\*.exe

- run: msbuild uwp\WinDynamicDesktop.Package.wapproj /v:m /p:AppxBundle=$env:AppxBundle /p:Configuration=$env:Configuration /p:Platform=$env:Platform /p:UapAppxPackageBuildMode=$env:UapAppxPackageBuildMode /p:UseTemporarySignCert=$env:UseTemporarySignCert
env:
AppxBundle: Never
Configuration: Release
Platform: ${{ matrix.platform }}
UapAppxPackageBuildMode: SideloadOnly
UseTemporarySignCert: true
# - run: msbuild uwp\WinDynamicDesktop.Package.wapproj /v:m /p:AppxBundle=$env:AppxBundle /p:Configuration=$env:Configuration /p:Platform=$env:Platform /p:UapAppxPackageBuildMode=$env:UapAppxPackageBuildMode /p:UseTemporarySignCert=$env:UseTemporarySignCert
# env:
# AppxBundle: Never
# Configuration: Release
# Platform: ${{ matrix.platform }}
# UapAppxPackageBuildMode: SideloadOnly
# UseTemporarySignCert: true

- uses: actions/upload-artifact@v4
with:
name: msix-${{ matrix.platform }}
path: uwp\AppPackages\*\*.msix
# - uses: actions/upload-artifact@v4
# with:
# name: msix-${{ matrix.platform }}
# path: uwp\AppPackages\*\*.msix

test:
runs-on: windows-2025
Expand All @@ -82,10 +77,8 @@ jobs:
working-directory: test

- run: |
Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\location" -Name "Value" -Value "Allow"
npm install -g appium
Start-Process -FilePath "C:\Program Files (x86)\Windows Application Driver\WinAppDriver.exe"
Start-Sleep -Seconds 5
- uses: actions/download-artifact@v4
with:
Expand Down
1 change: 0 additions & 1 deletion src/LanguageDialog.cs
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@ private void okButton_Click(object sender, EventArgs e)
}

this.Close();
//Localization.SelectLanguage(false);
}

private void cancelButton_Click(object sender, EventArgs e)
Expand Down
10 changes: 3 additions & 7 deletions src/ThemeDialog.cs
Original file line number Diff line number Diff line change
Expand Up @@ -227,14 +227,10 @@ private void ThemeDialog_Load(object sender, EventArgs e)

if (UwpDesktop.IsMultiDisplaySupported())
{
var task = Task.Run(() => ThemeDialogUtils.GetDisplayNames());
if (Task.WaitAny(task, Task.Delay(10000)) == 0)
string[] displayNames = ThemeDialogUtils.GetDisplayNames();
for (int i = 0; i < displayNames.Length; i++)
{
string[] displayNames = task.Result;
for (int i = 0; i < displayNames.Length; i++)
{
displayComboBox.Items.Add(string.Format(_("Display {0}: {1}"), i + 1, displayNames[i]));
}
displayComboBox.Items.Add(string.Format(_("Display {0}: {1}"), i + 1, displayNames[i]));
}
}
if (UwpDesktop.IsUwpSupported())
Expand Down
6 changes: 1 addition & 5 deletions src/UwpLocation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,7 @@ public static bool HasAccess()

try
{
var task = Task.Run(() => UnsafeRequestAccess());
if (Task.WaitAny(task, Task.Delay(5000)) == 0)
{
hasAccess = task.Result;
}
hasAccess = Task.Run(() => UnsafeRequestAccess()).Result;
}
catch // Error when attempting to show UWP location prompt in WinForms app
{
Expand Down
14 changes: 7 additions & 7 deletions test/SystemTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,27 +27,27 @@ public void ShouldUpdateWallpaper()
{
driver.FindElementByXPath("//Window[@Name='Select Language']").Click();
driver.FindElementByXPath("//Button[@Name='OK']").Click();
Thread.Sleep(TimeSpan.FromSeconds(10));
Thread.Sleep(TimeSpan.FromSeconds(5));

driver.TakeScreenshot().SaveAsFile(@"..\..\..\screenshot1.png", ScreenshotImageFormat.Png);
driver.SwitchTo().Window(driver.WindowHandles[0]);
driver.TakeScreenshot().SaveAsFile(@"..\..\..\screenshot2.png", ScreenshotImageFormat.Png);
driver.FindElementByXPath("//Window[@Name='Configure Schedule']").Click();
driver.TakeScreenshot().SaveAsFile(@"..\..\..\screenshot3.png", ScreenshotImageFormat.Png);
driver.FindElementByAccessibilityId("radioButton1").Click();
driver.FindElementByAccessibilityId("locationBox").SendKeys("New York NY");
driver.FindElementByXPath("//Button[@Name='OK']").Click();
Thread.Sleep(TimeSpan.FromSeconds(5));
Thread.Sleep(TimeSpan.FromSeconds(2));
//driver.SwitchTo().Window(driver.WindowHandles.Last());
driver.TakeScreenshot().SaveAsFile(@"..\..\..\screenshot1.png", ScreenshotImageFormat.Png);
driver.FindElementByXPath("//Button[@Name='Yes']").Click();
driver.TakeScreenshot().SaveAsFile(@"..\..\..\screenshot2.png", ScreenshotImageFormat.Png);
Thread.Sleep(TimeSpan.FromSeconds(10));
Thread.Sleep(TimeSpan.FromSeconds(5));

driver.SwitchTo().Window(driver.WindowHandles[0]);
driver.TakeScreenshot().SaveAsFile(@"..\..\..\screenshot3.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();
driver.FindElementByXPath("//Button[@Name='Apply']").Click();
Thread.Sleep(TimeSpan.FromSeconds(5));
Thread.Sleep(TimeSpan.FromSeconds(2));

Assert.Contains(["scripts", "settings.json", "themes"],
Directory.GetFileSystemEntries(Path.GetDirectoryName(AppPath)).Select(Path.GetFileName).ToArray());
Expand Down

0 comments on commit 74f5a99

Please sign in to comment.