/**
   * CaseId: 70588 + 70589 + 70590 -> Add, edit, remove application when edit layout for portal's
   * page
   */
  @Test
  public void test06_AddEditRemoveAppWhenEditLayout_PortalPage() {
    String pageName = "Sniffportalnavigation06";

    info("Create new page of portal with empty layout and applications");
    pageE.createNewPageEmptyLayout(pageName);

    info("Add application when edit layout of page");
    navTool.goToEditPageEditor();
    click(By.linkText("Content"));
    dragAndDropToObject(ELEMENT_CONTENTS_LIST_VIEWER_PORTLET, ELEMENT_DROP_TARGET_NO_LAYOUT);
    click(ELEMENT_SWITCH_VIEW_MODE);
    waitForAndGetElement(ELEMENT_CLV_PORTLET);
    click(ELEMENT_SWITCH_VIEW_MODE);
    pageE.finishEditLayout();

    info("Edit application when edit layout of page");
    navTool.goToEditPageEditor();
    pageE.selectCLVPath("General Drives/Sites Management/acme", "documents");
    click(ELEMENT_SWITCH_VIEW_MODE);
    waitForTextPresent("offices.jpg");
    waitForTextPresent("metro.pdf");
    waitForTextPresent("conditions.doc");
    click(ELEMENT_SWITCH_VIEW_MODE);
    pageE.finishEditLayout();

    info("Remove application when edit layout of page");
    navTool.goToEditPageEditor();
    pageE.removePortlet(ELEMENT_FRAME_CONTAIN_PORTLET, ELEMENT_DELETE_PORTLET_ICON);
    waitForElementNotPresent(ELEMENT_CLV_PORTLET);

    info("Delete page");
    pageMag.deletePageAtManagePageAndPortalNavigation(pageName, true, "intranet", false, null);
  }
