def test_b_LoginLogout(self):
        try:
            #try to signin
            setup_login.fischer_login(self.driver, "sls1231")
        except:
            #login failed, lets take a screenshot
            #TODO: Screenshot
            #Fail the test
            assert 2 == 1

        dashboard_navigate.gotoRequestAccess(self.driver)

        dashboard_navigate.selectIncludeSelf(self.driver)

        dashboard_navigate.selectDropdownOption(self.driver,
                                                "Official website")

        dashboard_navigate.selectDropdownOption(self.driver, "Create website")

        time.sleep(10)

        try:
            #try to signout
            setup_login.fischer_logout(self.driver)
        except:
            #logout failed, lets take a screenshot
            #TODO: Screenshot
            #Fail the test
            assert 2 == 1
Exemple #2
0
    def test_initial_steps(self):
        # Set drivers from selenium framework
        driver = self.driver
        self.driver.get("https://idm-prov-dev.humboldt.edu/identity/self-service/hsu/login.jsf")

        # Login as a user and navigate to Requests and Request Accesss
        setup_login.fischer_login(driver, "sls1231")
        dashboard_navigate.gotoRequestAccess(driver)
        dashboard_navigate.selectIncludeSelf(driver)

        # Select from the dropdown options under "Select resources and permissions"
        dashboard_navigate.selectDropdownOption(driver, "Network Folder")
        network_folder_check(driver)

        dashboard_navigate.selectDropdownOption(driver, "Official website")
        official_websiteCheck(driver)

        dashboard_navigate.selectDropdownOption(driver,"Departmental Email Account")
        departmental_email_account_check(driver)

        dashboard_navigate.selectDropdownOption(driver,"IT Admin")
        it_admin_check(driver)

        dashboard_navigate.selectDropdownOption(driver, "Personal website")
        personal_website_check(driver)
Exemple #3
0
    def test_c_Test(self):
        dashboard_navigate.gotoRequestAccess(self.driver)
        dashboard_navigate.selectIncludeSelf(self.driver)

        dashboard_navigate.selectDropdownOption(self.driver,
                                                "Official website")

        official_websiteCheck(self.driver, "non-employee")
Exemple #4
0
def personal_website_check(driver):
    #Navitage to personal website
    dashboard_navigate.selectDropdownOption(driver, "Personal website")

    xpathstart = "//label[contains(text(),"
    xpathend = ")]"
    for i in folder_list:
        WebDriverWait(driver, 30).until(
            expected_conditions.presence_of_element_located(
                (By.XPATH, xpathstart + "'" + i + "'" + xpathend)))
Exemple #5
0
def network_folder_check(driver):
    #navigate to network folder
    dashboard_navigate.selectDropdownOption(driver, "Network Folder")

    xpathstart = "//label[contains(text(),"
    xpathend = ")]"
    for i in folder_list:
        WebDriverWait(driver, 30).until(
            expected_conditions.presence_of_element_located(
                (By.XPATH, xpathstart + "'" + i + "'" + xpathend))).text
Exemple #6
0
def it_admin_check(driver):
    #Go to IT Admin dropdown and click on it
    dashboard_navigate.selectDropdownOption(driver, "IT Admin")

    for label in folder_list:
        #Build xpath
        xpathstart = "//label[contains(text(),'"
        xpathend = "')]"
        #Run contains check using thestring of the label getting it from the dictionary
        WebDriverWait(driver, 30).until(expected_conditions.presence_of_element_located((By.XPATH, xpathstart + label + xpathend)))
Exemple #7
0
def departmental_email_account_check(driver):
    #Navgate to deparment email by selecting it as a dropdown option
    dashboard_navigate.selectDropdownOption(driver,
                                            "Departmental Email Account")

    xpathstart = "//label[contains(text(),"
    xpathend = ")]"
    for i in folder_list:
        WebDriverWait(driver, 30).until(
            expected_conditions.presence_of_element_located(
                (By.XPATH, xpathstart + "'" + i + "'" + xpathend)))
    def test_employeeUsername_mb1(self):
        # Set drivers from selenium framework
        driver = self.driver
        self.driver.get(
            "https://idm-prov-dev.humboldt.edu/identity/self-service/hsu/login.jsf"
        )

        # Login as a user and navigate to Requests and Request Accesss
        setup_login.fischer_login(driver, "mb1")
        dashboard_navigate.gotoRequestAccess(driver)
        dashboard_navigate.selectIncludeSelf(driver)

        # Select from the dropdown options under "Select resources and permissions"
        dashboard_navigate.selectDropdownOption(driver, "Network Folder")
        network_folder_check(driver)
    def test_Non_Employee_ATI_wwh36(self):
        # Set drivers from selenium framework
        driver = self.driver
        self.driver.get(
            "https://idm-prov-dev.humboldt.edu/identity/self-service/hsu/login.jsf"
        )

        # Login as a user and navigate to Requests and Request Accesss
        setup_login.fischer_login(driver, "wwh36")
        dashboard_navigate.gotoRequestAccess(driver)
        dashboard_navigate.selectIncludeSelf(driver)

        # Select from the dropdown options under "Select resources and permissions"
        dashboard_navigate.selectDropdownOption(driver, "Official website")
        official_websiteCheck(driver, "non-employee")
Exemple #10
0
def official_websiteCheck(driver, usertype):

    Web_dict = getPermisionDict(usertype)

    #Navigate to "Ofical website"
    dashboard_navigate.selectDropdownOption(driver, "Official website")

    #Try to select offical website
    #dashboard_navigate.selectDropdownOption(driver, "Official website")
    #For each permison(Option)
    for permision in Web_dict:
        #Try to select permison
        dashboard_navigate.selectDropdownOption(driver, permision)
        #Make sure each label exists on the page once we select the permision if the permison has labels
        for label in Web_dict[permision]:
            #Build xpath
            xpathstart = "//label[contains(text(),'"
            xpathend = "')]"
            time.sleep(1)
            #Run contains check using thestring of the label getting it from the dictionary
            WebDriverWait(driver, 30).until(
                expected_conditions.presence_of_element_located(
                    (By.XPATH, xpathstart + label + xpathend)))
    def test_add_remove_site(self):
        # Set drivers from selenium framework
        driver = self.driver
        self.driver.get(
            "https://idm-prov-dev.humboldt.edu/identity/self-service/hsu/login.jsf"
        )

        # Login as a user and navigate to Requests and Request Accesss
        setup_login.fischer_login(driver, "sls1231")
        dashboard_navigate.gotoRequestAccess(driver)
        dashboard_navigate.selectIncludeSelf(driver)
        time.sleep(2)
        dashboard_navigate.selectDropdownOption(driver, 'Official website')
        dashboard_navigate.selectDropdownOption(driver, 'Create website')
        dashboard_navigate.selectCheckbox(driver, 'Official website')
        dashboard_navigate.enterTextInDatafield(driver, 'Website Name:',
                                                "Selenium_test_site")
        dashboard_navigate.clickButton(driver, 'Continue')
        WebDriverWait(driver, 30).until(
            expected_conditions.presence_of_element_located(
                (By.XPATH, "//*[@value='Continue']"))).click()

        time.sleep(100)