Skip to content

Commit

Permalink
Disable an uitest on GitHub Action.
Browse files Browse the repository at this point in the history
  • Loading branch information
whistyun committed Nov 5, 2022
1 parent 1eff271 commit 04a2abe
Show file tree
Hide file tree
Showing 9 changed files with 29 additions and 7 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,5 @@ jobs:
run: dotnet build --no-restore
- name: Test
run: dotnet test --no-build --verbosity normal
env:
RUNON_GITHUB: yes
4 changes: 4 additions & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,8 @@
<BaseOutputPath>$(ArtifactsDir)bin\$(MSBuildProjectName)\</BaseOutputPath>
<PackageOutputPath>$(ArtifactsDir)nuget\$(Configuration)\</PackageOutputPath>
</PropertyGroup>

<PropertyGroup>
<PackageVersion>1.16.2</PackageVersion>
</PropertyGroup>
</Project>
2 changes: 1 addition & 1 deletion MdXaml.Html/MdXaml.Html.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<PropertyGroup>
<TargetFrameworks>netcoreapp3.0;net45;net5.0-windows</TargetFrameworks>
<PackageId>MdXaml.Html</PackageId>
<Version>1.16.1</Version>
<Version>$(PackageVersion)</Version>
<Authors>whistyun</Authors>
<Company />
<Description>Markdown XAML processor</Description>
Expand Down
2 changes: 1 addition & 1 deletion MdXaml.Plugins/MdXaml.Plugins.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<PropertyGroup>
<TargetFrameworks>netcoreapp3.0;net45;net5.0-windows</TargetFrameworks>
<PackageId>MdXaml.Plugins</PackageId>
<Version>1.16.1</Version>
<Version>$(PackageVersion)</Version>
<Authors>whistyun</Authors>
<Company />
<Description>Markdown XAML processor</Description>
Expand Down
2 changes: 1 addition & 1 deletion MdXaml.Svg/MdXaml.Svg.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<PropertyGroup>
<TargetFrameworks>netcoreapp3.0;net45;net5.0-windows</TargetFrameworks>
<PackageId>MdXaml.Svg</PackageId>
<Version>1.16.1</Version>
<Version>$(PackageVersion)</Version>
<Authors>whistyun</Authors>
<Company />
<Description>Markdown XAML processor</Description>
Expand Down
2 changes: 1 addition & 1 deletion MdXaml/MdXaml.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<TargetFrameworks>netcoreapp3.0;net45;net5.0-windows</TargetFrameworks>
<UseWPF>true</UseWPF>
<PackageId>MdXaml</PackageId>
<Version>1.16.1</Version>
<Version>$(PackageVersion)</Version>
<Authors>Bevan Arps(original); whistyun</Authors>
<Company />
<Description>Markdown XAML processor</Description>
Expand Down
2 changes: 1 addition & 1 deletion MdXaml/MdXamlMigfree.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<TargetFrameworks>netcoreapp3.0;net45;net5.0-windows</TargetFrameworks>
<UseWPF>true</UseWPF>
<PackageId>MdXaml_migfree</PackageId>
<Version>1.16.1</Version>
<Version>$(PackageVersion)</Version>
<Authors>Bevan Arps(original); whistyun</Authors>
<Company />
<Description>Markdown XAML processor</Description>
Expand Down
17 changes: 15 additions & 2 deletions tests/VisualTest/Class1.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using NUnit.Framework;
#if !OnGitHubAction
using NUnit.Framework;
using System;
using System.Diagnostics;
using System.Drawing.Text;
Expand Down Expand Up @@ -34,16 +35,21 @@ public Class1()
_exeFilePath = Path.Combine(_projectDirectory.Replace("VisualTest", "VisualTestApp"), relPath, "VisualTestApp.exe");
}


[SetUp]
public void Setup()
{
_process = Process.Start(_exeFilePath);

var stopwatch = new Stopwatch();
stopwatch.Start();

while (_hwnd == IntPtr.Zero)
{
Thread.Sleep(1000);
_hwnd = _process.MainWindowHandle;

if (stopwatch.ElapsedMilliseconds > 5000)
throw new InvalidOperationException("Application startup timeout");
}
}

Expand All @@ -60,10 +66,16 @@ public void CheckFileRemove()
markdownValPtn.SetValue("Markdown.txt");

// wait for viewing markdown
var stopwatch = new Stopwatch();
stopwatch.Start();

var markdownView = mainWindow.FindPatternById<TextPattern>("MarkdownScrollViewer");
while (markdownView.DocumentRange.GetChildren().Length < 4)
{
Thread.Sleep(1000);

if (stopwatch.ElapsedMilliseconds > 5000)
throw new InvalidOperationException("Markdown drawing timeout");
}

Thread.Sleep(1000);
Expand Down Expand Up @@ -112,3 +124,4 @@ public void Closing()
}
}
}
#endif
3 changes: 3 additions & 0 deletions tests/VisualTest/VisualTest.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,8 @@
</None>
</ItemGroup>

<PropertyGroup Condition=" '$(RUNON_GITHUB)' != '' ">
<DefineConstants>OnGitHubAction</DefineConstants>
</PropertyGroup>

</Project>

0 comments on commit 04a2abe

Please sign in to comment.