Skip to content

Commit 5d7bc31

Browse files
committed
Update installer for Inno 6.4 and save screenshot on test error
1 parent 7e18ee0 commit 5d7bc31

File tree

3 files changed

+38
-21
lines changed

3 files changed

+38
-21
lines changed

.github/workflows/build.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,4 +93,6 @@ jobs:
9393
if: ${{ failure() }}
9494
with:
9595
name: test-dir
96-
path: test\bin
96+
path: |
97+
test\bin
98+
!test\bin\*.exe

scripts/installer.iss

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ AppPublisherURL={#MyAppURL}
2323
AppSupportURL={#MyAppURL}
2424
AppUpdatesURL={#MyAppURL}
2525
DefaultDirName={autopf}\{#MyAppName}
26+
UninstallDisplayIcon={app}\{#MyAppExeName}
2627
ChangesAssociations=yes
2728
DisableProgramGroupPage=yes
2829
; Uncomment the following line to run in non administrative install mode (install for current user only.)
@@ -63,6 +64,8 @@ Name: "russian"; MessagesFile: "compiler:Languages\Russian.isl"
6364
Name: "slovak"; MessagesFile: "compiler:Languages\Slovak.isl"
6465
Name: "slovenian"; MessagesFile: "compiler:Languages\Slovenian.isl"
6566
Name: "spanish"; MessagesFile: "compiler:Languages\Spanish.isl"
67+
Name: "swedish"; MessagesFile: "compiler:Languages\Swedish.isl"
68+
Name: "tamil"; MessagesFile: "compiler:Languages\Tamil.isl"
6669
Name: "turkish"; MessagesFile: "compiler:Languages\Turkish.isl"
6770
Name: "ukrainian"; MessagesFile: "compiler:Languages\Ukrainian.isl"
6871

test/SystemTests.cs

Lines changed: 32 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -25,30 +25,42 @@ public SystemTests()
2525
[Fact, Trait("type", "system")]
2626
public void ShouldUpdateWallpaper()
2727
{
28-
driver.FindElementByXPath("//Window[@Name='Select Language']").Click();
29-
driver.FindElementByXPath("//Button[@Name='OK']").Click();
30-
Thread.Sleep(TimeSpan.FromSeconds(5));
28+
try
29+
{
30+
driver.FindElementByXPath("//Window[@Name='Select Language']").Click();
31+
driver.FindElementByXPath("//Button[@Name='OK']").Click();
32+
Thread.Sleep(TimeSpan.FromSeconds(5));
3133

32-
if (HandleLocationPrompt()) Thread.Sleep(TimeSpan.FromSeconds(2));
33-
driver.SwitchTo().Window(driver.WindowHandles[0]);
34-
driver.FindElementByXPath("//Window[@Name='Configure Schedule']").Click();
35-
driver.FindElementByAccessibilityId("radioButton1").Click();
36-
driver.FindElementByAccessibilityId("locationBox").SendKeys("New York NY");
37-
driver.FindElementByXPath("//Button[@Name='OK']").Click();
38-
Thread.Sleep(TimeSpan.FromSeconds(2));
39-
driver.FindElementByXPath("//Button[@Name='Yes']").Click();
40-
Thread.Sleep(TimeSpan.FromSeconds(5));
34+
if (HandleLocationPrompt()) Thread.Sleep(TimeSpan.FromSeconds(2));
35+
driver.SwitchTo().Window(driver.WindowHandles[0]);
36+
driver.FindElementByXPath("//Window[@Name='Configure Schedule']").Click();
37+
driver.FindElementByAccessibilityId("radioButton1").Click();
38+
driver.FindElementByAccessibilityId("locationBox").SendKeys("New York NY");
39+
driver.FindElementByXPath("//Button[@Name='OK']").Click();
40+
Thread.Sleep(TimeSpan.FromSeconds(2));
41+
driver.FindElementByXPath("//Button[@Name='Yes']").Click();
42+
Thread.Sleep(TimeSpan.FromSeconds(5));
4143

42-
driver.SwitchTo().Window(driver.WindowHandles[0]);
43-
driver.FindElementByXPath("//Window[@Name='Select Theme']").Click();
44-
driver.FindElementByAccessibilityId("listView1").SendKeys(Keys.Control + Keys.End);
45-
driver.FindElementByXPath("//ListItem[@Name='Windows 11']").Click();
46-
driver.FindElementByXPath("//Button[@Name='Apply']").Click();
47-
Thread.Sleep(TimeSpan.FromSeconds(2));
44+
driver.SwitchTo().Window(driver.WindowHandles[0]);
45+
driver.FindElementByXPath("//Window[@Name='Select Theme']").Click();
46+
driver.FindElementByAccessibilityId("listView1").SendKeys(Keys.Control + Keys.End);
47+
driver.FindElementByXPath("//ListItem[@Name='Windows 11']").Click();
48+
driver.FindElementByXPath("//Button[@Name='Apply']").Click();
49+
Thread.Sleep(TimeSpan.FromSeconds(2));
4850

49-
Assert.Contains(["scripts", "settings.json", "themes"],
51+
Assert.Contains(["scripts", "settings.json", "themes"],
5052
Directory.GetFileSystemEntries(Path.GetDirectoryName(AppPath)).Select(Path.GetFileName).ToArray());
51-
Assert.StartsWith(Path.Combine(Path.GetDirectoryName(AppPath), "themes", "Windows_11", "img"), GetWallpaperPath());
53+
Assert.StartsWith(Path.Combine(Path.GetDirectoryName(AppPath), "themes", "Windows_11", "img"), GetWallpaperPath());
54+
}
55+
catch (WebDriverException)
56+
{
57+
try
58+
{
59+
driver.GetScreenshot().SaveAsFile(Path.Combine(Path.GetDirectoryName(AppPath), "screenshot.png"));
60+
}
61+
catch { /* Do nothing */ }
62+
throw;
63+
}
5264
}
5365

5466
public void Dispose()

0 commit comments

Comments
 (0)