public void TestSetup() { // extent reports setup test = ExtentTestManager.StartTest(TestContext.Properties["TestCaseName"].ToString(), TestContext.Properties["TestCaseDescription"].ToString()) .AssignCategory("Regression"); // browser setup Driver = SetUp(_BT); Driver.Manage().Window.Maximize(); BrowseTo("https://phlaptweb7.applitrack.com/devmichaelf", Driver); //BrowseTo(BaseUrls["ApplitrackLoginPage"], Driver); var loginWorkflows = new LoginWorkflows(Driver); //loginWorkflows.LoginAsSuperUser(); loginWorkflows.Login("admin", "27157"); }
[Ignore] // TODO do not use Bill Nye public void Permissions_InterviewQuestionnaire_Button_Not_Displayed() { Console.WriteLine("WindowHandle at Start: " + Driver.GetHashCode().ToString()); // pages var applicantProfilePage = new ApplicantProfilePages(Driver); var applicantMenu = new ApplicantAdminMenu(Driver); // workflows var searchWorkflows = new SearchWorkflows(Driver); var loginWorkflows = new LoginWorkflows(Driver); // applicant data const string appNo = "1"; const string appName = "Sample Applicant"; try //Contains Contents of Test { //test.Log(LogStatus.Info, "Starting test at URL: " + BaseUrls["ApplitrackLoginPage"]); loginWorkflows.Login("BillNye", "BillNye"); test.Log(LogStatus.Pass, "Logging in as BillNye"); searchWorkflows.OpenApplicantUsingSearch(appNo, appName); Driver.SwitchToFrameById("App" + appNo); test.Log(LogStatus.Pass, "Search for and open applicant: " + appNo + appName); applicantMenu.ClickInterviews(); test.Log(LogStatus.Pass, "Click Interviews"); Assert.IsFalse(applicantProfilePage.Interviews.IsFillOutInterviewQuestionnaireVisible()); test.Log(LogStatus.Pass, "The 'Fill Out Interview Questionnaire' button is visible"); } catch (Exception e) //On Error Do { HandleException(e, Driver); throw; } }
[Ignore] // TODO figure out how to handle this test for both standard and IDM logins public void Login_with_Invalid_UserID_and_Invalid_PW() { // page objects var toolbar = ToolbarFactory.Get(Driver); // workflows var loginWorkflow = new LoginWorkflows(Driver); try // Contents of the test { loginWorkflow.Login("INVALID", "INVALID"); // Assert that the login failed Assert.IsFalse(toolbar.IsDisplayed(), "The invalid login was successful"); test.Log(LogStatus.Pass, "Login was unsuccessful"); } catch (Exception e) //On Error Do { HandleException(e, Driver); throw; } }