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

Add tags/ID's to elements to facilitate automated UI testing with VisualRunners #39

Open
carzh opened this issue Nov 8, 2024 · 0 comments

Comments

@carzh
Copy link

carzh commented Nov 8, 2024

Is your feature request related to a problem?

We're currently setting up Appium to do automated UI testing on a MAUI app that uses VisualRunners.

You can reference and interact with UI elements with Appium by their attributes.

Ie, if your XAML file for the page had the following:

<Button Text="Run All  ►►"
                Command="{Binding RunEverythingCommand}"
                Style="{StaticResource RunButtonStyle}"
                Grid.Column="1" />

You can use Appium to find an element with the text field "Run All ►►".

I would like to check the number of tests that have failed and the number that have succeeded through Appium, but those elements in the XAML page do not have any unique tags or identifiers.

Describe the solution you'd like

Add x:Name fields to the labels for the number of tests that have passed and failed.

                            <Label Text="" TextColor="{StaticResource SuccessfulTestsColor}" />
                            <Label x:Name="SuccessfulTestsCount" Text="{Binding Passed}" TextColor="{StaticResource SuccessfulTestsColor}" Margin="0,0,15,0" />

                            <Label Text="" TextColor="{StaticResource FailedTestsColor}" />
                            <Label x:Name="FailedTestsCount" Text="{Binding Failed}" TextColor="{StaticResource FailedTestsColor}" Margin="0,0,15,0" />

                            <Label Text="" TextColor="{StaticResource SkippedTestsColor}" />
                            <Label x:Name="SkippedTestsCount" Text="{Binding Skipped}" TextColor="{StaticResource SkippedTestsColor}" Margin="0,0,15,0" />

                            <Label Text="🔷" TextColor="{StaticResource NotRunTestsColor}" />
                            <Label x:Name="NotRanTestsCount" Text="{Binding NotRun}" TextColor="{StaticResource NotRunTestsColor}" />

Describe alternatives you've considered

Provide some kind of API to query the elements on the HomePage (as well as a way to query for the test results page) maybe.

Additional context

Let me know if there is already an existing & easier way to reference UI elements!

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

No branches or pull requests

1 participant