Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: use FlaUI to test all frameworks #193

Closed
wants to merge 6 commits into from

Conversation

virzak
Copy link
Contributor

@virzak virzak commented Jan 28, 2022

Description

Replace TestStack.White with FlaUI

Fixes #192

Checklist

  • I have squashed my commits into a single one with a message that aligns with the contributing guidelines
  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works

@@ -9,6 +9,9 @@ namespace MvvmDialogs.FrameworkDialogs.FolderBrowser
public class FolderBrowserDialogSettingsTest
{
[Test]
#if NETCOREAPP3_0_OR_GREATER
[Ignore("Need to fix for .Net Core and later")]
#endif
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@FantasticFiasco here is a test that exposed a few missing properties in .net core 3 and above. Skipping the test to not break the build, but I believe this could be made into a separate issue.

@virzak
Copy link
Contributor Author

virzak commented Jan 28, 2022

Also as a result of this PR you can now use dotnet test, for example:

dotnet test .\samples\wpf\Demo.CustomFolderBrowserDialog.Test\

Edit: tests can run in parallel too, which saves a lot of time, but some of them fail when that happens:

msbuild
dotnet test --no-build

@@ -1,72 +1,289 @@
using System;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

//return windows.FirstOrDefault(x => x.Name == name)?.As<T>();

// Title is displaying wrong attribute
return windows.FirstOrDefault(x => x.Title.ToLowerInvariant().Contains(name.ToLowerInvariant()))?.As<T>();
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This might be an issue with FlaUI. Need more investigation.

@FantasticFiasco
Copy link
Owner

Migrating UI automation framework seems like a good idea! However, I'll be away on vacation during the weekend and also the next week, but I'll look into this PR when I get back the week after.

@virzak
Copy link
Contributor Author

virzak commented Jan 28, 2022

No rush whatsoever. I'm going to Ottawa this weekend. #FreedomConvoy2022

@FantasticFiasco
Copy link
Owner

I've looked at the project TestBaseClasses and one of the specific sample tests, but when I run the UI tests they seem flaky. Sometimes they pass and sometimes they don't. Are you experiencing the same?

@virzak
Copy link
Contributor Author

virzak commented Mar 6, 2022

@FantasticFiasco how do you run them? I had one test fail after about 20 runs.

I do get errors when I run these tests using dotnet test. That's due to parallelization which is the default mode.

With dotnet test -m:1 that's not an issue.

@FantasticFiasco
Copy link
Owner

Closed in favor of #250

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Tests are only done on .Net Framework, should be performed on all.
2 participants