public void GivenIAmNowOnThePageIShouldCompleteTheChallenge(string challengeTitle)
        {
            switch (challengeTitle)
            {
            case "Challenge 1":
                ChallengeOne one = new ChallengeOne(driver);
                one.fillCorrectTextBox();
                one.clickSubmit();
                TestReport.Test().Pass("Challenge 1 successfull!");
                break;

            case "Challenge 2":
                ChallengeTwo two = new ChallengeTwo(driver);
                two.inputText();
                two.clickSubmit();
                TestReport.Test().Pass("Challenge 2 successfull!");
                break;

            case "Challenge 3":
                ChallengeThree three = new ChallengeThree(driver);
                three.InputText();
                three.clickSubmit();
                TestReport.Test().Pass("Challenge 3 successfull!");
                break;

            case "Challenge 4":
                ChallengeFour four = new ChallengeFour(driver);
                four.sortNumbers();
                four.clickSubmit();
                TestReport.Test().Pass("Challenge 4 successfull!");
                break;

            case "Challenge 5":
                ChallengeFive five = new ChallengeFive(driver);
                five.clickSubmit();
                TestReport.Test().Pass("Challenge 5 successfull!");
                break;

            case "Complete!":
                ChallengeFinish finish = new ChallengeFinish(driver);
                finish.verifyPageFinsihTitle(challengeTitle);
                TestReport.Test().Pass("Challenge Complete successfull!");
                break;

            default:
                TestReport.Test().Fail("Failure! The attemped Challenge has failed.");
                ScreenShot.takeScreenshot("FeatureFileError_" + ScenarioContext.Current.ScenarioInfo.Title, driver);
                throw new ArgumentException("Invalid page title entered");
            }
        }
        public void ThenIShouldBeOnThePage(string challengeTitle)
        {
            switch (challengeTitle)
            {
            case "Challenge 1":
                ChallengeOne one = new ChallengeOne(driver);
                one.verifyPageOneTitle(challengeTitle);
                break;

            case "Challenge 2":
                ChallengeTwo two = new ChallengeTwo(driver);
                two.verifyPageTwoTitle(challengeTitle);
                break;

            case "Challenge 3":
                ChallengeThree three = new ChallengeThree(driver);
                three.verifyPageThreeTitle(challengeTitle);
                break;

            case "Challenge 4":
                ChallengeFour four = new ChallengeFour(driver);
                four.verifyPageFourTitle(challengeTitle);
                break;

            case "Challenge 5":
                ChallengeFive five = new ChallengeFive(driver);
                five.verifyPageFiveTitle(challengeTitle);
                break;

            case "Complete!":
                ChallengeFinish finish = new ChallengeFinish(driver);
                finish.verifyPageFinsihTitle(challengeTitle);
                break;

            default:
                TestReport.Test().Fail("Failue! Unanle to verify title.");
                ScreenShot.takeScreenshot("FeatureFileError_" + ScenarioContext.Current.ScenarioInfo.Title, driver);
                throw new ArgumentException("Invalid page title entered");
            }
        }
Example #3
0
        public void StartProcess(object sender, EventArgs e)
        {
            var modifier = this.rbtnChallenge1.Checked ? 1 : 2;
            var result   = string.Empty;

            switch (this.challengeSelect.SelectedItem.ToString())
            {
            case "One":
                result = ChallengeOne.ChallengeOneResult(modifier);
                break;

            case "Two":
                result = ChallengeTwo.ChallengeTwoResult(modifier);
                break;

            case "Three":
                result = "I didn't do this one! :(";
                break;

            case "Four":
                result = ChallengeFour.ChallengeFourResult(modifier);
                break;

            case "Five":
                result = ChallengeFive.ChallengeFiveResult(modifier);
                break;

            default:
                break;
            }

            string            messageText    = result.ToString();
            string            messageCaption = string.Format("Challenge {0} output", this.challengeSelect.SelectedItem);
            MessageBoxButtons response       = MessageBoxButtons.OK;

            MessageBox.Show(messageText, messageCaption, response);
        }