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

Create a ActivePlatforms/IgnoredPlatforms Attribute for test methods/classes #72

Open
kazo0 opened this issue Feb 14, 2022 · 2 comments
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@kazo0
Copy link
Contributor

kazo0 commented Feb 14, 2022

I'm submitting a

Feature Request

Current behavior

Currently we would need to something like the following for our test methods and classes.

if (AppInitializer.GetLocalPlatform() == Platform.Android
    || AppInitializer.GetLocalPlatform() == Platform.iOS))
 {
   // Do something
 }
else if  (AppInitializer.GetLocalPlatform() == Platform.Browser)
{
  // Do something else
}

Desired behavior

What would be nice and cleaner is some sort of ActivePlatforms attribute for test methods and classes.
So we can mark classes and methods by doing something like:

[ActivePlatforms(Platform.Android, Platform.iOS)]
public void MyTest() { }

Or maybe even an IgnoredPlatforms?

[IgnoredPlatforms(Platform.Browser)]
public void MyTest() { }
@kazo0 kazo0 added enhancement New feature or request good first issue Good for newcomers labels Feb 14, 2022
@kazo0 kazo0 changed the title Create a ActivePlatformsAttribute for test methods/classes Create a ActivePlatforms/IgnoredPlatforms Attribute for test methods/classes Feb 14, 2022
@jeromelaban
Copy link
Member

jeromelaban commented Feb 15, 2022

This feature is actually specific to the uno repository, let's move if there for now. Actually, you probably mean you want it for not-uno :)

@jeromelaban jeromelaban transferred this issue from unoplatform/uno Feb 15, 2022
@kazo0
Copy link
Contributor Author

kazo0 commented Feb 16, 2022

My thinking was that this could be part of the Helpers within Uno.UITest. I see we do something similar for the UI Tests in Uno

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants