2016-09-13 12:02:54 -07:00
|
|
|
|
using System;
|
2016-09-21 15:34:53 -07:00
|
|
|
|
using System.Threading;
|
2016-10-25 06:17:37 -07:00
|
|
|
|
using System.Threading.Tasks;
|
2016-09-13 12:02:54 -07:00
|
|
|
|
using MatterHackers.Agg.UI;
|
|
|
|
|
|
using MatterHackers.Agg.UI.Tests;
|
2016-09-21 15:34:53 -07:00
|
|
|
|
using MatterHackers.GuiAutomation;
|
2016-09-13 12:02:54 -07:00
|
|
|
|
using MatterHackers.MatterControl.SlicerConfiguration;
|
2016-09-21 15:34:53 -07:00
|
|
|
|
using NUnit.Framework;
|
2016-09-13 12:02:54 -07:00
|
|
|
|
|
|
|
|
|
|
namespace MatterHackers.MatterControl.Tests.Automation
|
|
|
|
|
|
{
|
2017-06-09 20:12:25 -07:00
|
|
|
|
[TestFixture, Category("MatterControl.UI.Automation"), RunInApplicationDomain, Apartment(ApartmentState.STA)]
|
2016-09-13 12:02:54 -07:00
|
|
|
|
public class PrinterNameChangePersists
|
|
|
|
|
|
{
|
2017-06-09 20:12:25 -07:00
|
|
|
|
[Test]
|
2016-10-25 06:17:37 -07:00
|
|
|
|
public async Task PrinterNameStaysChanged()
|
2016-09-13 12:02:54 -07:00
|
|
|
|
{
|
2017-06-09 20:12:25 -07:00
|
|
|
|
await MatterControlUtilities.RunTest((testRunner) =>
|
2016-09-13 12:02:54 -07:00
|
|
|
|
{
|
2018-02-08 15:42:07 -08:00
|
|
|
|
testRunner.WaitForFirstDraw();
|
2017-08-30 16:43:58 -07:00
|
|
|
|
|
2017-06-04 09:01:56 -07:00
|
|
|
|
testRunner.AddAndSelectPrinter("Airwolf 3D", "HD");
|
2016-09-13 12:02:54 -07:00
|
|
|
|
|
2017-12-28 09:02:44 -08:00
|
|
|
|
testRunner.SwitchToPrinterSettings();
|
2016-09-13 12:02:54 -07:00
|
|
|
|
|
2016-10-19 11:10:30 -07:00
|
|
|
|
string newName = "Updated name";
|
2018-01-24 17:49:16 -08:00
|
|
|
|
testRunner.InlineTitleEdit("Printer Name", newName);
|
2017-12-28 09:02:44 -08:00
|
|
|
|
|
|
|
|
|
|
// Force loose focus
|
2017-06-09 20:12:25 -07:00
|
|
|
|
testRunner.ClickByName("Printer Tab");
|
2017-12-28 09:02:44 -08:00
|
|
|
|
testRunner.Delay(1);
|
2016-09-13 12:02:54 -07:00
|
|
|
|
|
2016-10-19 11:10:30 -07:00
|
|
|
|
//Check to make sure the Printer dropdown gets the name change
|
2017-06-04 16:16:07 -07:00
|
|
|
|
testRunner.OpenPrintersDropdown();
|
|
|
|
|
|
Assert.IsTrue(testRunner.WaitForName(newName + " Menu Item"), "Widget with updated printer name exists");
|
2016-09-23 19:01:41 -07:00
|
|
|
|
|
2016-10-19 11:10:30 -07:00
|
|
|
|
//Make sure the Active profile name changes as well
|
2017-06-09 20:12:25 -07:00
|
|
|
|
Assert.AreEqual(newName, ProfileManager.Instance.ActiveProfile.Name, "ActiveProfile has updated name");
|
2016-10-25 06:17:37 -07:00
|
|
|
|
|
2017-06-04 08:35:29 -07:00
|
|
|
|
return Task.CompletedTask;
|
2017-06-09 20:12:25 -07:00
|
|
|
|
});
|
2016-09-13 12:02:54 -07:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|