@Test
  public void test03_CheckMembershipNotHaveEditPagePermission_AddSpace() {
    String spaceName = "pagespace033";
    String spaceDescription = "KS_Wiki_PagePermission_Other_space_description_03_3";
    By element_space = By.linkText(spaceName);
    String title = "KS_Wiki_PagePermission_Other_Page_03_3";
    String content = "KS_Wiki_PagePermission_Other_Content_03_3";
    By element_page = By.linkText(title);
    String[] userGroup = {"Platform/Content Management", "redactor"};

    // add new space visible and open
    magMember.goToMySpacePage();
    magMember.addNewSpace(spaceName, spaceDescription, "Visible", "Open", "", "");

    info("Add a wiki page");
    goToWikiFromSpace(spaceName);
    addBlankWikiPage(title, content, 0);
    click(element_page);
    setPagePermission(userGroup, 3);
    magAc.signOut();

    info("user james belongs to membership that joins space -> check page permission");
    userJoinSpaceAndCheckPagePermission("james", spaceName, element_space, element_page, content);

    // delete space
    magAc.signIn(DATA_USER_ADMIN, DATA_PASS_ADMIN);
    magMember.restoreData(spaceName, 100000);
  }
  public void userJoinSpaceAndCheckPagePermission(
      String user, String spaceName, By element_space, By element_page, String content) {
    magAc.signIn(user, DATA_PASS_ADMIN);
    magMember.joinOpenSpace(spaceName);
    click(element_space);
    click(ELEMENT_WIKI_LINK_IN_SPACE);

    info("User can view page but can not edit page");
    click(element_page);
    waitForTextPresent(content);
    waitForElementNotPresent(ELEMENT_EDIT_PAGE_LINK);
    magAc.signOut();
  }
예제 #3
0
 @Test(groups = {"platform", "add new group"})
 public void testAddNewGroup() {
   System.out.println("--Create a new group--");
   magAcc.signIn(USER_ROOT, DATA_PASS);
   Utils.pause(1000);
   goToUsersAndGroupsManagement();
   Utils.pause(1000);
   userGroup.chooseGroupTab();
   Utils.pause(1000);
   userGroup.addGroup(groupName, groupLabel, groupDesc, verify);
   magAcc.signOut();
   Utils.pause(1000);
 }
예제 #4
0
 @Test(groups = {"platform", "add new group"})
 public void testDeleteGroup() {
   System.out.println("--Delete a new group--");
   magAcc.signIn(USER_ROOT, DATA_PASS);
   Utils.pause(1000);
   goToUsersAndGroupsManagement();
   Utils.pause(1000);
   userGroup.chooseGroupTab();
   Utils.pause(1000);
   userGroup.selectGroup(groupName);
   userGroup.deleteGroup(groupName, true);
   Utils.pause(3000);
   magAcc.signOut();
   Utils.pause(1000);
 }
