Skip to content

Commit

Permalink
UITest/InfoMan: rename some Command to Button
Browse files Browse the repository at this point in the history
  • Loading branch information
jbe2277 committed Dec 11, 2024
1 parent fd05fcf commit c792795
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public void SearchContactsAndChangeEntriesTest() => Run(() =>
contactView.PhoneBox.Text = "TPhone";
Assert.Equal("TPhone", item.PhoneLabel.Text);

window.ExitCommand.Click();
window.ExitButton.Click();
});

[Fact]
Expand Down Expand Up @@ -83,7 +83,7 @@ public void AddAndRemoveEntriesTest() => Run(() =>
Assert.Equal(5, contactListView.ContactItems.Count);
Assert.Equal(secondItem.FirstnameLabel.Text, contactListView.ContactList.SelectedItem.As<ContactListItem>().FirstnameLabel.Text);

window.ExitCommand.Click();
window.ExitButton.Click();

// Restart application and assert that new contact was saved
Launch(resetSettings: false, resetContainer: false);
Expand All @@ -100,7 +100,7 @@ public void AddAndRemoveEntriesTest() => Run(() =>

// Invalid Firstname > Save > Restart > Validation error should be here again
contactView.FirstnameBox.Text = "";
window.ExitCommand.Click();
window.ExitButton.Click();

Launch(resetSettings: false, resetContainer: false);
window = GetShellWindow();
Expand Down
4 changes: 2 additions & 2 deletions src/Samples.UITest/InformationManager.Test/Tests/EmailTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public void SearchEmailsAndAssertLists() => Run(() =>
Assert.Empty(emailListView.EmailItems);
Assert.Empty(emailView.TitleLabel.Text);

window.ExitCommand.Click();
window.ExitButton.Click();
});

[Fact]
Expand All @@ -87,7 +87,7 @@ public void RemoveEmailsTest() => Run(() =>
for (int i = 0; i < 5; i++) window.DeleteEmailCommand.Click();
Assert.Empty(emailListView.EmailItems);

window.ExitCommand.Click();
window.ExitButton.Click();


// Restart application and assert that first email was deleted
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public void AboutTest() => Run(() =>
{
Launch();
var window = GetShellWindow();
window.AboutCommand.Click();
window.AboutButton.Click();

var messageBox = window.FirstModalWindow().As<MessageBox>();
Assert.Equal("Waf Information Manager", messageBox.Title);
Expand All @@ -22,6 +22,6 @@ public void AboutTest() => Run(() =>
Capture.Screen().ToFile(GetScreenshotFile("About"));
messageBox.Buttons[0].Click();

window.ExitCommand.Click();
window.ExitButton.Click();
});
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

namespace UITest.InformationManager.Views;

// TODO: Consider to rename ..Command to ..Button
public class ShellWindow(FrameworkAutomationElementBase element) : Window(element)
{
public Button NewEmailCommand => this.Find("NewEmailCommand").AsButton();
Expand All @@ -17,9 +16,9 @@ public class ShellWindow(FrameworkAutomationElementBase element) : Window(elemen

public Button DeleteCommand => this.Find("DeleteCommand").AsButton();

public Button AboutCommand => this.Find("AboutCommand").AsButton();
public Button AboutButton => this.Find("AboutButton").AsButton();

public Button ExitCommand => this.Find("ExitCommand").AsButton();
public Button ExitButton => this.Find("ExitButton").AsButton();


public NavigationRootTreeItem RootTreeItem => this.Find("RootTreeItem").As<NavigationRootTreeItem>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@
</Grid.RowDefinitions>

<ToolBar x:Name="toolBar" Grid.ColumnSpan="2" Grid.Row="0">
<Button Command="{Binding AboutCommand}" ToolTip="Shows the about dialog." AutomationProperties.AutomationId="AboutCommand"><AccessText Text="_About"/></Button>
<Button Command="{Binding ExitCommand}" ToolTip="Close the application." AutomationProperties.AutomationId="ExitCommand"><AccessText Text="E_xit"/></Button>
<Button Command="{Binding AboutCommand}" ToolTip="Shows the about dialog." AutomationProperties.AutomationId="AboutButton"><AccessText Text="_About"/></Button>
<Button Command="{Binding ExitCommand}" ToolTip="Close the application." AutomationProperties.AutomationId="ExitButton"><AccessText Text="E_xit"/></Button>
</ToolBar>

<TreeView x:Name="navigationView" Grid.Column="0" Grid.Row="1" BorderThickness="0" Margin="0,0,4,0" AutomationProperties.AutomationId="NavigationTree">
Expand Down

0 comments on commit c792795

Please sign in to comment.