Beispiel #1
0
            public void ReturnWithOutSave()
            {
                PropertiesCollection.test = PropertiesCollection.extent.CreateTest("TC03_ReturnWithoutSave");

                strTestCaseNo = "TC003_Reg";
                string[] testDataOrgGroup = FetchTestData(strTestCaseNo);

                string orgGroup      = testDataOrgGroup[3];
                string breakDuration = testDataOrgGroup[5];

                FpOrganisationGroupSettingsPage.NavigateToOrgGroupSettingsPage();
                Thread.Sleep(3000);

                FpOrganisationGroupSettingsPage.ClickEditOrgGroup(orgGroup);
                Thread.Sleep(3000);
                FpOrganisationGroupSettingsPage.ClearBreakDuration();
                Thread.Sleep(2000);
                FpOrganisationGroupSettingsPage.ClickReturn();
                Thread.Sleep(3000);

                string confirmationMsg = FpOrganisationGroupSettingsPage.GetConfirmationText();
                string expectedMsg     = "Any unsaved changes will be lost. Are you sure?";

                try
                {
                    Assert.AreEqual(confirmationMsg, expectedMsg);
                    PropertiesCollection.test.Log(Status.Pass, "Validation for confirmation message received when Return button is clicked without Save is successful");
                }
                catch
                {
                    PropertiesCollection.test.Log(Status.Fail, "Validation for confirmation message received when Return button is clicked without Save is not successful");
                }

                FpOrganisationGroupSettingsPage.ClickConfirmationCancel();
                Thread.Sleep(2000);

                FpOrganisationGroupSettingsPage.EnterBreakDuration(breakDuration);
                Thread.Sleep(2000);

                FpOrganisationGroupSettingsPage.ClickSave();
                Thread.Sleep(3000);
            }
Beispiel #2
0
            public void VerifyErrorMessage()
            {
                PropertiesCollection.test = PropertiesCollection.extent.CreateTest("TC02_VerifyErrorMessage");

                strTestCaseNo = "TC002_Reg";
                string[] testDataOrgGroup = FetchTestData(strTestCaseNo);

                string orgGroup            = testDataOrgGroup[3];
                string acknowledgementTime = testDataOrgGroup[8];
                string acknowledgementFor  = testDataOrgGroup[9];

                FpOrganisationGroupSettingsPage.NavigateToOrgGroupSettingsPage();
                Thread.Sleep(3000);

                FpOrganisationGroupSettingsPage.ClickEditOrgGroup(orgGroup);
                Thread.Sleep(3000);

                FpOrganisationGroupSettingsPage.ClearAcknowledgementTime();
                FpOrganisationGroupSettingsPage.ClickBreakDuration();
                Thread.Sleep(2000);

                string errorMsg    = FpOrganisationGroupSettingsPage.GetErrorMessageForAckTime();
                string expectedMsg = "An Acknowledgement Time is required.";

                try
                {
                    Assert.AreEqual(errorMsg, expectedMsg);
                    PropertiesCollection.test.Log(Status.Pass, "Validation for error message thrown when Acknowledgement time is null is successful");
                }
                catch
                {
                    PropertiesCollection.test.Log(Status.Fail, "Validation for error message thrown when Acknowledgement time is null is not successful");
                }

                FpOrganisationGroupSettingsPage.EnterAcknowledgementTime(acknowledgementTime);
                Thread.Sleep(2000);

                FpOrganisationGroupSettingsPage.ClearAcknowledgementDays();
                FpOrganisationGroupSettingsPage.ClickBreakDuration();
                Thread.Sleep(2000);

                errorMsg    = FpOrganisationGroupSettingsPage.GetErrorMessageForAckFor();
                expectedMsg = "An Acknowledgement For is required.";

                try
                {
                    Assert.AreEqual(errorMsg, expectedMsg);
                    PropertiesCollection.test.Log(Status.Pass, "Validation for error message thrown when Acknowledgement for is null is successful");
                }
                catch
                {
                    PropertiesCollection.test.Log(Status.Fail, "Validation for error message thrown when Acknowledgement for is null is not successful");
                }

                FpOrganisationGroupSettingsPage.EnterAcknowledgementDays(acknowledgementFor);
                Thread.Sleep(2000);

                FpOrganisationGroupSettingsPage.ClickSave();

                Thread.Sleep(2000);
            }