예제 #5
0
 @Test(groups = {"platform", "add new group"})
 public void testAddUserIntoGroup() {
   System.out.println("--Add user to a group--");
   magAcc.signIn(USER_ROOT, DATA_PASS);
   Utils.pause(1000);
   goToUsersAndGroupsManagement();
   Utils.pause(1000);
   userGroup.chooseGroupTab();
   Utils.pause(1000);
   userGroup.selectGroup(groupName);
   userGroup.addUsersToGroup(userName, memberShip, select, verify);
   Utils.pause(1000);
   magAcc.signOut();
   Utils.pause(1000);
 }
  @Test
  public void test02_CheckUserNotHaveEditPage_MembershipPermission() {
    String title = "KS_Wiki_PagePermission_Other_Page_02_3";
    String content = "KS_Wiki_PagePermission_Other_Content_02_3";
    By element_page = By.linkText(title);
    String[] userGroup = {"Platform/Content Management", "redactor"};

    info("Add a wiki page");
    addBlankWikiPage(title, content, 0);

    info("Add membership has permission default");
    deletePagePermission("any");
    waitForElementNotPresent(ELEMENT_PAGE_PERMISSION_POPUP);
    addPagePermission(3, userGroup);
    waitForElementNotPresent(ELEMENT_PAGE_PERMISSION_POPUP);
    magAc.signOut();

    // check user james (belong to membership) which have view page but does not have edit page
    checkEditPage(ManageAccount.userType.AUTHOR, element_page, content);

    // delete page
    // deleteWikiPageWithUserAdmin(element_page);
    String[] wikiPath = {"Wiki Home/" + title};
    resetDataByDeleteWikiPage(ManageAccount.userType.ADMIN, wikiPath);
  }
 @BeforeMethod
 public void setUpBeforeTest() {
   initSeleniumTest();
   driver.get(baseUrl);
   magAc = new ManageAccount(driver);
   magAc.signIn("john", "gtn");
 }
  /*case01: Check when user/group does not permission to view page
   */
  @Test
  public void test01_CheckUserNotHaveViewPagePermission_UserPermission() {
    String title = "KS_Wiki_PagePermission_Other_Page_01_1";
    String content = "KS_Wiki_PagePermission_Other_Content_01_1";
    By element_page = By.linkText(title);
    String user = "******";
    String[] userGroup = {user};

    info("Add a wiki page");
    addBlankWikiPage(title, content, 0);

    info("Add user has permission default");
    deletePagePermission("any");
    waitForElementNotPresent(ELEMENT_PAGE_PERMISSION_POPUP);
    addPagePermission(1, userGroup);
    waitForElementNotPresent(ELEMENT_PAGE_PERMISSION_POPUP);
    magAc.signOut();

    // check user james does not have view permission
    checkViewPage(ManageAccount.userType.AUTHOR, element_page);

    // delete page
    // deleteWikiPageWithUserAdmin(element_page);
    String[] wikiPath = {"Wiki Home/" + title};
    resetDataByDeleteWikiPage(ManageAccount.userType.ADMIN, wikiPath);
  }
  @Test
  public void test01_CheckUserNotHaveViewPagePermission_MembershipPermission() {
    String title = "KS_Wiki_PagePermission_Other_Page_01_3";
    String content = "KS_Wiki_PagePermission_Other_Content_01_3";
    By element_page = By.linkText(title);
    String[] userGroup = {"Platform/Administration", "*"};

    info("Add a wiki page");
    addBlankWikiPage(title, content, 0);

    info("Add user has permission default");
    deletePagePermission("any");
    waitForElementNotPresent(ELEMENT_PAGE_PERMISSION_POPUP);
    addPagePermission(3, userGroup);
    waitForElementNotPresent(ELEMENT_PAGE_PERMISSION_POPUP);
    magAc.signOut();

    // check user mary does not have view permission because it has membership =  publisher/editor
    checkViewPage(ManageAccount.userType.PUBLISHER, element_page);

    // delete page
    // deleteWikiPageWithUserAdmin(element_page);
    String[] wikiPath = {"Wiki Home/" + title};
    resetDataByDeleteWikiPage(ManageAccount.userType.ADMIN, wikiPath);
  }
