2015-08-22 16:14:31 -07:00
|
|
|
|
/*
|
|
|
|
|
|
Copyright (c) 2014, Lars Brubaker
|
|
|
|
|
|
All rights reserved.
|
|
|
|
|
|
|
|
|
|
|
|
Redistribution and use in source and binary forms, with or without
|
|
|
|
|
|
modification, are permitted provided that the following conditions are met:
|
|
|
|
|
|
|
|
|
|
|
|
1. Redistributions of source code must retain the above copyright notice, this
|
|
|
|
|
|
list of conditions and the following disclaimer.
|
|
|
|
|
|
2. Redistributions in binary form must reproduce the above copyright notice,
|
|
|
|
|
|
this list of conditions and the following disclaimer in the documentation
|
|
|
|
|
|
and/or other materials provided with the distribution.
|
|
|
|
|
|
|
|
|
|
|
|
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
|
|
|
|
|
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
|
|
|
|
|
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
|
|
|
|
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
|
|
|
|
|
|
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
|
|
|
|
|
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
|
|
|
|
|
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
|
|
|
|
|
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
|
|
|
|
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
|
|
|
|
|
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
|
|
|
|
|
|
|
|
|
|
The views and conclusions contained in the software and documentation are those
|
|
|
|
|
|
of the authors and should not be interpreted as representing official policies,
|
|
|
|
|
|
either expressed or implied, of the FreeBSD Project.
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
2016-09-21 15:34:53 -07:00
|
|
|
|
using System;
|
|
|
|
|
|
using System.Threading;
|
2016-10-25 06:17:37 -07:00
|
|
|
|
using System.Threading.Tasks;
|
2015-08-22 16:14:31 -07:00
|
|
|
|
using MatterHackers.Agg.UI;
|
2016-05-11 09:13:56 -07:00
|
|
|
|
using MatterHackers.Agg.UI.Tests;
|
|
|
|
|
|
using MatterHackers.GuiAutomation;
|
2015-08-22 16:14:31 -07:00
|
|
|
|
using NUnit.Framework;
|
|
|
|
|
|
|
2016-05-11 09:13:56 -07:00
|
|
|
|
namespace MatterHackers.MatterControl.Tests.Automation
|
2015-08-22 16:14:31 -07:00
|
|
|
|
{
|
2018-04-30 15:40:47 -07:00
|
|
|
|
[TestFixture, Category("MatterControl.UI.Automation"), Apartment(ApartmentState.STA), RunInApplicationDomain]
|
2015-09-01 10:26:14 -07:00
|
|
|
|
public class CreateLibraryFolder
|
2015-08-22 16:14:31 -07:00
|
|
|
|
{
|
2016-10-25 06:17:37 -07:00
|
|
|
|
[Test, Apartment(ApartmentState.STA)]
|
2017-10-30 22:34:55 -07:00
|
|
|
|
public async Task CreateFolderStartsWithTextFieldFocusedAndEditable()
|
2015-08-22 16:14:31 -07:00
|
|
|
|
{
|
2017-10-30 22:34:55 -07:00
|
|
|
|
await MatterControlUtilities.RunTest((testRunner) =>
|
2015-08-22 16:14:31 -07:00
|
|
|
|
{
|
2022-02-03 17:21:51 -08:00
|
|
|
|
testRunner.OpenPartTab();
|
2016-07-29 16:44:00 -07:00
|
|
|
|
|
2016-10-26 06:49:50 -07:00
|
|
|
|
testRunner.NavigateToFolder("Local Library Row Item Collection");
|
2018-04-07 11:21:02 -07:00
|
|
|
|
testRunner.InvokeLibraryCreateFolderDialog();
|
2015-08-24 14:15:01 -07:00
|
|
|
|
|
2017-02-01 10:12:31 -08:00
|
|
|
|
testRunner.Delay(.5);
|
2016-10-19 11:10:30 -07:00
|
|
|
|
testRunner.Type("Test Text");
|
2017-02-01 10:12:31 -08:00
|
|
|
|
testRunner.Delay(.5);
|
2015-08-22 16:14:31 -07:00
|
|
|
|
|
2017-10-30 22:34:55 -07:00
|
|
|
|
var textWidgetMH = testRunner.GetWidgetByName("InputBoxPage TextEditWidget", out _) as MHTextEditWidget;
|
|
|
|
|
|
|
2016-10-25 06:17:37 -07:00
|
|
|
|
Assert.IsTrue(textWidgetMH != null, "Found Text Widget");
|
|
|
|
|
|
Assert.IsTrue(textWidgetMH.Text == "Test Text", "Had the right text");
|
2017-10-30 22:34:55 -07:00
|
|
|
|
|
|
|
|
|
|
testRunner.ClickByName("Cancel Wizard Button");
|
2017-02-01 10:12:31 -08:00
|
|
|
|
testRunner.Delay(.5);
|
2016-10-25 06:17:37 -07:00
|
|
|
|
|
2017-06-04 08:35:29 -07:00
|
|
|
|
return Task.CompletedTask;
|
2017-10-30 22:34:55 -07:00
|
|
|
|
});
|
2015-08-22 16:14:31 -07:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|