Example #1
0
        public static void Setup(Microsoft.VisualStudio.TestTools.UnitTesting.TestContext _context)
        {
            var applicationDir  = _context.DeploymentDirectory;
            var applicationPath = Path.Combine(applicationDir, "..\\..\\..\\UnitTestProject1\\bin\\Debug\\Good_Night");

            application      = Application.Launch(applicationPath);
            window           = application.GetWindow("MainWindow", InitializeOption.NoCache);
            home_button      = window.Get <Button>("HomeButton");
            data_button      = window.Get <Button>("DataButton");
            lastnight_button = window.Get <Button>("LastNightButton");
            date_picker      = window.Get <WpfDatePicker>("DatePicker");
            morningbutton_1  = window.Get <RadioButton>("MorningButton1");
            morningbutton_2  = window.Get <RadioButton>("MorningButton2");
            morningbutton_3  = window.Get <RadioButton>("MorningButton3");
            morningbutton_4  = window.Get <RadioButton>("MorningButton4");
            morningbutton_5  = window.Get <RadioButton>("MorningButton5");
            morningbutton_6  = window.Get <RadioButton>("MorningButton6");
            morningbutton_7  = window.Get <RadioButton>("MorningButton7");
            morningbutton_8  = window.Get <RadioButton>("MorningButton8");
            morningbutton_9  = window.Get <RadioButton>("MorningButton9");
            morningbutton_10 = window.Get <RadioButton>("MorningButton10");
            daybutton_1      = window.Get <RadioButton>("DayButton1");
            daybutton_2      = window.Get <RadioButton>("DayButton2");
            daybutton_3      = window.Get <RadioButton>("DayButton3");
            daybutton_4      = window.Get <RadioButton>("DayButton4");
            daybutton_5      = window.Get <RadioButton>("DayButton5");
            daybutton_6      = window.Get <RadioButton>("DayButton6");
            daybutton_7      = window.Get <RadioButton>("DayButton7");
            daybutton_8      = window.Get <RadioButton>("DayButton8");
            daybutton_9      = window.Get <RadioButton>("DayButton9");
            daybutton_10     = window.Get <RadioButton>("DayButton10");
            submit_button    = window.Get <Button>("Submit");
        }
 public WpfDatePickerControlPageModelWrapper(WpfDatePicker datePicker, TNextModel nextModel, string formatString, IFormatProvider formatProvider)
     : this(datePicker,
            nextModel,
            StandardFunctionProvider.StringToNullableDate(formatString, formatProvider),
            StandardFunctionProvider.NullableDateToString(formatString, formatProvider))
 {
 }
Example #3
0
        public void TestZeroState()
        {
            Button        home_button      = window.Get <Button>("HomeButton");
            Button        data_button      = window.Get <Button>("DataButton");
            Button        lastnight_button = window.Get <Button>("LastNightButton");
            WpfDatePicker date_picker      = window.Get <WpfDatePicker>("DatePicker");

            RadioButton morningbutton_1  = window.Get <RadioButton>("MorningButton1");
            RadioButton morningbutton_2  = window.Get <RadioButton>("MorningButton2");
            RadioButton morningbutton_3  = window.Get <RadioButton>("MorningButton3");
            RadioButton morningbutton_4  = window.Get <RadioButton>("MorningButton4");
            RadioButton morningbutton_5  = window.Get <RadioButton>("MorningButton5");
            RadioButton morningbutton_6  = window.Get <RadioButton>("MorningButton6");
            RadioButton morningbutton_7  = window.Get <RadioButton>("MorningButton7");
            RadioButton morningbutton_8  = window.Get <RadioButton>("MorningButton8");
            RadioButton morningbutton_9  = window.Get <RadioButton>("MorningButton9");
            RadioButton morningbutton_10 = window.Get <RadioButton>("MorningButton10");

            RadioButton daybutton_1  = window.Get <RadioButton>("DayButton1");
            RadioButton daybutton_2  = window.Get <RadioButton>("DayButton2");
            RadioButton daybutton_3  = window.Get <RadioButton>("DayButton3");
            RadioButton daybutton_4  = window.Get <RadioButton>("DayButton4");
            RadioButton daybutton_5  = window.Get <RadioButton>("DayButton5");
            RadioButton daybutton_6  = window.Get <RadioButton>("DayButton6");
            RadioButton daybutton_7  = window.Get <RadioButton>("DayButton7");
            RadioButton daybutton_8  = window.Get <RadioButton>("DayButton8");
            RadioButton daybutton_9  = window.Get <RadioButton>("DayButton9");
            RadioButton daybutton_10 = window.Get <RadioButton>("DayButton10");

            Assert.IsTrue(home_button.Enabled);
            Assert.IsTrue(data_button.Enabled);
            Assert.IsTrue(lastnight_button.Enabled);
            Assert.IsTrue(date_picker.Enabled);
            Assert.IsTrue(morningbutton_1.Enabled);
            Assert.IsTrue(morningbutton_2.Enabled);
            Assert.IsTrue(morningbutton_3.Enabled);
            Assert.IsTrue(morningbutton_4.Enabled);
            Assert.IsTrue(morningbutton_5.Enabled);
            Assert.IsTrue(morningbutton_6.Enabled);
            Assert.IsTrue(morningbutton_7.Enabled);
            Assert.IsTrue(morningbutton_8.Enabled);
            Assert.IsTrue(morningbutton_9.Enabled);
            Assert.IsTrue(morningbutton_10.Enabled);
            Assert.IsTrue(daybutton_1.Enabled);
            Assert.IsTrue(daybutton_2.Enabled);
            Assert.IsTrue(daybutton_3.Enabled);
            Assert.IsTrue(daybutton_4.Enabled);
            Assert.IsTrue(daybutton_5.Enabled);
            Assert.IsTrue(daybutton_6.Enabled);
            Assert.IsTrue(daybutton_7.Enabled);
            Assert.IsTrue(daybutton_8.Enabled);
            Assert.IsTrue(daybutton_9.Enabled);
            Assert.IsTrue(daybutton_10.Enabled);
        }