예제 #10
0
 @BeforeMethod
 public void beforeMethods() {
   initSeleniumTest();
   driver.get(baseUrl);
   magAcc = new ManageAccount(driver);
   button = new Button(driver);
   magAcc.signIn(admin, pass);
 }
  /** CaseId: 68917 -> Ban IP */
  @Test
  public void test02_BanIP() {
    String catName = "CategoryBanIP_02";
    String description = "Add new category in forum";
    String forumName = "ForumBanIP_02";
    String topic = "TopicBanIP_02";
    String message = "New topic 02";

    info("Add new category, forum, topic with user admin");
    cat.addNewCategoryInForum(catName, "1", 0, null, description, 0, null);
    forum.quickAddForum(forumName);
    magtopic.quickStartTopic(topic, message);

    String ip = Utils.getIPOfLocal();

    info("Set banIP is localhost");
    setBanIp(ip);
    magAc.signOut();

    info("Check banIp with user demo");
    driver.get("http://" + ip + ":8080/portal");
    magAc.signIn("demo", "gtn");
    goToForums();
    click(By.linkText(forumName));
    waitForAndGetElement(ELEMENT_START_TOPIC_DISABLE);
    waitForTextPresent(MSG_BLOCK_CREATE_TOPIC);
    waitForTextPresent(MSG_BLOCK_POST);
    waitForTextPresent(MSG_BLOCK_POST_ATTACHMENT);
    waitForTextPresent(MSG_BLOCK_EDIT_YOUR_POST);

    click(By.linkText(topic));
    waitForAndGetElement(ELEMENT_POST_DISABLE);
    waitForTextPresent(MSG_BLOCK_CREATE_TOPIC);
    waitForTextPresent(MSG_BLOCK_POST);
    waitForTextPresent(MSG_BLOCK_POST_ATTACHMENT);
    waitForTextPresent(MSG_BLOCK_EDIT_YOUR_POST);
    magAc.signOut();

    driver.get(baseUrl);
    magAc.signIn("john", "gtn");
    goToForums();
    deleteBanIp(ip);
    click(By.linkText(catName));
    cat.deleteCategoryInForum(catName);
  }
예제 #12
0
 @BeforeMethod
 public void beforeTest() {
   initSeleniumTest();
   driver.get(baseUrl);
   magAc = new ManageAccount(driver);
   magMember = new ManageMember(driver);
   magAc.signIn(DATA_USER_ADMIN, DATA_PASS_ADMIN);
   goToWiki();
 }
 @BeforeMethod
 public void setUpBeforeTest() {
   initSeleniumTest();
   acc = new ManageAccount(driver);
   button = new Button(driver);
   alert = new ManageAlert(driver);
   home = new HomePageActivity(driver);
   acc.signIn(DATA_USER1, DATA_PASS);
 }
예제 #14
0
 @Test(groups = {"platform", "add new group"})
 public void testSelectAndEditGroup() {
   System.out.println("--Edit a new group--");
   magAcc.signIn(USER_ROOT, DATA_PASS);
   Utils.pause(1000);
   goToUsersAndGroupsManagement();
   Utils.pause(1000);
   userGroup.chooseGroupTab();
   Utils.pause(1000);
   userGroup.selectGroup(groupName);
   // userGroup.editGroup(groupName, true);
   type(ELEMENT_INPUT_LABEL, "", true);
   type(ELEMENT_TEXTAREA_DESCRIPTION, "edit a group description", true);
   button.save();
   Utils.pause(1000);
   magAcc.signOut();
   Utils.pause(1000);
 }
 @BeforeMethod
 public void setUpBeforeTest() {
   getDriverAutoSave();
   magAc = new ManageAccount(driver, this.plfVersion);
   naviToolbar = new NavigationToolbar(driver);
   hpActivity = new HomePageActivity(driver);
   spaceMag = new SpaceManagement(driver);
   conn = new PeopleConnection(driver);
   magAc.signIn("john", "gtn");
 }
 @BeforeMethod
 public void beforeMethods() {
   initSeleniumTest();
   driver.get(baseUrl);
   info("Login with " + DATA_USER1);
   magAcc = new ManageAccount(driver);
   naviToolbar = new NavigationToolbar(driver);
   peoPro = new PeopleProfile(driver);
   magAcc.signIn(DATA_USER1, DATA_PASS);
 }
  /*
   * CaseId 77703: Post an activity with "Connections" filter selected
   * CaseId 77708: Comment from "Connections"
   * Pre-Condition: john and demo must be connected each other before tests started
   */
  @Test
  public void test04_ActivityComment_ConnectionsFilter() {
    String activity = "Connections filter: Post an activity by demo.";
    String comment = "Connections filter: Comment for an activity by john.";

    // Create data for Pre-Conditions
    naviToolbar.goToConnectionPage();
    conn.connectPeople(fullname_demo);
    magAc.userSignIn(userType.DEVELOPER);
    naviToolbar.goToConnectionPage();
    conn.acceptInvitation(fullname_john);
    magAc.userSignIn(userType.ADMIN);

    // Start test case
    naviToolbar.goToHomePage();

    // Step1: Connections filter is displayed
    selectFileter("Connections");

    // sign-in by demo. Add an activity
    magAc.userSignIn(userType.DEVELOPER);
    naviToolbar.goToHomePage();
    addActivity(true, activity, false, "");

    // sign-in by john. Select Connections filter
    magAc.userSignIn(userType.ADMIN);
    naviToolbar.goToHomePage();
    selectFileter("Connections");

    // Step2: Add a comment. Select All Activities filter.
    addComment(activity, comment);
    selectFileter("All Activities");

    // Select Connections filter
    selectFileter("Connections");

    // Delete activity before exit test cases
    magAc.userSignIn(userType.DEVELOPER);
    naviToolbar.goToHomePage();
    hpActivity.deleteActivity(activity);
    naviToolbar.goToConnectionPage();
    conn.removeConnection(fullname_john);
  }
