Skip to content

Commit

Permalink
Update app id, fix test failures
Browse files Browse the repository at this point in the history
  • Loading branch information
marcelwgn authored and karkarl committed Aug 24, 2023
1 parent 345dccb commit 23933a2
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 35 deletions.
4 changes: 2 additions & 2 deletions UITests/Button.cs
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ public void Size()
[TestMethod]
public void Text()
{
Assert.AreEqual("Button", buttonElement.Text);
Assert.AreEqual("Standard XAML button", buttonElement.Text);
}
}
}
}
6 changes: 3 additions & 3 deletions UITests/RadioButton.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,10 @@ public void Click()
var radioButtonEventOutput = session.FindElementByAccessibilityId("Control1Output");

radioButtonElement1.Click();
Assert.AreEqual("You selected option 1.", radioButtonEventOutput.Text);
Assert.AreEqual("You selected Option 1", radioButtonEventOutput.Text);

radioButtonElement2.Click();
Assert.AreEqual("You selected option 2.", radioButtonEventOutput.Text);
Assert.AreEqual("You selected Option 2", radioButtonEventOutput.Text);
}

[TestMethod]
Expand Down Expand Up @@ -123,4 +123,4 @@ public void Text()
Assert.AreEqual("Option 2", radioButtonElement2.Text);
}
}
}
}
8 changes: 4 additions & 4 deletions UITests/TextBox.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ public void Clear()
{
textBoxElement1.Clear();
Assert.AreEqual(string.Empty, textBoxElement1.Text);
textBoxElement1.SendKeys("fghij67890^&*()");
Assert.AreEqual("fghij67890^&*()", textBoxElement1.Text);
textBoxElement1.SendKeys("fghij");
Assert.AreEqual("fghij", textBoxElement1.Text);
textBoxElement1.Clear();
Assert.AreEqual(string.Empty, textBoxElement1.Text);
}
Expand All @@ -65,7 +65,7 @@ public void Clear()
public void Click()
{
// Click textBoxElement1 to set focus and arbitrarily type
//textBoxElement1.Clear();
textBoxElement1.Clear();
Assert.AreEqual(string.Empty, textBoxElement1.Text);
textBoxElement1.Click();
session.Keyboard.SendKeys("1234567890");
Expand Down Expand Up @@ -141,4 +141,4 @@ public void Text()
Assert.AreEqual("abcde12345!@#$%", textBoxElement1.Text);
}
}
}
}
9 changes: 0 additions & 9 deletions UITests/UITestSettings.runsettings

This file was deleted.

6 changes: 3 additions & 3 deletions UITests/base.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ public class Test_Base
{
private const string WindowsApplicationDriverUrl = "http://127.0.0.1:4723";
#if DEBUG
private const string AppUIBasicAppId = "Microsoft.XAMLControlsGallery.Debug_8wekyb3d8bbwe!App";
private const string AppUIBasicAppId = "Microsoft.WinUI3ControlsGallery.Debug_s9y1p3hwd5qda!App";
#else
private const string AppUIBasicAppId = "Microsoft.XAMLControlsGallery_8wekyb3d8bbwe!App";
private const string AppUIBasicAppId = "Microsoft.WinUI3ControlsGallery_s9y1p3hwd5qda!App";
#endif
protected static WindowsDriver<WindowsElement> session = null;

Expand All @@ -48,7 +48,7 @@ public static void Setup(TestContext context)
catch
{ }
Thread.Sleep(125000);
if (session == null)
if (session == null)
{
session = new WindowsDriver<WindowsElement>(new Uri(WindowsApplicationDriverUrl), appiumOptions);
}
Expand Down
10 changes: 0 additions & 10 deletions UITests/packages.config

This file was deleted.

7 changes: 3 additions & 4 deletions WinUIGallery/ControlPages/RadioButtonPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,9 @@
<local:ControlExample HeaderText="A group of RadioButton controls in a RadioButtons group.">
<StackPanel>
<RadioButtons Header="Options:">
<RadioButton Content="Option 1" Checked="RadioButton_Checked" />
<RadioButton Content="Option 2" Checked="RadioButton_Checked" />
<RadioButton Content="Option 3" Checked="RadioButton_Checked" />
</RadioButtons>
<RadioButton Content="Option 1" Checked="RadioButton_Checked" AutomationProperties.AutomationId="Option1RadioButton"/>
<RadioButton Content="Option 2" Checked="RadioButton_Checked" AutomationProperties.AutomationId="Option2RadioButton"/>
<RadioButton Content="Option 3" Checked="RadioButton_Checked" AutomationProperties.AutomationId="Option3RadioButton"/> </RadioButtons>
</StackPanel>
<local:ControlExample.Output>
<TextBlock x:Name="Control1Output" Text="Select an option." />
Expand Down

0 comments on commit 23933a2

Please sign in to comment.