Example #4
0
        /// <summary>
        /// Negativtest - Verwenden Sie "NegativtestParams", um Parameter an diese Methode zu übergeben.
        /// </summary>
        public void Negativtest()
        {
            #region Variable Declarations
            WinEdit       uINameEdit                  = this.UIDebugWindow.UIItemWindow.UILb120_2_BibliothekexListItem.UINameEdit;
            WpfButton     uIBücherButton              = this.UIMainWindowWindow.UIBücherButton;
            WpfText       uIAforbeginnersText         = this.UIMainWindowWindow.UIItemCustom2.UIDataGridTable.UIItem166Row.UIAforbeginnersCell.UIAforbeginnersText;
            WpfDatePicker uIDtpStartDatePicker        = this.UIMainWindowWindow.UIScrollViewerPane.UIDtpStartDatePicker;
            WpfDatePicker uIDtpEndDatePicker          = this.UIMainWindowWindow.UIScrollViewerPane.UIDtpEndDatePicker;
            WpfComboBox   uICbxKundeComboBox          = this.UIMainWindowWindow.UIScrollViewerPane.UICbxKundeComboBox;
            WpfButton     uISpeichernButton           = this.UIMainWindowWindow.UIScrollViewerPane.UISpeichernButton;
            WpfText       uIDatumüberschneidetsiText1 = this.UIMainWindowWindow.UIItemCustom1.UIGespeichertText.UIDatumüberschneidetsiText1;
            WpfButton     uIZurückButton              = this.UIMainWindowWindow.UIScrollViewerPane.UIZurückButton;
            WinButton     uISchließenButton           = this.UIMainWindowWindow1.UISchließenButton;
            #endregion

            // Doppelklicken "Name" Textfeld
            Mouse.DoubleClick(uINameEdit, new Point(234, 10));

            // Klicken "Bücher" Schaltfläche
            Mouse.Click(uIBücherButton, new Point(78, 12));

            // Doppelklicken "A# for beginners" Bezeichnung
            Mouse.DoubleClick(uIAforbeginnersText, new Point(82, 10));

            // "06-Jun-2018" in "dtpStart" Datumsauswahl auswählen
            uIDtpStartDatePicker.DateAsString = this.NegativtestParams.UIDtpStartDatePickerDateAsString;

            // "01-Dec-2018" in "dtpEnd" Datumsauswahl auswählen
            uIDtpEndDatePicker.DateAsString = this.NegativtestParams.UIDtpEndDatePickerDateAsString;

            // "111" in "cbxKunde" Kombinationsfeld auswählen
            uICbxKundeComboBox.SelectedItem = this.NegativtestParams.UICbxKundeComboBoxSelectedItem;

            // Klicken "Speichern" Schaltfläche
            Mouse.Click(uISpeichernButton, new Point(44, 11));

            // Klicken "Datum überschneidet sich mit einer anderen Ausleih..." Bezeichnung
            Mouse.Click(uIDatumüberschneidetsiText1, new Point(81, 11));

            // Klicken "Zurück" Schaltfläche
            Mouse.Click(uIZurückButton, new Point(49, 13));

            // Klicken "Schließen" Schaltfläche
            Mouse.Click(uISchließenButton, new Point(23, 20));
        }
