Exemplo n.º 1
0
        public void CheckIfUserCanSetStop()
        {
            AlarmClockPage alarm = new AlarmClockPage();

            alarm.startApp();
            var txtBox = alarm.editBox("Set time to invoke alarm:");

            txtBox.Text = alarm.timeToSet();

            var btn_set = alarm.uIBtn("Set");

            Mouse.Click(btn_set);

            var btn_stop = alarm.uIBtn("Stop");

            Mouse.Click(btn_stop);

            var lblSetActual = alarm.lblAlarmText("00:00:00").FriendlyName.ToString();

            Assert.AreEqual("00:00:00", lblSetActual);
        }
Exemplo n.º 2
0
        public void CheckIfUserCanSetAlarm()
        {
            bool validator = true;

            try
            {
                AlarmClockPage alarm = new AlarmClockPage();
                alarm.startApp();
                var txtBox = alarm.editBox("Set time to invoke alarm:");
                txtBox.Text = alarm.timeToSet();

                var btn_set = alarm.uIBtn("Set");
                Mouse.Click(btn_set);
            }
            catch (Exception e)
            {
                validator = false;
                Console.WriteLine(e);
            }
            Assert.IsTrue(validator);
        }
Exemplo n.º 3
0
        public void CheckIfAlarmIsTriggered()
        {
            var expectedAlarmVal = "Alarm!";

            AlarmClockPage alarm = new AlarmClockPage();

            alarm.startApp();
            var txtBox = alarm.editBox("Set time to invoke alarm:");

            txtBox.Text = alarm.timeToSet();

            var btn_set = alarm.uIBtn("Set");

            Mouse.Click(btn_set);

            Thread.Sleep(TimeSpan.FromSeconds(10));

            AlarmPopupPage popup          = new AlarmPopupPage();
            var            actualAlarmVal = popup.alarmText("Alarm!").DisplayText.ToString();

            Assert.AreEqual(expectedAlarmVal, actualAlarmVal);
        }