示例#2
0
  /** CaseId: 68859 Change container when edit layout for user's page */
  @Test
  public void test04_ChangeContainerWhenEditLayoutUserPage() {
    String pageName = "gateinsniff04";
    String title = "Row1";

    navTool.goToDashboard();
    pageE.createNewPageEmptyLayout(pageName);
    navTool.goToEditPageEditor();

    info("Add container");
    pageE.addNewContainer("Rows Layout", "oneRow");
    waitForAndGetElement(ELEMENT_DROP_TARGET_HAS_LAYOUT);
    click(ELEMENT_SWITCH_VIEW_MODE);
    waitForAndGetElement(ELEMENT_DROP_TARGET_HAS_LAYOUT);
    click(ELEMENT_SWITCH_VIEW_MODE);

    info("Edit container");
    mouseOver(ELEMENT_DROP_TARGET_HAS_LAYOUT, true);
    click(ELEMENT_EDIT_CONTAINER_ICON);
    type(ELEMENT_CONTAINER_TITLE, title, true);
    but.save();
    mouseOver(ELEMENT_DROP_TARGET_HAS_LAYOUT, true);
    waitForAndGetElement("//*[@class='UIRowContainer']//span[text()='" + title + "']");

    info("Delete container");
    pageE.removeContainer(ELEMENT_DROP_TARGET_HAS_LAYOUT, ELEMENT_DELETE_CONTAINER_ICON);
    waitForElementNotPresent(ELEMENT_DROP_TARGET_HAS_LAYOUT);
    click(ELEMENT_PAGE_FINISH_BUTTON);
    waitForElementNotPresent(ELEMENT_PAGE_FINISH_BUTTON, 60000);

    deleteTabOnDashboard(pageName);
  }
  /** CaseId: 68876 Add application into container when edit layout for portal's page */
  @Test
  public void test01_AddAppToContainer_LayoutOfPortalPage() {
    String pageName = "Sniffportalnavigation01";
    String category = "Collaboration";
    String portletId = "Collaboration/AnswersPortlet";

    info("Create page for portal with empty layout");
    pageE.createNewPageEmptyLayout(pageName);

    info("Go to page edit layout");
    navTool.goToEditPageEditor();

    info("Add new container and application to page layout");
    pageE.addNewContainerAndPortlet("Rows Layout", "oneRow", category, portletId, false);
    click(ELEMENT_SWITCH_VIEW_MODE);
    waitForAndGetElement(ELEMENT_ANWSER_PORTLET_IN_VIEW_PAGE);
    click(ELEMENT_SWITCH_VIEW_MODE);
    pageE.finishEditLayout();

    info("Delete page");
    pageMag.deletePageAtManagePageAndPortalNavigation(pageName, true, "intranet", false, null);
  }
  /**
   * CaseId: 70593 + 70594 + 70592 + 70595 Add container when edit layout for portal's page edit
   * container when edit layout for portal's page move container when edit layout for portal's page
   * delete container when edit layout for portal's page
   */
  @Test
  public void test07_MoveContainerWhenEditLayout_PortalPage() {
    String pageName = "Sniffportalnavigation07";
    String title = "Container1";
    String newContainerPos = "//*[@class='UIRowContainer']/div[2]";

    pageE.createNewPageEmptyLayout(pageName);
    navTool.goToEditPageEditor();

    info("Add container");
    pageE.addNewContainer("Rows Layout", "oneRow");
    waitForAndGetElement(ELEMENT_DROP_TARGET_HAS_LAYOUT);

    info("Edit title of container");
    mouseOver(ELEMENT_DROP_TARGET_HAS_LAYOUT, true);
    click(ELEMENT_EDIT_CONTAINER_ICON);
    type(ELEMENT_CONTAINER_TITLE, title, true);
    type(ELEMENT_WIDTH_TEXTBOX, "150px", true);
    type(ELEMENT_HEIGHT_TEXTBOX, "150px", true);
    but.save();
    mouseOver(ELEMENT_DROP_TARGET_HAS_LAYOUT, true);
    if (this.plfVersion.contains("4.0"))
      waitForAndGetElement(ELEMENT_NAME_CONTAINER.replace("${nameContainer}", title));
    else waitForAndGetElement(ELEMENT_NAME_CONTAINER_PLF41.replace("${nameContainer}", title));
    WebElement element = waitForAndGetElement(ELEMENT_EDITING_CONTAINER);
    String valueStyle = element.getAttribute("style");
    assert valueStyle.equals("width: 150px; height: 150px;")
        : "Failed to edit the value of container: " + title;

    info("Move container");
    pageE.addNewContainer("Rows Layout", "oneRow");
    waitForAndGetElement(
        ELEMENT_LIST_CONTAINER.replace("${number}", "1").replace("${nameContainer}", "Container"),
        DEFAULT_TIMEOUT,
        1,
        2);
    waitForAndGetElement(
        ELEMENT_LIST_CONTAINER.replace("${number}", "2").replace("${nameContainer}", title),
        DEFAULT_TIMEOUT,
        1,
        2);
    mouseOver(ELEMENT_NAME_CURRENT_CONTAINER.replace("${nameContainer}", "Container"), true);
    if (this.plfVersion.contains("4.0"))
      dragAndDropToObject(
          ELEMENT_DRAG_CURRENT_CONTAINER.replace("${nameContainer}", "Container"),
          ELEMENT_PORTLET_LAYOUT_DECORATOR);
    else
      dragAndDropToObject(
          ELEMENT_DRAG_CURRENT_CONTAINER_PLF41.replace("${nameContainer}", "Container"),
          newContainerPos);
    waitForAndGetElement(
        ELEMENT_LIST_CONTAINER.replace("${number}", "1").replace("${nameContainer}", title),
        DEFAULT_TIMEOUT,
        1,
        2);
    waitForAndGetElement(
        ELEMENT_LIST_CONTAINER.replace("${number}", "1").replace("${nameContainer}", "Container"),
        DEFAULT_TIMEOUT,
        1,
        2);
    click(ELEMENT_ABORTEDIT_BUTTON);
    click(pageE.ELEMENT_CONFIRM_YES_BUTTON);
    waitForElementNotPresent(pageE.ELEMENT_VIEW_PAGE_PROPERTIES);

    info("Delete container");
    navTool.goToEditPageEditor();
    pageE.addNewContainer("Rows Layout", "oneRow");
    pageE.removeContainer(
        ELEMENT_NAME_CURRENT_CONTAINER.replace("${nameContainer}", "Container"),
        ELEMENT_DELETE_CONTAINER_ICON);
    pageE.finishEditLayout();
    waitForElementNotPresent(pageE.ELEMENT_VIEW_PAGE_PROPERTIES);

    info("Delete page");
    pageMag.deletePageAtManagePageAndPortalNavigation(pageName, true, "intranet", false, null);
  }