Example #5
0
        /// <summary>
        /// Einsatz_Erstellen - Verwenden Sie "Einsatz_ErstellenParams", um Parameter an diese Methode zu übergeben.
        /// </summary>
        public void Einsatz_Erstellen()
        {
            #region Variable Declarations
            WinListItem   uIM120LB2FS16ListItem = this.UIDebugWindow.UIItemWindow.UIElementansichtList.UIM120LB2FS16ListItem;
            WinEdit       uINameEdit            = this.UIDebugWindow.UIItemWindow.UIM120LB2FS16ListItem.UINameEdit;
            WpfButton     uINeuButton           = this.UIMainWindowWindow.UINeuButton;
            WpfComboBox   uIMitarbeiterComboBox = this.UIEinzelAnsichtWindow.UIMitarbeiterComboBox;
            WpfDatePicker uIDatumDatePicker     = this.UIEinzelAnsichtWindow.UIDatumDatePicker;
            WpfEdit       uIStart_zeitEdit      = this.UIEinzelAnsichtWindow.UIStart_zeitEdit;
            WpfEdit       uIEnd_zeitEdit        = this.UIEinzelAnsichtWindow.UIEnd_zeitEdit;
            WpfButton     uISpeichernButton     = this.UIEinzelAnsichtWindow.UISpeichernButton;
            #endregion

            // "Alt + p" in "M120-LB2-FS16" Listenelement eingeben
            Keyboard.SendKeys(uIM120LB2FS16ListItem, this.Einsatz_ErstellenParams.UIM120LB2FS16ListItemSendKeys, ModifierKeys.Alt);

            // Doppelklicken "Name" Textfeld
            Mouse.DoubleClick(uINameEdit, new Point(128, 9));

            // Klicken "Neu" Schaltfläche
            Mouse.Click(uINeuButton, new Point(28, 6));

            // "Anton Affolter" in "mitarbeiter" Kombinationsfeld auswählen
            uIMitarbeiterComboBox.SelectedItem = this.Einsatz_ErstellenParams.UIMitarbeiterComboBoxSelectedItem;

            // "06-Jun-2016" in "datum" Datumsauswahl auswählen
            uIDatumDatePicker.DateAsString = this.Einsatz_ErstellenParams.UIDatumDatePickerDateAsString;

            // "08:00" in "start_zeit" Textfeld eingeben
            uIStart_zeitEdit.Text = this.Einsatz_ErstellenParams.UIStart_zeitEditText;

            // "{Tab}" in "start_zeit" Textfeld eingeben
            Keyboard.SendKeys(uIStart_zeitEdit, this.Einsatz_ErstellenParams.UIStart_zeitEditSendKeys, ModifierKeys.None);

            // "15:00" in "end_zeit" Textfeld eingeben
            uIEnd_zeitEdit.Text = this.Einsatz_ErstellenParams.UIEnd_zeitEditText;

            // Klicken "Speichern" Schaltfläche
            Mouse.Click(uISpeichernButton, new Point(56, 8));
        }
        /// <summary>
        /// CreatingNewDTMethod - Use 'CreatingNewDTMethodParams' to pass parameters into this method.
        /// </summary>
        public void CreatingNewDTMethod()
        {
            #region Variable Declarations
            WpfButton     uINewButton = this.UICareTendWindow.UINewButton;
            WpfDatePicker uITargetDeliveryDateDatePicker = this.UICareTendWindow.UIItemCustom.UITabsControlTabList.UIDeliveryInstructionsTabPage.UITargetDeliveryDateDatePicker;
            WpfComboBox   uIDeliveryCompanyComboBox      = this.UICareTendWindow.UIItemCustom.UITabsControlTabList.UIDeliveryInstructionsTabPage.UIDeliveryCompanyComboBox;
            #endregion

            // Click 'New' button
            Mouse.Click(uINewButton, new Point(36, 10));
            Playback.Wait(5000);

            // Select Date in date picker
            Keyboard.SendKeys("{Ctrl}" + "{Insert}");
            Playback.Wait(5000);

            // Select 'Roger's Ohio Company' in 'DeliveryCompany' combo box
            Mouse.Click(uIDeliveryCompanyComboBox);
            Keyboard.SendKeys("Roger's Ohio Company");
            Keyboard.SendKeys("{Enter}");
            Playback.Wait(5000);
        }
 public WpfDatePickerControlPageModelWrapper(WpfDatePicker datePicker, TNextModel nextModel, Func <string, DateTime?> stringToDateFunc, Func <DateTime?, string> dateFormatFunction)
     : base(datePicker, nextModel, stringToDateFunc, dateFormatFunction)
 {
 }
Example #8
0
 public static IReadWriteTextValuePageModel <DateTime?, TNextModel> AsPageModel <TNextModel>(this WpfDatePicker datePicker, TNextModel nextModel, Func <string, DateTime?> stringToValueFunc, Func <DateTime?, string> valueToStringFunc) where TNextModel : IPageModel
 {
     return(new WpfDatePickerControlPageModelWrapper <TNextModel>(datePicker, nextModel, stringToValueFunc, valueToStringFunc));
 }
Example #9
0
 public static WpfDatePicker 输入(this WpfDatePicker control, string value)
 {
     control.DateAsString = value;
     return(control);
 }