private void testEditInstructorAction() throws Exception {

    ______TS("failure: ajax error on clicking edit button");
    int editInstructorIndex = 1;

    courseEditPage.changeCourseIdInForm(editInstructorIndex, "InvalidCourse");
    courseEditPage.clickEditInstructorLinkUnsuccessfully(editInstructorIndex);
    courseEditPage.waitForAjaxLoaderGifToDisappear();
    assertTrue(
        courseEditPage
            .getEditInstructorLink(editInstructorIndex)
            .getText()
            .contains("Edit failed."));
    courseEditPage.reloadPage();

    ______TS("success: edit an instructor");

    courseEditPage.editInstructor(
        editInstructorIndex,
        "New name",
        "*****@*****.**",
        Const.InstructorPermissionRoleNames.INSTRUCTOR_PERMISSION_ROLE_COOWNER);
    courseEditPage.verifyStatus(
        String.format(Const.StatusMessages.COURSE_INSTRUCTOR_EDITED, "New name"));

    ______TS(
        "success: edit an instructor (InsCrsEdit.coord)--viewing instructor permission details");

    courseEditPage.clickEditInstructorLink(editInstructorIndex);
    assertTrue(courseEditPage.isInstructorEditable(editInstructorIndex));

    ______TS("view details: manager");

    courseEditPage.clickViewDetailsLinkForInstructor(
        editInstructorIndex, InstructorCourseEditPage.INSTRUCTOR_TYPE_MANAGER);
    assertFalse(
        courseEditPage.isPrivilegeCheckboxInModalChecked(
            Const.ParamsNames.INSTRUCTOR_PERMISSION_MODIFY_COURSE));
    assertTrue(
        courseEditPage.isPrivilegeCheckboxInModalChecked(
            Const.ParamsNames.INSTRUCTOR_PERMISSION_MODIFY_INSTRUCTOR));
    assertTrue(
        courseEditPage.isPrivilegeCheckboxInModalChecked(
            Const.ParamsNames.INSTRUCTOR_PERMISSION_MODIFY_SESSION));
    assertTrue(
        courseEditPage.isPrivilegeCheckboxInModalChecked(
            Const.ParamsNames.INSTRUCTOR_PERMISSION_MODIFY_STUDENT));
    assertTrue(
        courseEditPage.isPrivilegeCheckboxInModalChecked(
            Const.ParamsNames.INSTRUCTOR_PERMISSION_VIEW_STUDENT_IN_SECTIONS));
    assertTrue(
        courseEditPage.isPrivilegeCheckboxInModalChecked(
            Const.ParamsNames.INSTRUCTOR_PERMISSION_GIVE_COMMENT_IN_SECTIONS));
    assertTrue(
        courseEditPage.isPrivilegeCheckboxInModalChecked(
            Const.ParamsNames.INSTRUCTOR_PERMISSION_VIEW_COMMENT_IN_SECTIONS));
    assertTrue(
        courseEditPage.isPrivilegeCheckboxInModalChecked(
            Const.ParamsNames.INSTRUCTOR_PERMISSION_MODIFY_COMMENT_IN_SECTIONS));
    assertTrue(
        courseEditPage.isPrivilegeCheckboxInModalChecked(
            Const.ParamsNames.INSTRUCTOR_PERMISSION_SUBMIT_SESSION_IN_SECTIONS));
    assertTrue(
        courseEditPage.isPrivilegeCheckboxInModalChecked(
            Const.ParamsNames.INSTRUCTOR_PERMISSION_VIEW_SESSION_IN_SECTIONS));
    assertTrue(
        courseEditPage.isPrivilegeCheckboxInModalChecked(
            Const.ParamsNames.INSTRUCTOR_PERMISSION_MODIFY_SESSION_COMMENT_IN_SECTIONS));
    courseEditPage.closeModal();

    ______TS("view details: observer");

    courseEditPage.clickViewDetailsLinkForInstructor(
        editInstructorIndex, InstructorCourseEditPage.INSTRUCTOR_TYPE_OBSERVER);
    assertFalse(
        courseEditPage.isPrivilegeCheckboxInModalChecked(
            Const.ParamsNames.INSTRUCTOR_PERMISSION_MODIFY_COURSE));
    assertFalse(
        courseEditPage.isPrivilegeCheckboxInModalChecked(
            Const.ParamsNames.INSTRUCTOR_PERMISSION_MODIFY_INSTRUCTOR));
    assertFalse(
        courseEditPage.isPrivilegeCheckboxInModalChecked(
            Const.ParamsNames.INSTRUCTOR_PERMISSION_MODIFY_SESSION));
    assertFalse(
        courseEditPage.isPrivilegeCheckboxInModalChecked(
            Const.ParamsNames.INSTRUCTOR_PERMISSION_MODIFY_STUDENT));
    assertTrue(
        courseEditPage.isPrivilegeCheckboxInModalChecked(
            Const.ParamsNames.INSTRUCTOR_PERMISSION_VIEW_STUDENT_IN_SECTIONS));
    assertFalse(
        courseEditPage.isPrivilegeCheckboxInModalChecked(
            Const.ParamsNames.INSTRUCTOR_PERMISSION_GIVE_COMMENT_IN_SECTIONS));
    assertTrue(
        courseEditPage.isPrivilegeCheckboxInModalChecked(
            Const.ParamsNames.INSTRUCTOR_PERMISSION_VIEW_COMMENT_IN_SECTIONS));
    assertFalse(
        courseEditPage.isPrivilegeCheckboxInModalChecked(
            Const.ParamsNames.INSTRUCTOR_PERMISSION_MODIFY_COMMENT_IN_SECTIONS));
    assertFalse(
        courseEditPage.isPrivilegeCheckboxInModalChecked(
            Const.ParamsNames.INSTRUCTOR_PERMISSION_SUBMIT_SESSION_IN_SECTIONS));
    assertTrue(
        courseEditPage.isPrivilegeCheckboxInModalChecked(
            Const.ParamsNames.INSTRUCTOR_PERMISSION_VIEW_SESSION_IN_SECTIONS));
    assertFalse(
        courseEditPage.isPrivilegeCheckboxInModalChecked(
            Const.ParamsNames.INSTRUCTOR_PERMISSION_MODIFY_SESSION_COMMENT_IN_SECTIONS));
    courseEditPage.closeModal();

    ______TS("view details: tutor");

    courseEditPage.clickViewDetailsLinkForInstructor(
        editInstructorIndex, InstructorCourseEditPage.INSTRUCTOR_TYPE_TUTOR);
    assertFalse(
        courseEditPage.isPrivilegeCheckboxInModalChecked(
            Const.ParamsNames.INSTRUCTOR_PERMISSION_MODIFY_COURSE));
    assertFalse(
        courseEditPage.isPrivilegeCheckboxInModalChecked(
            Const.ParamsNames.INSTRUCTOR_PERMISSION_MODIFY_INSTRUCTOR));
    assertFalse(
        courseEditPage.isPrivilegeCheckboxInModalChecked(
            Const.ParamsNames.INSTRUCTOR_PERMISSION_MODIFY_SESSION));
    assertFalse(
        courseEditPage.isPrivilegeCheckboxInModalChecked(
            Const.ParamsNames.INSTRUCTOR_PERMISSION_MODIFY_STUDENT));
    assertTrue(
        courseEditPage.isPrivilegeCheckboxInModalChecked(
            Const.ParamsNames.INSTRUCTOR_PERMISSION_VIEW_STUDENT_IN_SECTIONS));
    assertTrue(
        courseEditPage.isPrivilegeCheckboxInModalChecked(
            Const.ParamsNames.INSTRUCTOR_PERMISSION_GIVE_COMMENT_IN_SECTIONS));
    assertFalse(
        courseEditPage.isPrivilegeCheckboxInModalChecked(
            Const.ParamsNames.INSTRUCTOR_PERMISSION_VIEW_COMMENT_IN_SECTIONS));
    assertFalse(
        courseEditPage.isPrivilegeCheckboxInModalChecked(
            Const.ParamsNames.INSTRUCTOR_PERMISSION_MODIFY_COMMENT_IN_SECTIONS));
    assertTrue(
        courseEditPage.isPrivilegeCheckboxInModalChecked(
            Const.ParamsNames.INSTRUCTOR_PERMISSION_SUBMIT_SESSION_IN_SECTIONS));
    assertTrue(
        courseEditPage.isPrivilegeCheckboxInModalChecked(
            Const.ParamsNames.INSTRUCTOR_PERMISSION_VIEW_SESSION_IN_SECTIONS));
    assertFalse(
        courseEditPage.isPrivilegeCheckboxInModalChecked(
            Const.ParamsNames.INSTRUCTOR_PERMISSION_MODIFY_SESSION_COMMENT_IN_SECTIONS));
    courseEditPage.closeModal();

    ______TS("view details: co-owner");

    courseEditPage.clickViewDetailsLinkForInstructor(
        editInstructorIndex, InstructorCourseEditPage.INSTRUCTOR_TYPE_COOWNER);
    courseEditPage.verifyHtmlMainContent("/instructorCourseEditEditInstructorPrivilegesModal.html");
    courseEditPage.closeModal();

    ______TS("verify that custom has no privileges by default");

    int customInstrNum = 5;
    courseEditPage.clickEditInstructorLink(customInstrNum);
    assertFalse(
        courseEditPage.isPrivilegeCheckboxInPermissionDivChecked(
            customInstrNum, "canmodifycourse"));
    assertFalse(
        courseEditPage.isPrivilegeCheckboxInPermissionDivChecked(
            customInstrNum, "canmodifyinstructor"));
    assertFalse(
        courseEditPage.isPrivilegeCheckboxInPermissionDivChecked(
            customInstrNum, "canmodifysession"));
    assertFalse(
        courseEditPage.isPrivilegeCheckboxInPermissionDivChecked(
            customInstrNum, "canmodifystudent"));
    assertFalse(
        courseEditPage.isPrivilegeCheckboxInPermissionDivChecked(
            customInstrNum, "canviewstudentinsection"));
    assertFalse(
        courseEditPage.isPrivilegeCheckboxInPermissionDivChecked(
            customInstrNum, "cangivecommentinsection"));
    assertFalse(
        courseEditPage.isPrivilegeCheckboxInPermissionDivChecked(
            customInstrNum, "canviewcommentinsection"));
    assertFalse(
        courseEditPage.isPrivilegeCheckboxInPermissionDivChecked(
            customInstrNum, "canmodifycommentinsection"));
    assertFalse(
        courseEditPage.isPrivilegeCheckboxInPermissionDivChecked(
            customInstrNum, "cansubmitsessioninsection"));
    assertFalse(
        courseEditPage.isPrivilegeCheckboxInPermissionDivChecked(
            customInstrNum, "canviewsessioninsection"));
    assertFalse(
        courseEditPage.isPrivilegeCheckboxInPermissionDivChecked(
            customInstrNum, "canmodifysessioncommentinsection"));
    courseEditPage.clickSaveInstructorButton(customInstrNum);

    ______TS("success: edit an instructor with privileges");

    courseEditPage.clickEditInstructorLink(editInstructorIndex);
    assertTrue(courseEditPage.getDisplayedToStudentCheckBox(editInstructorIndex).isSelected());
    // not displayed to students
    courseEditPage.clickDisplayedToStudentCheckBox(editInstructorIndex);
    // select the role as Custom for instr1
    courseEditPage.selectRoleForInstructor(editInstructorIndex, "Custom");

    // deselect some privileges from Co-owner default values
    courseEditPage.clickCourseLevelPrivilegesLink(
        editInstructorIndex, InstructorCourseEditPage.COURSE_MODIFY_COURSE);
    courseEditPage.clickCourseLevelPrivilegesLink(
        editInstructorIndex, InstructorCourseEditPage.COURSE_MODIFY_INSTRUCTORS);
    courseEditPage.clickCourseLevelPrivilegesLink(
        editInstructorIndex, InstructorCourseEditPage.COURSE_MODIFY_OTHERS_COMMENTS);
    courseEditPage.clickAddSectionLevelPrivilegesLink(editInstructorIndex);
    courseEditPage.clickSectionSelectionCheckBox(editInstructorIndex, 0, 0);
    courseEditPage.clickSectionSelectionCheckBox(editInstructorIndex, 0, 1);
    courseEditPage.clickSectionLevelPrivilegeLink(
        editInstructorIndex, 0, InstructorCourseEditPage.SECTION_VIEW_STUDENTS);
    courseEditPage.clickSectionLevelPrivilegeLink(
        editInstructorIndex, 0, InstructorCourseEditPage.SECTION_VIEW_OTHERS_COMMENTS);
    courseEditPage.clickSectionLevelPrivilegeLink(
        editInstructorIndex, 0, InstructorCourseEditPage.SECTION_VIEW_RESPONSES_IN_SESSION);
    courseEditPage.clickSessionLevelInSectionLevel(editInstructorIndex, 0);
    courseEditPage.clickAddSectionLevelPrivilegesLink(editInstructorIndex);
    courseEditPage.clickSectionSelectionCheckBox(editInstructorIndex, 1, 1);
    courseEditPage.clickAddSectionLevelPrivilegesLink(editInstructorIndex);
    courseEditPage.clickSectionSelectionCheckBox(editInstructorIndex, 2, 1);
    courseEditPage.clickSectionSelectionCheckBox(editInstructorIndex, 2, 2);
    courseEditPage.clickSectionLevelPrivilegeLink(
        editInstructorIndex, 2, InstructorCourseEditPage.SECTION_MODIFY_RESPONSES_IN_SESSION);
    // after 3 sections added, no more things to add
    assertFalse(courseEditPage.getAddSectionLevelPrivilegesLink(editInstructorIndex).isDisplayed());
    courseEditPage.verifyHtmlMainContent(
        "/instructorCourseEditEditInstructorPrivilegesBeforeSubmit.html");

    courseEditPage.clickSaveInstructorButton(editInstructorIndex);
    courseEditPage.verifyHtmlMainContent(
        "/instructorCourseEditEditInstructorPrivilegesSuccessful.html");
    courseEditPage.clickEditInstructorLink(editInstructorIndex);
    assertTrue(courseEditPage.isInstructorEditable(editInstructorIndex));
    courseEditPage.verifyHtmlMainContent(
        "/instructorCourseEditEditInstructorPrivilegesSuccessfulAndCheckEditAgain.html");
    courseEditPage.clickSaveInstructorButton(editInstructorIndex);

    ______TS("failure: edit failed due to invalid parameters");
    String invalidEmail = "InsCrsEdit.email.tmt";

    courseEditPage.editInstructor(
        editInstructorIndex,
        "New name",
        invalidEmail,
        Const.InstructorPermissionRoleNames.INSTRUCTOR_PERMISSION_ROLE_COOWNER);
    courseEditPage.verifyStatus(new FieldValidator().getInvalidityInfoForEmail(invalidEmail));

    String invalidName = "";

    courseEditPage.editInstructor(
        editInstructorIndex,
        invalidName,
        "*****@*****.**",
        Const.InstructorPermissionRoleNames.INSTRUCTOR_PERMISSION_ROLE_COOWNER);
    courseEditPage.verifyStatus(new FieldValidator().getInvalidityInfoForPersonName(invalidName));

    ______TS(
        "success: test Custom radio button getting other privileges' default values when selected");
    editInstructorIndex = 2;
    courseEditPage.clickEditInstructorLink(editInstructorIndex);

    ______TS("tutor->custom");

    courseEditPage.selectRoleForInstructor(editInstructorIndex, "Tutor");
    courseEditPage.clickSaveInstructorButton(editInstructorIndex);
    courseEditPage.clickEditInstructorLink(editInstructorIndex);
    courseEditPage.selectRoleForInstructor(editInstructorIndex, "Custom");
    assertFalse(
        courseEditPage.isPrivilegeCheckboxInPermissionDivChecked(
            editInstructorIndex, Const.ParamsNames.INSTRUCTOR_PERMISSION_MODIFY_COURSE));
    assertFalse(
        courseEditPage.isPrivilegeCheckboxInPermissionDivChecked(
            editInstructorIndex, Const.ParamsNames.INSTRUCTOR_PERMISSION_MODIFY_INSTRUCTOR));
    assertFalse(
        courseEditPage.isPrivilegeCheckboxInPermissionDivChecked(
            editInstructorIndex, Const.ParamsNames.INSTRUCTOR_PERMISSION_MODIFY_SESSION));
    assertFalse(
        courseEditPage.isPrivilegeCheckboxInPermissionDivChecked(
            editInstructorIndex, Const.ParamsNames.INSTRUCTOR_PERMISSION_MODIFY_STUDENT));
    assertTrue(
        courseEditPage.isPrivilegeCheckboxInPermissionDivChecked(
            editInstructorIndex, Const.ParamsNames.INSTRUCTOR_PERMISSION_VIEW_STUDENT_IN_SECTIONS));
    assertTrue(
        courseEditPage.isPrivilegeCheckboxInPermissionDivChecked(
            editInstructorIndex, Const.ParamsNames.INSTRUCTOR_PERMISSION_GIVE_COMMENT_IN_SECTIONS));
    assertFalse(
        courseEditPage.isPrivilegeCheckboxInPermissionDivChecked(
            editInstructorIndex, Const.ParamsNames.INSTRUCTOR_PERMISSION_VIEW_COMMENT_IN_SECTIONS));
    assertFalse(
        courseEditPage.isPrivilegeCheckboxInPermissionDivChecked(
            editInstructorIndex,
            Const.ParamsNames.INSTRUCTOR_PERMISSION_MODIFY_COMMENT_IN_SECTIONS));
    assertTrue(
        courseEditPage.isPrivilegeCheckboxInPermissionDivChecked(
            editInstructorIndex,
            Const.ParamsNames.INSTRUCTOR_PERMISSION_SUBMIT_SESSION_IN_SECTIONS));
    assertTrue(
        courseEditPage.isPrivilegeCheckboxInPermissionDivChecked(
            editInstructorIndex, Const.ParamsNames.INSTRUCTOR_PERMISSION_VIEW_SESSION_IN_SECTIONS));
    assertFalse(
        courseEditPage.isPrivilegeCheckboxInPermissionDivChecked(
            editInstructorIndex,
            Const.ParamsNames.INSTRUCTOR_PERMISSION_MODIFY_SESSION_COMMENT_IN_SECTIONS));

    ______TS("observer->custom");

    courseEditPage.selectRoleForInstructor(editInstructorIndex, "Observer");
    courseEditPage.clickSaveInstructorButton(editInstructorIndex);
    courseEditPage.clickEditInstructorLink(editInstructorIndex);
    courseEditPage.selectRoleForInstructor(editInstructorIndex, "Custom");
    assertFalse(
        courseEditPage.isPrivilegeCheckboxInPermissionDivChecked(
            editInstructorIndex, Const.ParamsNames.INSTRUCTOR_PERMISSION_MODIFY_COURSE));
    assertFalse(
        courseEditPage.isPrivilegeCheckboxInPermissionDivChecked(
            editInstructorIndex, Const.ParamsNames.INSTRUCTOR_PERMISSION_MODIFY_INSTRUCTOR));
    assertFalse(
        courseEditPage.isPrivilegeCheckboxInPermissionDivChecked(
            editInstructorIndex, Const.ParamsNames.INSTRUCTOR_PERMISSION_MODIFY_SESSION));
    assertFalse(
        courseEditPage.isPrivilegeCheckboxInPermissionDivChecked(
            editInstructorIndex, Const.ParamsNames.INSTRUCTOR_PERMISSION_MODIFY_STUDENT));
    assertTrue(
        courseEditPage.isPrivilegeCheckboxInPermissionDivChecked(
            editInstructorIndex, Const.ParamsNames.INSTRUCTOR_PERMISSION_VIEW_STUDENT_IN_SECTIONS));
    assertFalse(
        courseEditPage.isPrivilegeCheckboxInPermissionDivChecked(
            editInstructorIndex, Const.ParamsNames.INSTRUCTOR_PERMISSION_GIVE_COMMENT_IN_SECTIONS));
    assertTrue(
        courseEditPage.isPrivilegeCheckboxInPermissionDivChecked(
            editInstructorIndex, Const.ParamsNames.INSTRUCTOR_PERMISSION_VIEW_COMMENT_IN_SECTIONS));
    assertFalse(
        courseEditPage.isPrivilegeCheckboxInPermissionDivChecked(
            editInstructorIndex,
            Const.ParamsNames.INSTRUCTOR_PERMISSION_MODIFY_COMMENT_IN_SECTIONS));
    assertFalse(
        courseEditPage.isPrivilegeCheckboxInPermissionDivChecked(
            editInstructorIndex,
            Const.ParamsNames.INSTRUCTOR_PERMISSION_SUBMIT_SESSION_IN_SECTIONS));
    assertTrue(
        courseEditPage.isPrivilegeCheckboxInPermissionDivChecked(
            editInstructorIndex, Const.ParamsNames.INSTRUCTOR_PERMISSION_VIEW_SESSION_IN_SECTIONS));
    assertFalse(
        courseEditPage.isPrivilegeCheckboxInPermissionDivChecked(
            editInstructorIndex,
            Const.ParamsNames.INSTRUCTOR_PERMISSION_MODIFY_SESSION_COMMENT_IN_SECTIONS));

    ______TS("manager->custom");

    courseEditPage.selectRoleForInstructor(editInstructorIndex, "Manager");
    courseEditPage.clickSaveInstructorButton(editInstructorIndex);
    courseEditPage.clickEditInstructorLink(editInstructorIndex);
    courseEditPage.selectRoleForInstructor(editInstructorIndex, "Custom");
    assertFalse(
        courseEditPage.isPrivilegeCheckboxInPermissionDivChecked(
            editInstructorIndex, Const.ParamsNames.INSTRUCTOR_PERMISSION_MODIFY_COURSE));
    assertTrue(
        courseEditPage.isPrivilegeCheckboxInPermissionDivChecked(
            editInstructorIndex, Const.ParamsNames.INSTRUCTOR_PERMISSION_MODIFY_INSTRUCTOR));
    assertTrue(
        courseEditPage.isPrivilegeCheckboxInPermissionDivChecked(
            editInstructorIndex, Const.ParamsNames.INSTRUCTOR_PERMISSION_MODIFY_SESSION));
    assertTrue(
        courseEditPage.isPrivilegeCheckboxInPermissionDivChecked(
            editInstructorIndex, Const.ParamsNames.INSTRUCTOR_PERMISSION_MODIFY_STUDENT));
    assertTrue(
        courseEditPage.isPrivilegeCheckboxInPermissionDivChecked(
            editInstructorIndex, Const.ParamsNames.INSTRUCTOR_PERMISSION_VIEW_STUDENT_IN_SECTIONS));
    assertTrue(
        courseEditPage.isPrivilegeCheckboxInPermissionDivChecked(
            editInstructorIndex, Const.ParamsNames.INSTRUCTOR_PERMISSION_GIVE_COMMENT_IN_SECTIONS));
    assertTrue(
        courseEditPage.isPrivilegeCheckboxInPermissionDivChecked(
            editInstructorIndex, Const.ParamsNames.INSTRUCTOR_PERMISSION_VIEW_COMMENT_IN_SECTIONS));
    assertTrue(
        courseEditPage.isPrivilegeCheckboxInPermissionDivChecked(
            editInstructorIndex,
            Const.ParamsNames.INSTRUCTOR_PERMISSION_MODIFY_COMMENT_IN_SECTIONS));
    assertTrue(
        courseEditPage.isPrivilegeCheckboxInPermissionDivChecked(
            editInstructorIndex,
            Const.ParamsNames.INSTRUCTOR_PERMISSION_SUBMIT_SESSION_IN_SECTIONS));
    assertTrue(
        courseEditPage.isPrivilegeCheckboxInPermissionDivChecked(
            editInstructorIndex, Const.ParamsNames.INSTRUCTOR_PERMISSION_VIEW_SESSION_IN_SECTIONS));
    assertTrue(
        courseEditPage.isPrivilegeCheckboxInPermissionDivChecked(
            editInstructorIndex,
            Const.ParamsNames.INSTRUCTOR_PERMISSION_MODIFY_SESSION_COMMENT_IN_SECTIONS));

    ______TS("co-owner->custom");

    courseEditPage.selectRoleForInstructor(editInstructorIndex, "Co-owner");
    courseEditPage.clickSaveInstructorButton(editInstructorIndex);
    courseEditPage.clickEditInstructorLink(editInstructorIndex);
    courseEditPage.selectRoleForInstructor(editInstructorIndex, "Custom");
    assertTrue(
        courseEditPage.isPrivilegeCheckboxInPermissionDivChecked(
            editInstructorIndex, Const.ParamsNames.INSTRUCTOR_PERMISSION_MODIFY_COURSE));
    assertTrue(
        courseEditPage.isPrivilegeCheckboxInPermissionDivChecked(
            editInstructorIndex, Const.ParamsNames.INSTRUCTOR_PERMISSION_MODIFY_INSTRUCTOR));
    assertTrue(
        courseEditPage.isPrivilegeCheckboxInPermissionDivChecked(
            editInstructorIndex, Const.ParamsNames.INSTRUCTOR_PERMISSION_MODIFY_SESSION));
    assertTrue(
        courseEditPage.isPrivilegeCheckboxInPermissionDivChecked(
            editInstructorIndex, Const.ParamsNames.INSTRUCTOR_PERMISSION_MODIFY_STUDENT));
    assertTrue(
        courseEditPage.isPrivilegeCheckboxInPermissionDivChecked(
            editInstructorIndex, Const.ParamsNames.INSTRUCTOR_PERMISSION_VIEW_STUDENT_IN_SECTIONS));
    assertTrue(
        courseEditPage.isPrivilegeCheckboxInPermissionDivChecked(
            editInstructorIndex, Const.ParamsNames.INSTRUCTOR_PERMISSION_GIVE_COMMENT_IN_SECTIONS));
    assertTrue(
        courseEditPage.isPrivilegeCheckboxInPermissionDivChecked(
            editInstructorIndex, Const.ParamsNames.INSTRUCTOR_PERMISSION_VIEW_COMMENT_IN_SECTIONS));
    assertTrue(
        courseEditPage.isPrivilegeCheckboxInPermissionDivChecked(
            editInstructorIndex,
            Const.ParamsNames.INSTRUCTOR_PERMISSION_MODIFY_COMMENT_IN_SECTIONS));
    assertTrue(
        courseEditPage.isPrivilegeCheckboxInPermissionDivChecked(
            editInstructorIndex,
            Const.ParamsNames.INSTRUCTOR_PERMISSION_SUBMIT_SESSION_IN_SECTIONS));
    assertTrue(
        courseEditPage.isPrivilegeCheckboxInPermissionDivChecked(
            editInstructorIndex, Const.ParamsNames.INSTRUCTOR_PERMISSION_VIEW_SESSION_IN_SECTIONS));
    assertTrue(
        courseEditPage.isPrivilegeCheckboxInPermissionDivChecked(
            editInstructorIndex,
            Const.ParamsNames.INSTRUCTOR_PERMISSION_MODIFY_SESSION_COMMENT_IN_SECTIONS));

    ______TS("verify that session level checkboxes are accessible");

    int sectionToCheck = 0;

    courseEditPage.clickAddSectionLevelPrivilegesLink(editInstructorIndex);
    courseEditPage.clickSessionLevelInSectionLevel(editInstructorIndex, sectionToCheck);
    assertTrue(
        courseEditPage.isTuneSessionPermissionsDivVisible(editInstructorIndex, sectionToCheck));

    ______TS("verify checkbox toggling to false");

    int sessionToCheck = 0;

    // course level
    courseEditPage.clickCourseLevelPrivilegesLink(
        editInstructorIndex, InstructorCourseEditPage.COURSE_VIEW_STUDENTS);
    assertFalse(
        courseEditPage.isPrivilegeCheckboxInPermissionDivChecked(
            editInstructorIndex, Const.ParamsNames.INSTRUCTOR_PERMISSION_VIEW_STUDENT_IN_SECTIONS));
    assertFalse(
        courseEditPage.isPrivilegeCheckboxInPermissionDivChecked(
            editInstructorIndex, Const.ParamsNames.INSTRUCTOR_PERMISSION_GIVE_COMMENT_IN_SECTIONS));

    courseEditPage.clickCourseLevelPrivilegesLink(
        editInstructorIndex, InstructorCourseEditPage.COURSE_VIEW_OTHERS_COMMENTS);
    assertFalse(
        courseEditPage.isPrivilegeCheckboxInPermissionDivChecked(
            editInstructorIndex, Const.ParamsNames.INSTRUCTOR_PERMISSION_VIEW_COMMENT_IN_SECTIONS));
    assertFalse(
        courseEditPage.isPrivilegeCheckboxInPermissionDivChecked(
            editInstructorIndex,
            Const.ParamsNames.INSTRUCTOR_PERMISSION_MODIFY_COMMENT_IN_SECTIONS));

    courseEditPage.clickCourseLevelPrivilegesLink(
        editInstructorIndex, InstructorCourseEditPage.COURSE_VIEW_RESPONSES_IN_SESSION);
    assertFalse(
        courseEditPage.isPrivilegeCheckboxInPermissionDivChecked(
            editInstructorIndex, Const.ParamsNames.INSTRUCTOR_PERMISSION_VIEW_SESSION_IN_SECTIONS));
    assertFalse(
        courseEditPage.isPrivilegeCheckboxInPermissionDivChecked(
            editInstructorIndex,
            Const.ParamsNames.INSTRUCTOR_PERMISSION_MODIFY_SESSION_COMMENT_IN_SECTIONS));

    // section level
    courseEditPage.clickSectionLevelPrivilegeLink(
        editInstructorIndex, sectionToCheck, InstructorCourseEditPage.SECTION_VIEW_STUDENTS);
    assertFalse(
        courseEditPage.isSectionLevelPrivilegeLinkClicked(
            editInstructorIndex, sectionToCheck, InstructorCourseEditPage.SECTION_VIEW_STUDENTS));
    assertFalse(
        courseEditPage.isSectionLevelPrivilegeLinkClicked(
            editInstructorIndex,
            sectionToCheck,
            InstructorCourseEditPage.SECTION_GIVE_STUDENT_COMMENTS));

    courseEditPage.clickSectionLevelPrivilegeLink(
        editInstructorIndex, sectionToCheck, InstructorCourseEditPage.SECTION_VIEW_OTHERS_COMMENTS);
    assertFalse(
        courseEditPage.isSectionLevelPrivilegeLinkClicked(
            editInstructorIndex,
            sectionToCheck,
            InstructorCourseEditPage.SECTION_VIEW_OTHERS_COMMENTS));
    assertFalse(
        courseEditPage.isSectionLevelPrivilegeLinkClicked(
            editInstructorIndex,
            sectionToCheck,
            InstructorCourseEditPage.SECTION_MODIFY_OTHERS_COMMENTS));

    courseEditPage.clickSectionLevelPrivilegeLink(
        editInstructorIndex,
        sectionToCheck,
        InstructorCourseEditPage.SECTION_VIEW_RESPONSES_IN_SESSION);
    assertFalse(
        courseEditPage.isSectionLevelPrivilegeLinkClicked(
            editInstructorIndex,
            sectionToCheck,
            InstructorCourseEditPage.SECTION_VIEW_RESPONSES_IN_SESSION));
    assertFalse(
        courseEditPage.isSectionLevelPrivilegeLinkClicked(
            editInstructorIndex,
            sectionToCheck,
            InstructorCourseEditPage.SECTION_MODIFY_RESPONSES_IN_SESSION));

    // session level
    courseEditPage.clickSessionLevelPrivilegeLink(
        editInstructorIndex,
        sectionToCheck,
        sessionToCheck,
        InstructorCourseEditPage.SESSION_VIEW_RESPONSES);
    assertFalse(
        courseEditPage.isSessionLevelPrivilegeLinkClicked(
            editInstructorIndex,
            sectionToCheck,
            sessionToCheck,
            InstructorCourseEditPage.SESSION_VIEW_RESPONSES));
    assertFalse(
        courseEditPage.isSessionLevelPrivilegeLinkClicked(
            editInstructorIndex,
            sectionToCheck,
            sessionToCheck,
            InstructorCourseEditPage.SESSION_MODIFY_RESPONSES));

    ______TS("verify checkbox toggling to true");

    // course level
    courseEditPage.clickCourseLevelPrivilegesLink(
        editInstructorIndex, InstructorCourseEditPage.COURSE_GIVE_STUDENT_COMMENTS);
    assertTrue(
        courseEditPage.isPrivilegeCheckboxInPermissionDivChecked(
            editInstructorIndex, Const.ParamsNames.INSTRUCTOR_PERMISSION_VIEW_STUDENT_IN_SECTIONS));
    assertTrue(
        courseEditPage.isPrivilegeCheckboxInPermissionDivChecked(
            editInstructorIndex, Const.ParamsNames.INSTRUCTOR_PERMISSION_GIVE_COMMENT_IN_SECTIONS));

    courseEditPage.clickCourseLevelPrivilegesLink(
        editInstructorIndex, InstructorCourseEditPage.COURSE_MODIFY_OTHERS_COMMENTS);
    assertTrue(
        courseEditPage.isPrivilegeCheckboxInPermissionDivChecked(
            editInstructorIndex, Const.ParamsNames.INSTRUCTOR_PERMISSION_VIEW_COMMENT_IN_SECTIONS));
    assertTrue(
        courseEditPage.isPrivilegeCheckboxInPermissionDivChecked(
            editInstructorIndex,
            Const.ParamsNames.INSTRUCTOR_PERMISSION_MODIFY_COMMENT_IN_SECTIONS));

    courseEditPage.clickCourseLevelPrivilegesLink(
        editInstructorIndex, InstructorCourseEditPage.COURSE_MODIFY_RESPONSES_IN_SESSION);
    assertTrue(
        courseEditPage.isPrivilegeCheckboxInPermissionDivChecked(
            editInstructorIndex, Const.ParamsNames.INSTRUCTOR_PERMISSION_VIEW_SESSION_IN_SECTIONS));
    assertTrue(
        courseEditPage.isPrivilegeCheckboxInPermissionDivChecked(
            editInstructorIndex,
            Const.ParamsNames.INSTRUCTOR_PERMISSION_MODIFY_SESSION_COMMENT_IN_SECTIONS));

    // section level
    courseEditPage.clickSectionLevelPrivilegeLink(
        editInstructorIndex,
        sectionToCheck,
        InstructorCourseEditPage.SECTION_GIVE_STUDENT_COMMENTS);
    assertTrue(
        courseEditPage.isSectionLevelPrivilegeLinkClicked(
            editInstructorIndex, sectionToCheck, InstructorCourseEditPage.SECTION_VIEW_STUDENTS));
    assertTrue(
        courseEditPage.isSectionLevelPrivilegeLinkClicked(
            editInstructorIndex,
            sectionToCheck,
            InstructorCourseEditPage.SECTION_GIVE_STUDENT_COMMENTS));

    courseEditPage.clickSectionLevelPrivilegeLink(
        editInstructorIndex,
        sectionToCheck,
        InstructorCourseEditPage.SECTION_MODIFY_OTHERS_COMMENTS);
    assertTrue(
        courseEditPage.isSectionLevelPrivilegeLinkClicked(
            editInstructorIndex,
            sectionToCheck,
            InstructorCourseEditPage.SECTION_VIEW_OTHERS_COMMENTS));
    assertTrue(
        courseEditPage.isSectionLevelPrivilegeLinkClicked(
            editInstructorIndex,
            sectionToCheck,
            InstructorCourseEditPage.SECTION_MODIFY_OTHERS_COMMENTS));

    courseEditPage.clickSectionLevelPrivilegeLink(
        editInstructorIndex,
        sectionToCheck,
        InstructorCourseEditPage.SECTION_MODIFY_RESPONSES_IN_SESSION);
    assertTrue(
        courseEditPage.isSectionLevelPrivilegeLinkClicked(
            editInstructorIndex,
            sectionToCheck,
            InstructorCourseEditPage.SECTION_VIEW_RESPONSES_IN_SESSION));
    assertTrue(
        courseEditPage.isSectionLevelPrivilegeLinkClicked(
            editInstructorIndex,
            sectionToCheck,
            InstructorCourseEditPage.SECTION_MODIFY_RESPONSES_IN_SESSION));

    // session level
    courseEditPage.clickSessionLevelPrivilegeLink(
        editInstructorIndex,
        sectionToCheck,
        sessionToCheck,
        InstructorCourseEditPage.SESSION_MODIFY_RESPONSES);
    assertTrue(
        courseEditPage.isSessionLevelPrivilegeLinkClicked(
            editInstructorIndex,
            sectionToCheck,
            sessionToCheck,
            InstructorCourseEditPage.SESSION_VIEW_RESPONSES));
    assertTrue(
        courseEditPage.isSessionLevelPrivilegeLinkClicked(
            editInstructorIndex,
            sectionToCheck,
            sessionToCheck,
            InstructorCourseEditPage.SESSION_MODIFY_RESPONSES));

    courseEditPage.selectRoleForInstructor(editInstructorIndex, "Co-owner");
  }