Add Automation ID properties to controls #853
Conversation
…creation controls
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? |
…tools/VisualStudio into fixes/812-automation-ids
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. |
There was a problem hiding this 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}"> |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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}" /> |
There was a problem hiding this comment.
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? ;)
There was a problem hiding this comment.
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 😬
There was a problem hiding this 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?
@grokys should be good now! I had to update the assembly resolver to point to the proper dll |
Fixes #812