예제 #18
0
 @BeforeMethod
 public void beforeMethods() {
   initSeleniumTest();
   driver.get(baseUrl);
   info("Login ECMS with " + DATA_USER);
   magAcc = new ManageAccount(driver);
   ecMain = new ECMainFunction(driver);
   magScript = new ManageScript(driver);
   magAcc.signIn(DATA_USER, DATA_PASS);
 }
예제 #19
0
  @BeforeMethod
  public void setUpBeforeTest() {
    initSeleniumTest();
    driver.get(baseUrl);
    magAc = new ManageAccount(driver);
    navTool = new NavigationToolbar(driver);
    user = new UserGroupManagement(driver);

    magAc.signIn("john", "gtn");
  }
 @BeforeMethod
 public void beforeMethods() {
   initSeleniumTest();
   driver.get(baseUrl);
   acc = new ManageAccount(driver, this.plfVersion);
   nav = new NavigationToolbar(driver, this.plfVersion);
   acc.signIn(DATA_USER1, DATA_PASS);
   mMember = new ManageMember(driver, this.plfVersion);
   catMag = new ForumManageCategory(driver, this.plfVersion);
   mPage = new PageManagement(driver, this.plfVersion);
 }
  // Qmetry ID: 69807
  // View content of search result when user does not have permission to view page
  @Test
  public void test03_ViewContentOfSearchResultWhenUserDoesNotHavePermissionToViewPage() {

    String[] user1 = {"james"};

    String PAGE_NAME1 = "Wiki_Advanced_Search_03";

    By ELEMENT_PAGE1 = By.linkText(PAGE_NAME1);

    goToWiki();

    addBlankWikiPage(PAGE_NAME1, PAGE_NAME1, 0);

    deletePagePermission("any");

    addPagePermission(0, user1);

    editPagePermission("james", false, false, false, 2);

    magAc.signOut();

    magAc.signIn("james", "gtn");

    goToWiki();

    advancedSearch(PAGE_NAME1, "Intranet");

    // waitForTextPresent(ELEMENT_VERIFY_MESSAGE);
    waitForAndGetElement(
        ELEMENT_VERIFY_RESULT_SEARCH.replace("${pageName}", PAGE_NAME1), DEFAULT_TIMEOUT, 1, 2);

    magAc.signOut();

    magAc.signIn("john", "gtn");

    goToWiki();

    click(ELEMENT_PAGE1);

    deleteCurrentWikiPage();
  }
 @BeforeMethod
 public void beforeMethods() {
   initSeleniumTest();
   driver.get(baseUrl);
   info("Login with " + DATA_USER1);
   naviToolbar = new NavigationToolbar(driver, this.plfVersion);
   magAcc = new ManageAccount(driver, this.plfVersion);
   brandMag = new BrandingManagement(driver, this.plfVersion);
   button = new Button(driver, this.plfVersion);
   event = new Event(driver, this.plfVersion);
   magAcc.signIn(DATA_USER1, DATA_PASS);
 }
  @BeforeMethod
  public void setUpBeforeTest() {
    setPreferenceRunTime();
    initSeleniumTest();
    magAc = new ManageAccount(driver, this.plfVersion);
    cat = new ForumManageCategory(driver, this.plfVersion);
    forum = new ForumManageForum(driver, this.plfVersion);
    magtopic = new ForumManageTopic(driver, this.plfVersion);

    magAc.signIn("john", "gtn");
    goToForums();
  }
  @BeforeMethod
  public void setUpBeforeTest() {
    initSeleniumTest();
    driver.get(baseUrl);
    magAc = new ManageAccount(driver, this.plfVersion);
    navTool = new NavigationToolbar(driver, this.plfVersion);
    pageMag = new PageManagement(driver, this.plfVersion);
    pageE = new PageEditor(driver, this.plfVersion);
    but = new Button(driver, this.plfVersion);

    magAc.signIn("john", "gtn");
  }
 @BeforeMethod
 public void beforeMethods() {
   initSeleniumTest();
   driver.get(baseUrl);
   info("Login with " + DATA_USER1);
   magAcc = new ManageAccount(driver);
   navToolBar = new NavigationToolbar(driver);
   ecms = new EcmsBase(driver);
   button = new Button(driver);
   activity = new HomePageActivity(driver);
   actBar = new ActionBar(driver);
   magAcc.signIn(DATA_USER1, DATA_PASS);
 }
 @BeforeMethod
 public void beforeMethods() {
   initSeleniumTest();
   driver.get(baseUrl);
   acc = new ManageAccount(driver, this.plfVersion);
   nav = new NavigationToolbar(driver, this.plfVersion);
   act = new ActionBar(driver, this.plfVersion);
   mPage = new PageManagement(driver, this.plfVersion);
   ecms = new EcmsBase(driver, this.plfVersion);
   pEdit = new PageEditor(driver, this.plfVersion);
   button = new Button(driver, this.plfVersion);
   acc.signIn(DATA_USER1, DATA_PASS);
 }
 @BeforeMethod
 public void beforeMethods() {
   initSeleniumTest();
   driver.get(baseUrl);
   info("Login ECMS with " + DATA_USER);
   button = new Button(driver);
   magAcc = new ManageAccount(driver);
   ecms = new EcmsBase(driver);
   ecMain = new ECMainFunction(driver);
   magNode = new ManageNodeType(driver);
   magAcc.signIn(DATA_USER, DATA_PASS);
   ecMain.goToNodeTypeTab();
 }
  @BeforeMethod
  public void setUpBeforeTest() {
    initSeleniumTest();
    magAc = new ManageAccount(driver);
    mngCat = new ForumManageCategory(driver, this.plfVersion);
    mngFru = new ForumManageForum(driver, this.plfVersion);
    mngTopic = new ForumManageTopic(driver, this.plfVersion);
    mngPost = new ForumManagePost(driver, this.plfVersion);
    button = new Button(driver);

    magAc.signIn(DATA_USER1, DATA_PASS);
    goToForums();
  }
 @BeforeMethod
 public void setUpBeforeTest() {
   initSeleniumTest();
   driver.get(baseUrl);
   magAcc = new ManageAccount(driver, this.plfVersion);
   magAcc.signIn(DATA_USER1, DATA_PASS);
   hGadget = new HomePageGadget(driver);
   magMember = new ManageMember(driver, this.plfVersion);
   evt = new Event(driver, this.plfVersion);
   qsPage = new SettingSearchPage(driver);
   spaceMag = new SpaceManagement(driver);
   button = new Button(driver);
 }
 @BeforeMethod
 public void setUpBeforeTest() {
   initSeleniumTest();
   driver.get(baseUrl);
   magAc = new ManageAccount(driver);
   navTool = new NavigationToolbar(driver);
   group = new UserGroupManagement(driver);
   navToolbar = new NavigationToolbar(driver);
   button = new Button(driver);
   magAlert = new ManageAlert(driver);
   pageEditor = new PageEditor(driver);
   pageMag = new PageManagement(driver);
   magAc.signIn("john", "gtn");
 }