Skip to content
This repository has been archived by the owner on Jun 21, 2023. It is now read-only.

Add Automation ID properties to controls #853

Merged
merged 34 commits into from Feb 28, 2017

Conversation

paladique
Copy link
Contributor

Fixes #812

@paladique
Copy link
Contributor Author

The IDs depend on what is coming from the private repo, which is a submodule. This will cause build errors for someone who doesn't have access. Should we just use a dll, or make the repo public?

@paladique paladique changed the title Add Automation IDs properties to controls Add Automation ID properties to controls Feb 13, 2017
@paladique
Copy link
Contributor Author

This commit history is a mess 😞 from fidgeting around to make things work and CI pass. Let me know if you'd prefer I squash anything.

Copy link
Contributor

@grokys grokys left a comment

Choose a reason for hiding this comment

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

Looks good to me, just a couple of small questions.

Background="Beige"
d:DataContext="{d:DesignInstance Type=sampleData:InfoPanelDesigner, IsDesignTimeCreatable=True}"
d:DesignHeight="300"
d:DesignWidth="300"
mc:Ignorable="d">
mc:Ignorable="d"
AutomationProperties.AutomationId="{x:Static automation:AutomationIDs.GitHubToolBar}">
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this correct? I'd expect GitHubToolBar to mean the toolbar in the GitHub pane.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah you're right, I think I made a new ID for this but its not reflected in here somehow.

<TextBox x:Name="three" AutomationProperties.AutomationId="{x:Static automation:AutomationIDs.TwoFactorAuthenticatonNumberThreeTextBox}" />
<TextBox x:Name="four" AutomationProperties.AutomationId="{x:Static automation:AutomationIDs.TwoFactorAuthenticatonNumberFourTextBox}" />
<TextBox x:Name="five" AutomationProperties.AutomationId="{x:Static automation:AutomationIDs.TwoFactorAuthenticatonNumberFiveTextBox}" />
<TextBox x:Name="six" Margin="0" AutomationProperties.AutomationId="{x:Static automation:AutomationIDs.TwoFactorAuthenticatonNumberSixTextBox}" />
Copy link
Contributor

Choose a reason for hiding this comment

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

This strikes me as slightly clumsy. Would it make more sense to add the ID to the container stack panel and then get the textboxes as children of that? Is that even possible? ;)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That should be possible! I just grabbed all controls that looked testable and put an ID on it 😬

Copy link
Contributor

@grokys grokys left a comment

Choose a reason for hiding this comment

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

I can't get this working: I'm getting an exception when running:

Exception thrown: 'System.Windows.Markup.XamlParseException' in PresentationFramework.dll

Additional information: Could not load file or assembly 'GitHub.VisualStudio.TestAutomation.AutomationIDs, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.

This might be related to the fixes in #875. We should maybe wait for that to be merged first?

@paladique
Copy link
Contributor Author

@grokys should be good now! I had to update the assembly resolver to point to the proper dll

@grokys grokys merged commit eaaca80 into github:master Feb 28, 2017
@grokys grokys deleted the fixes/812-automation-ids branch February 28, 2017 11:51
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants