public void testAddFolderDocumentComment() throws Exception {
    selenium.open("/web/guest/home/");

    for (int second = 0; ; second++) {
      if (second >= 60) {
        fail("timeout");
      }

      try {
        if (selenium.isElementPresent("link=Document Library Test Page")) {
          break;
        }
      } catch (Exception e) {
      }

      Thread.sleep(1000);
    }

    selenium.saveScreenShotAndSource();
    selenium.clickAt("link=Document Library Test Page", RuntimeVariables.replace(""));
    selenium.waitForPageToLoad("30000");
    selenium.saveScreenShotAndSource();
    selenium.clickAt("//a/strong", RuntimeVariables.replace(""));
    selenium.waitForPageToLoad("30000");
    selenium.saveScreenShotAndSource();
    selenium.clickAt("//td[1]/a", RuntimeVariables.replace(""));
    selenium.waitForPageToLoad("30000");
    selenium.saveScreenShotAndSource();
    selenium.clickAt("link=Be the first.", RuntimeVariables.replace(""));

    for (int second = 0; ; second++) {
      if (second >= 60) {
        fail("timeout");
      }

      try {
        if (selenium.isVisible("_20_postReplyBody0")) {
          break;
        }
      } catch (Exception e) {
      }

      Thread.sleep(1000);
    }

    selenium.saveScreenShotAndSource();
    selenium.type("_20_postReplyBody0", RuntimeVariables.replace("This is a test1 comment1."));
    selenium.saveScreenShotAndSource();
    selenium.keyPress("_20_postReplyBody0", RuntimeVariables.replace("\\48"));
    selenium.keyPress("_20_postReplyBody0", RuntimeVariables.replace("\\8"));
    selenium.click(RuntimeVariables.replace("//input[@value='Reply']"));
    selenium.waitForPageToLoad("30000");
    selenium.saveScreenShotAndSource();
    assertEquals(
        RuntimeVariables.replace("Your request completed successfully."),
        selenium.getText("//section/div/div/div/div[1]"));
    assertEquals(
        RuntimeVariables.replace("This is a test1 comment1."),
        selenium.getText("//div/div[3]/div/div[1]"));
  }
Exemple #2
0
 public void testViewAnnouncementDelivery() throws Exception {
   selenium.selectWindow("null");
   selenium.selectFrame("relative=top");
   selenium.open("/web/guest/home/");
   assertEquals(
       RuntimeVariables.replace("Go to"), selenium.getText("//li[@id='_145_mySites']/a/span"));
   selenium.mouseOver("//li[@id='_145_mySites']/a/span");
   selenium.waitForVisible("link=Control Panel");
   selenium.clickAt("link=Control Panel", RuntimeVariables.replace("Control Panel"));
   selenium.waitForPageToLoad("30000");
   selenium.clickAt("link=My Account", RuntimeVariables.replace("My Account"));
   selenium.waitForPageToLoad("30000");
   selenium.waitForVisible("//a[@id='_2_announcementsLink']");
   assertTrue(selenium.isPartialText("//a[@id='_2_announcementsLink']", "Announcements"));
   selenium.clickAt("//a[@id='_2_announcementsLink']", RuntimeVariables.replace("Announcements"));
   selenium.waitForVisible("//input[@id='_2_announcementsTypegeneralEmailCheckbox']");
   assertTrue(selenium.isChecked("//input[@id='_2_announcementsTypegeneralEmailCheckbox']"));
   assertTrue(selenium.isChecked("//input[@id='_2_announcementsTypegeneralSmsCheckbox']"));
   assertTrue(
       selenium.isElementPresent(
           "//input[@id='_2_announcementsTypegeneralWebsiteCheckbox' and @disabled='']"));
   assertTrue(selenium.isChecked("//input[@id='_2_announcementsTypenewsEmailCheckbox']"));
   assertTrue(selenium.isChecked("//input[@id='_2_announcementsTypenewsSmsCheckbox']"));
   assertTrue(
       selenium.isElementPresent(
           "//input[@id='_2_announcementsTypenewsWebsiteCheckbox' and @disabled='']"));
   assertTrue(selenium.isChecked("//input[@id='_2_announcementsTypetestEmailCheckbox']"));
   assertTrue(selenium.isChecked("//input[@id='_2_announcementsTypetestSmsCheckbox']"));
   assertTrue(
       selenium.isElementPresent(
           "//input[@id='_2_announcementsTypetestWebsiteCheckbox' and @disabled='']"));
 }
 public void testViewConfigurePortletTableBlogsEntryAP() throws Exception {
   selenium.selectWindow("null");
   selenium.selectFrame("relative=top");
   selenium.open("/web/guest/home/");
   selenium.clickAt(
       "link=Asset Publisher Test Page", RuntimeVariables.replace("Asset Publisher Test Page"));
   selenium.waitForPageToLoad("30000");
   assertEquals(RuntimeVariables.replace("Title"), selenium.getText("//th[1]"));
   assertEquals(RuntimeVariables.replace("Blogs Entry Title"), selenium.getText("//td[1]/a"));
   selenium.clickAt("//td[1]/a", RuntimeVariables.replace("Blogs Entry Title"));
   selenium.waitForPageToLoad("30000");
   assertEquals(
       RuntimeVariables.replace("Blogs Entry Title"),
       selenium.getText("//h1[@class='header-title']"));
   assertEquals(
       RuntimeVariables.replace("Blogs Entry Content"),
       selenium.getText("//div[@class='asset-content']/p"));
   assertEquals(
       RuntimeVariables.replace("View in Context \u00bb"),
       selenium.getText("//div[@class='asset-more']/a"));
   selenium.clickAt(
       "//div[@class='asset-more']/a", RuntimeVariables.replace("View in Context \u00bb"));
   selenium.waitForPageToLoad("30000");
   assertEquals(
       RuntimeVariables.replace("Blogs Entry Title"),
       selenium.getText("//h1[@class='header-title']"));
   assertEquals(
       RuntimeVariables.replace("Blogs Entry Content"),
       selenium.getText("//div[@class='entry-body']/p"));
 }
Exemple #4
0
  public void testAddPortletMail() throws Exception {
    selenium.open("/web/guest/home/");
    loadRequiredJavaScriptModules();

    for (int second = 0; ; second++) {
      if (second >= 90) {
        fail("timeout");
      }

      try {
        if (selenium.isVisible("link=Mail Test Page")) {
          break;
        }
      } catch (Exception e) {
      }

      Thread.sleep(1000);
    }

    selenium.click(RuntimeVariables.replace("link=Mail Test Page"));
    selenium.waitForPageToLoad("30000");
    loadRequiredJavaScriptModules();
    assertTrue(selenium.isPartialText("//a[@id='_145_addApplication']", "More"));
    selenium.clickAt("//a[@id='_145_addApplication']", RuntimeVariables.replace("More"));
    assertTrue(selenium.isPartialText("//a[@id='_145_addApplication']", "More"));

    for (int second = 0; ; second++) {
      if (second >= 90) {
        fail("timeout");
      }

      try {
        if (selenium.isElementPresent("//div[@title='Mail']/p/a")) {
          break;
        }
      } catch (Exception e) {
      }

      Thread.sleep(1000);
    }

    selenium.clickAt("//div[@title='Mail']/p/a", RuntimeVariables.replace("Add"));

    for (int second = 0; ; second++) {
      if (second >= 90) {
        fail("timeout");
      }

      try {
        if (selenium.isVisible("//section")) {
          break;
        }
      } catch (Exception e) {
      }

      Thread.sleep(1000);
    }

    assertTrue(selenium.isVisible("//section"));
  }
 public void testViewUserRequest() throws Exception {
   selenium.selectWindow("null");
   selenium.selectFrame("relative=top");
   selenium.open("/web/guest/home/");
   selenium.waitForElementPresent("link=Control Panel");
   selenium.clickAt("link=Control Panel", RuntimeVariables.replace("Control Panel"));
   selenium.waitForPageToLoad("30000");
   selenium.clickAt("link=Communities", RuntimeVariables.replace("Communities"));
   selenium.waitForPageToLoad("30000");
   selenium.type("_134_name", RuntimeVariables.replace("Membership Request Community Name"));
   selenium.clickAt("//input[@value='Search']", RuntimeVariables.replace("Search"));
   selenium.waitForPageToLoad("30000");
   assertEquals(RuntimeVariables.replace("Actions"), selenium.getText("//strong/span"));
   selenium.clickAt("//strong/span", RuntimeVariables.replace("Actions"));
   selenium.waitForVisible("//div[@class='lfr-component lfr-menu-list']/ul/li[5]/a");
   assertEquals(
       RuntimeVariables.replace("View Membership Requests"),
       selenium.getText("//div[@class='lfr-component lfr-menu-list']/ul/li[5]/a"));
   selenium.click(
       RuntimeVariables.replace("//div[@class='lfr-component lfr-menu-list']/ul/li[5]/a"));
   selenium.waitForPageToLoad("30000");
   assertEquals(
       RuntimeVariables.replace("requestmemberfn requestmemberln ([email protected])"),
       selenium.getText("//tr[3]/td[2]"));
   assertEquals(
       RuntimeVariables.replace("Community Description comments request to join"),
       selenium.getText("//tr[3]/td[3]"));
 }
  public void testAddDocumentLibraryFolderCommunity() throws Exception {
    selenium.open("/user/joebloggs/home/");

    for (int second = 0; ; second++) {
      if (second >= 60) {
        fail("timeout");
      }

      try {
        if (selenium.isElementPresent("link=Communities I Own")) {
          break;
        }
      } catch (Exception e) {
      }

      Thread.sleep(1000);
    }

    selenium.clickAt("link=Communities I Own", RuntimeVariables.replace(""));
    selenium.waitForPageToLoad("30000");
    selenium.clickAt("//input[@value='Add Community']", RuntimeVariables.replace(""));
    selenium.waitForPageToLoad("30000");
    selenium.type("_29_name", RuntimeVariables.replace("Document Library Folder Community"));
    selenium.clickAt("//input[@value='Save']", RuntimeVariables.replace(""));
    selenium.waitForPageToLoad("30000");
    assertTrue(selenium.isTextPresent("Your request processed successfully."));
    assertTrue(selenium.isTextPresent("Document Library Folder Community"));
  }
  public void testSRl2_AddAsFriend() throws Exception {
    selenium.open("/web/socialrelationsn1/home/");

    for (int second = 0; ; second++) {
      if (second >= 90) {
        fail("timeout");
      }

      try {
        if (selenium.isVisible("link=Summary Test Page")) {
          break;
        }
      } catch (Exception e) {
      }

      Thread.sleep(1000);
    }

    selenium.clickAt("link=Summary Test Page", RuntimeVariables.replace("Summary Test Page"));
    selenium.waitForPageToLoad("30000");
    assertEquals(
        RuntimeVariables.replace("Add as Friend"),
        selenium.getText("//p[@class='add-as-friend']/span/a[2]"));
    selenium.clickAt(
        "//p[@class='add-as-friend']/span/a[2]", RuntimeVariables.replace("Add as Friend"));
    selenium.waitForPageToLoad("30000");
    assertEquals(
        RuntimeVariables.replace("Your request processed successfully."),
        selenium.getText("//div[@class='portlet-msg-success']"));
    assertEquals(
        RuntimeVariables.replace("Friend Requested"),
        selenium.getText("//div[@class='portlet-msg-info add-as-friend pending']"));
  }
  public void testPortlet_ControlPanel() throws Exception {
    int label = 1;

    while (label >= 1) {
      switch (label) {
        case 1:
          boolean NotInControlPanel = selenium.isElementPresent("link=Welcome - Liferay");

          if (!NotInControlPanel) {
            label = 2;

            continue;
          }

          selenium.clickAt("link=Welcome - Liferay", RuntimeVariables.replace(""));
          selenium.waitForPageToLoad("30000");

        case 2:
          selenium.clickAt("link=Control Panel", RuntimeVariables.replace(""));
          selenium.waitForPageToLoad("30000");

        case 100:
          label = -1;
      }
    }
  }
Exemple #9
0
 public void testReplyMBThreadReply3() throws Exception {
   selenium.selectWindow("null");
   selenium.selectFrame("relative=top");
   selenium.open("/web/guest/home/");
   selenium.clickAt(
       "link=Message Boards Test Page", RuntimeVariables.replace("Message Boards Test Page"));
   selenium.waitForPageToLoad("30000");
   assertEquals(
       RuntimeVariables.replace("MB Thread Message Subject"), selenium.getText("//td[1]/a"));
   selenium.clickAt("//td[1]/a", RuntimeVariables.replace("MB Thread Message Subject"));
   selenium.waitForPageToLoad("30000");
   assertEquals(RuntimeVariables.replace("Reply"), selenium.getText("//span[.='Reply']"));
   selenium.clickAt("//span[.='Reply']", RuntimeVariables.replace("Reply"));
   selenium.waitForPageToLoad("30000");
   selenium.waitForVisible(
       "//a[contains(@class,'cke_button cke_button__unlink') and contains(@class,' cke_button_disabled')]");
   selenium.waitForVisible("//iframe[contains(@title,'Rich Text Editor')]");
   selenium.typeFrame(
       "//iframe[contains(@title,'Rich Text Editor')]",
       RuntimeVariables.replace("MB Thread Message Reply3 Body"));
   selenium.clickAt("//input[@value='Publish']", RuntimeVariables.replace("Publish"));
   selenium.waitForPageToLoad("30000");
   assertEquals(
       RuntimeVariables.replace("Your request completed successfully."),
       selenium.getText("//div[@class='portlet-msg-success']"));
   assertEquals(
       RuntimeVariables.replace("RE: MB Thread Message Subject"),
       selenium.getText("xPath=(//div[@class='subject']/a/strong)[4]"));
   assertEquals(
       RuntimeVariables.replace("MB Thread Message Reply3 Body"),
       selenium.getText("xPath=(//div[@class='thread-body'])[4]"));
 }
  public void testConfigureSAUserEmailAddress() throws Exception {
    selenium.open("/web/guest/home/");
    loadRequiredJavaScriptModules();

    for (int second = 0; ; second++) {
      if (second >= 90) {
        fail("timeout");
      }

      try {
        if (selenium.isElementPresent("link=Control Panel")) {
          break;
        }
      } catch (Exception e) {
      }

      Thread.sleep(1000);
    }

    selenium.clickAt("link=Control Panel", RuntimeVariables.replace("Control Panel"));
    selenium.waitForPageToLoad("30000");
    loadRequiredJavaScriptModules();
    selenium.clickAt("link=My Account", RuntimeVariables.replace("My Account"));
    selenium.waitForPageToLoad("30000");
    loadRequiredJavaScriptModules();
    selenium.type(
        "//input[@id='_2_emailAddress']",
        RuntimeVariables.replace("*****@*****.**"));
    selenium.clickAt("//input[@value='Save']", RuntimeVariables.replace("Save"));
    selenium.waitForPageToLoad("30000");
    loadRequiredJavaScriptModules();
    assertEquals(
        RuntimeVariables.replace("Your request completed successfully."),
        selenium.getText("//div[@class='portlet-msg-success']"));
  }
  public void testGuest_ViewComments() throws Exception {
    selenium.open("/web/guest/home/");

    for (int second = 0; ; second++) {
      if (second >= 90) {
        fail("timeout");
      }

      try {
        if (selenium.isElementPresent("link=Blogs Permissions Page")) {
          break;
        }
      } catch (Exception e) {
      }

      Thread.sleep(1000);
    }

    selenium.clickAt(
        "link=Blogs Permissions Page", RuntimeVariables.replace("Blogs Permissions Page"));
    selenium.waitForPageToLoad("30000");
    selenium.clickAt(
        "link=Permissions Blogs Test Entry",
        RuntimeVariables.replace("Permissions Blogs Test Entry"));
    selenium.waitForPageToLoad("30000");
    Thread.sleep(5000);
    assertEquals(
        RuntimeVariables.replace("BA Permissions Blogs Test Comment"),
        selenium.getText("//div[@class='lfr-discussion-message']"));
    assertEquals(
        RuntimeVariables.replace("Member Permissions Blogs Test Comment"),
        selenium.getText("//div[@class='lfr-discussion last']/div[3]/div/div"));
  }
Exemple #12
0
  public void testViewWikiPageOrphanOrphanPages() throws Exception {
    selenium.open("/web/guest/home/");
    loadRequiredJavaScriptModules();

    for (int second = 0; ; second++) {
      if (second >= 90) {
        fail("timeout");
      }

      try {
        if (selenium.isVisible("link=Wiki Test Page")) {
          break;
        }
      } catch (Exception e) {
      }

      Thread.sleep(1000);
    }

    selenium.clickAt("link=Wiki Test Page", RuntimeVariables.replace("Wiki Test Page"));
    selenium.waitForPageToLoad("30000");
    loadRequiredJavaScriptModules();
    selenium.clickAt("link=Orphan Pages", RuntimeVariables.replace("Orphan Pages"));
    selenium.waitForPageToLoad("30000");
    loadRequiredJavaScriptModules();
    assertEquals(RuntimeVariables.replace("Wiki Page2 Title"), selenium.getText("//tr[5]/td[1]/a"));
  }
  public void testConfigurePageRevisionDefaultSingleApprover() throws Exception {
    selenium.open("/web/guest/home/");

    for (int second = 0; ; second++) {
      if (second >= 90) {
        fail("timeout");
      }

      try {
        if (selenium.isElementPresent("link=Control Panel")) {
          break;
        }
      } catch (Exception e) {
      }

      Thread.sleep(1000);
    }

    selenium.click(RuntimeVariables.replace("link=Control Panel"));
    selenium.waitForPageToLoad("30000");
    selenium.click(RuntimeVariables.replace("link=Workflow Configuration"));
    selenium.waitForPageToLoad("30000");
    selenium.select(
        "//select[@id='*****@*****.**']",
        RuntimeVariables.replace("Default: Single Approver"));
    selenium.clickAt("//input[@value='Save']", RuntimeVariables.replace("Save"));
    selenium.waitForPageToLoad("30000");
    assertEquals(
        RuntimeVariables.replace("Your request completed successfully."),
        selenium.getText("//div[@class='portlet-msg-success']"));
    assertEquals(
        "Default: Single Approver",
        selenium.getSelectedLabel(
            "//select[@id='*****@*****.**']"));
  }
  public void testMember_AssertFolderActionsNotPresent() throws Exception {
    selenium.open("/web/guest/home/");
    loadRequiredJavaScriptModules();

    for (int second = 0; ; second++) {
      if (second >= 90) {
        fail("timeout");
      }

      try {
        if (selenium.isElementPresent("link=Control Panel")) {
          break;
        }
      } catch (Exception e) {
      }

      Thread.sleep(1000);
    }

    selenium.clickAt("link=Control Panel", RuntimeVariables.replace("Control Panel"));
    selenium.waitForPageToLoad("30000");
    loadRequiredJavaScriptModules();
    selenium.clickAt("link=Documents and Media", RuntimeVariables.replace("Documents and Media"));
    selenium.waitForPageToLoad("30000");
    loadRequiredJavaScriptModules();
    assertTrue(
        selenium.isElementNotPresent(
            "//span[@class='overlay document-action']/span/ul/li/strong/a"));
  }
  public void testAddPageDL() throws Exception {
    selenium.open("/web/guest/home/");
    selenium.clickAt("//nav[@id='navigation']", RuntimeVariables.replace("Navigation"));

    for (int second = 0; ; second++) {
      if (second >= 90) {
        fail("timeout");
      }

      try {
        if (selenium.isElementPresent("//a[@id='addPage']")) {
          break;
        }
      } catch (Exception e) {
      }

      Thread.sleep(1000);
    }

    selenium.clickAt("//a[@id='addPage']", RuntimeVariables.replace("Add Page"));

    for (int second = 0; ; second++) {
      if (second >= 90) {
        fail("timeout");
      }

      try {
        if (selenium.isVisible("//input[@type='text']")) {
          break;
        }
      } catch (Exception e) {
      }

      Thread.sleep(1000);
    }

    selenium.type(
        "//input[@type='text']", RuntimeVariables.replace("Documents and Media Test Page"));
    selenium.clickAt("//button[@id='save']", RuntimeVariables.replace("Save"));

    for (int second = 0; ; second++) {
      if (second >= 90) {
        fail("timeout");
      }

      try {
        if (selenium.isVisible("link=Documents and Media Test Page")) {
          break;
        }
      } catch (Exception e) {
      }

      Thread.sleep(1000);
    }

    selenium.clickAt(
        "link=Documents and Media Test Page",
        RuntimeVariables.replace("Documents and Media Test Page"));
    selenium.waitForPageToLoad("30000");
  }
  public void testAddFrontPage() throws Exception {
    selenium.open("/web/guest/home/");

    for (int second = 0; ; second++) {
      if (second >= 60) {
        fail("timeout");
      }

      try {
        if (selenium.isElementPresent("link=Wiki Test Page")) {
          break;
        }
      } catch (Exception e) {
      }

      Thread.sleep(1000);
    }

    selenium.clickAt("link=Wiki Test Page", RuntimeVariables.replace(""));
    selenium.waitForPageToLoad("30000");
    selenium.clickAt(
        "link=This page is empty. Edit it to add some text.", RuntimeVariables.replace(""));
    selenium.waitForPageToLoad("30000");
    selenium.type("_36_content", RuntimeVariables.replace("This is a wiki frontpage test."));
    selenium.clickAt("//input[@value='Publish']", RuntimeVariables.replace(""));
    selenium.waitForPageToLoad("30000");
    assertTrue(selenium.isTextPresent("Your request processed successfully."));
    assertEquals(
        RuntimeVariables.replace("This is a wiki frontpage test."),
        selenium.getText("//div[@class='wiki-body']"));
  }
  public void testAssertGoogleMapWithDirections() throws Exception {
    selenium.open("/web/guest/home/");

    for (int second = 0; ; second++) {
      if (second >= 60) {
        fail("timeout");
      }

      try {
        if (selenium.isElementPresent("link=Google Maps Test Page")) {
          break;
        }
      } catch (Exception e) {
      }

      Thread.sleep(1000);
    }

    selenium.saveScreenShotAndSource();
    selenium.clickAt(
        "link=Google Maps Test Page", RuntimeVariables.replace("Google Maps Test Page"));
    selenium.waitForPageToLoad("30000");
    selenium.saveScreenShotAndSource();
    Thread.sleep(5000);
    assertEquals("11947 Del Amo Blvd, Cerritos, CA, 90703", selenium.getValue("//form/input[1]"));
    assertEquals(
        RuntimeVariables.replace("17730 Antonio Ave, Cerritos, CA, 90703"),
        selenium.getText("//div[10]/div/div[1]/div/div"));
  }
  public void testAssertGoogleMap() throws Exception {
    selenium.open("/web/guest/home/");

    for (int second = 0; ; second++) {
      if (second >= 60) {
        fail("timeout");
      }

      try {
        if (selenium.isElementPresent("link=Google Maps Test Page")) {
          break;
        }
      } catch (Exception e) {
      }

      Thread.sleep(1000);
    }

    selenium.click(RuntimeVariables.replace("link=Google Maps Test Page"));
    selenium.waitForPageToLoad("30000");
    Thread.sleep(5000);
    assertEquals(RuntimeVariables.replace("Map"), selenium.getText("//div[5]/div[1]/div"));
    assertEquals(RuntimeVariables.replace("Satellite"), selenium.getText("//div[5]/div[2]/div"));
    assertEquals(RuntimeVariables.replace("Hybrid"), selenium.getText("//div[5]/div[3]/div"));
  }
 public void testMember_BlogsRoles() throws Exception {
   selenium.clickAt("link=Define Permissions", RuntimeVariables.replace(""));
   selenium.waitForPageToLoad("30000");
   selenium.saveScreenShotAndSource();
   selenium.select("_128_add-permissions", RuntimeVariables.replace("label=Blogs"));
   selenium.waitForPageToLoad("30000");
   selenium.saveScreenShotAndSource();
   selenium.uncheck("_128_rowIds");
   selenium.check(
       "//input[@name='_128_rowIds' and @value='com.liferay.portlet.blogs.model.BlogsEntryADD_DISCUSSION']");
   selenium.uncheck(
       "//input[@name='_128_rowIds' and @value='com.liferay.portlet.blogs.model.BlogsEntryDELETE']");
   selenium.uncheck(
       "//input[@name='_128_rowIds' and @value='com.liferay.portlet.blogs.model.BlogsEntryDELETE_DISCUSSION']");
   selenium.uncheck(
       "//input[@name='_128_rowIds' and @value='com.liferay.portlet.blogs.model.BlogsEntryPERMISSIONS']");
   selenium.uncheck(
       "//input[@name='_128_rowIds' and @value='com.liferay.portlet.blogs.model.BlogsEntryUPDATE']");
   selenium.uncheck(
       "//input[@name='_128_rowIds' and @value='com.liferay.portlet.blogs.model.BlogsEntryUPDATE_DISCUSSION']");
   selenium.check(
       "//input[@name='_128_rowIds' and @value='com.liferay.portlet.blogs.model.BlogsEntryVIEW']");
   selenium.clickAt("//input[@value='Save']", RuntimeVariables.replace(""));
   selenium.waitForPageToLoad("30000");
   selenium.saveScreenShotAndSource();
   assertTrue(selenium.isTextPresent("The role permissions were updated."));
 }
Exemple #20
0
  public void testPortlet_EndControlPanel() throws Exception {
    int label = 1;

    while (label >= 1) {
      switch (label) {
        case 1:
          selenium.selectWindow("null");
          selenium.selectFrame("relative=top");

          boolean InControlPanel = selenium.isElementPresent("link=Back to Guest");

          if (!InControlPanel) {
            label = 2;

            continue;
          }

          selenium.clickAt("link=Back to Guest", RuntimeVariables.replace(""));
          selenium.waitForPageToLoad("30000");

        case 2:
          selenium.clickAt("link=Welcome - Liferay", RuntimeVariables.replace(""));
          selenium.waitForPageToLoad("30000");

        case 100:
          label = -1;
      }
    }
  }
  public void testAddCommunityGroupPageLayout() throws Exception {
    selenium.open("/web/guest/home/");

    for (int second = 0; ; second++) {
      if (second >= 90) {
        fail("timeout");
      }

      try {
        if (selenium.isElementPresent("link=Control Panel")) {
          break;
        }
      } catch (Exception e) {
      }

      Thread.sleep(1000);
    }

    selenium.clickAt("link=Control Panel", RuntimeVariables.replace("Control Panel"));
    selenium.waitForPageToLoad("30000");
    selenium.clickAt("link=Communities", RuntimeVariables.replace("Communities"));
    selenium.waitForPageToLoad("30000");
    selenium.clickAt("link=Add", RuntimeVariables.replace("Add"));
    selenium.waitForPageToLoad("30000");
    selenium.type(
        "//input[@id='_134_name']", RuntimeVariables.replace("Group Page Layout Community"));
    selenium.clickAt("//input[@value='Save']", RuntimeVariables.replace("Save"));
    selenium.waitForPageToLoad("30000");
    assertTrue(selenium.isTextPresent("Your request processed successfully."));
    assertTrue(selenium.isTextPresent("Group Page Layout Community"));
  }
Exemple #22
0
  public void testViewActivityMBCategoryThreadMessage() throws Exception {
    selenium.open("/web/joebloggs/home/");
    loadRequiredJavaScriptModules();

    for (int second = 0; ; second++) {
      if (second >= 90) {
        fail("timeout");
      }

      try {
        if (selenium.isVisible("link=Activities Page")) {
          break;
        }
      } catch (Exception e) {
      }

      Thread.sleep(1000);
    }

    selenium.clickAt("link=Activities Page", RuntimeVariables.replace("Activities Page"));
    selenium.waitForPageToLoad("30000");
    loadRequiredJavaScriptModules();
    assertEquals(
        RuntimeVariables.replace(
            "Joe wrote a new message board post, MB Category Thread Message Subject, in Liferay."),
        selenium.getText("xPath=(//div[@class='activity-title'])[1]"));
    assertEquals(
        RuntimeVariables.replace("MB Category Thread Message Subject"),
        selenium.getText("xPath=(//div[@class='activity-title'])[1]/a"));
  }
  public void testAssertNoAssignToMeTaskActions() throws Exception {
    selenium.open("/web/guest/home/");

    for (int second = 0; ; second++) {
      if (second >= 90) {
        fail("timeout");
      }

      try {
        if (selenium.isElementPresent("link=Control Panel")) {
          break;
        }
      } catch (Exception e) {
      }

      Thread.sleep(1000);
    }

    selenium.clickAt("link=Control Panel", RuntimeVariables.replace("Control Panel"));
    selenium.waitForPageToLoad("30000");
    selenium.clickAt("link=My Submissions", RuntimeVariables.replace("My Submissions"));
    selenium.waitForPageToLoad("30000");
    selenium.clickAt("link=Pending", RuntimeVariables.replace("Pending"));
    selenium.waitForPageToLoad("30000");
    assertFalse(selenium.isElementPresent("link=Actions"));
    assertFalse(selenium.isElementPresent("link=Assign to Me"));
  }
Exemple #24
0
 public void testAddBookmarksFolderEntry() throws Exception {
   selenium.selectWindow("null");
   selenium.selectFrame("relative=top");
   selenium.open("/web/bookmarks-entry-community/");
   selenium.waitForVisible("link=Bookmarks Entry Page");
   selenium.clickAt("link=Bookmarks Entry Page", RuntimeVariables.replace("Bookmarks Entry Page"));
   selenium.waitForPageToLoad("30000");
   selenium.clickAt("//a/strong", RuntimeVariables.replace("Bookmarks Folder Name"));
   selenium.waitForPageToLoad("30000");
   selenium.waitForVisible("//div[2]/ul/li[5]/a");
   selenium.clickAt("//div[2]/ul/li[5]/a", RuntimeVariables.replace("Add Bookmark"));
   selenium.waitForPageToLoad("30000");
   selenium.type("//input[@id='_28_name']", RuntimeVariables.replace("Bookmarks Entry Name"));
   selenium.type("//input[@id='_28_url']", RuntimeVariables.replace("http://www.liferay.com"));
   selenium.type(
       "//textarea[@id='_28_description']", RuntimeVariables.replace("Bookmarks Entry Comments"));
   selenium.clickAt("//input[@value='Save']", RuntimeVariables.replace("Save"));
   selenium.waitForPageToLoad("30000");
   selenium.waitForVisible("//div[@class='portlet-msg-success']");
   assertEquals(
       RuntimeVariables.replace("Your request completed successfully."),
       selenium.getText("//div[@class='portlet-msg-success']"));
   assertEquals(RuntimeVariables.replace("Bookmarks Entry Name"), selenium.getText("//td[1]/a"));
   assertEquals(RuntimeVariables.replace("http://www.liferay.com"), selenium.getText("//td[2]/a"));
 }
  public void testAddFolderNameNull() throws Exception {
    selenium.open("/web/guest/home/");

    for (int second = 0; ; second++) {
      if (second >= 60) {
        fail("timeout");
      }

      try {
        if (selenium.isElementPresent("link=Image Gallery Test Page")) {
          break;
        }
      } catch (Exception e) {
      }

      Thread.sleep(1000);
    }

    selenium.clickAt("link=Image Gallery Test Page", RuntimeVariables.replace(""));
    selenium.waitForPageToLoad("30000");
    selenium.clickAt("//div[2]/ul/li[2]/a", RuntimeVariables.replace(""));
    selenium.waitForPageToLoad("30000");
    selenium.type("_31_name", RuntimeVariables.replace(""));
    selenium.type("_31_description", RuntimeVariables.replace("This is Test1 Folder1."));
    selenium.clickAt("//input[@value='Save']", RuntimeVariables.replace(""));
    selenium.waitForPageToLoad("30000");
    assertTrue(selenium.isTextPresent("You have entered invalid data. Please try again."));
    assertTrue(selenium.isTextPresent("Please enter a valid name."));
  }
  public void testTearDownCart() throws Exception {
    selenium.open("/web/guest/home/");

    for (int second = 0; ; second++) {
      if (second >= 60) {
        fail("timeout");
      }

      try {
        if (selenium.isElementPresent("link=Shopping Test Page")) {
          break;
        }
      } catch (Exception e) {
      }

      Thread.sleep(1000);
    }

    selenium.saveScreenShotAndSource();
    selenium.clickAt("link=Shopping Test Page", RuntimeVariables.replace(""));
    selenium.waitForPageToLoad("30000");
    selenium.saveScreenShotAndSource();
    selenium.clickAt("link=Cart", RuntimeVariables.replace(""));
    selenium.waitForPageToLoad("30000");
    selenium.saveScreenShotAndSource();
    selenium.clickAt("//input[@value='Empty Cart']", RuntimeVariables.replace(""));
    selenium.waitForPageToLoad("30000");
    selenium.saveScreenShotAndSource();
  }
  public void testConfigureDocumentSingleApprover() throws Exception {
    selenium.open("/web/guest/home/");

    for (int second = 0; ; second++) {
      if (second >= 60) {
        fail("timeout");
      }

      try {
        if (selenium.isElementPresent("link=Control Panel")) {
          break;
        }
      } catch (Exception e) {
      }

      Thread.sleep(1000);
    }

    selenium.click(RuntimeVariables.replace("link=Control Panel"));
    selenium.waitForPageToLoad("30000");
    selenium.click(RuntimeVariables.replace("link=Workflow Configuration"));
    selenium.waitForPageToLoad("30000");
    selenium.select(
        "*****@*****.**",
        RuntimeVariables.replace("label=Single Approver (Version 1)"));
    selenium.clickAt("//input[@value='Save']", RuntimeVariables.replace(""));
    selenium.waitForPageToLoad("30000");
    assertEquals(
        RuntimeVariables.replace("Your request processed successfully."),
        selenium.getText("//div[@class='portlet-msg-success']"));
    assertEquals(
        "Single Approver (Version 1)",
        selenium.getSelectedLabel(
            "*****@*****.**"));
  }
  public void testPortlet_AssertCannotEditEntry() throws Exception {
    selenium.open("/web/guest/home/");

    for (int second = 0; ; second++) {
      if (second >= 60) {
        fail("timeout");
      }

      try {
        if (selenium.isElementPresent("link=Blogs Permissions Page")) {
          break;
        }
      } catch (Exception e) {
      }

      Thread.sleep(1000);
    }

    selenium.saveScreenShotAndSource();
    selenium.clickAt(
        "link=Blogs Permissions Page", RuntimeVariables.replace("Blogs Permissions Page"));
    selenium.waitForPageToLoad("30000");
    selenium.saveScreenShotAndSource();
    selenium.clickAt(
        "//div[@class='entry-title']/h2/a",
        RuntimeVariables.replace("Blogs Entry Title Temporary"));
    selenium.waitForPageToLoad("30000");
    selenium.saveScreenShotAndSource();
    assertFalse(selenium.isElementPresent("link=Edit"));
  }
  public void testSA_Login() throws Exception {
    selenium.open("/web/guest/home/");

    for (int second = 0; ; second++) {
      if (second >= 90) {
        fail("timeout");
      }

      try {
        if (selenium.isVisible("//input[@id='_58_login']")) {
          break;
        }
      } catch (Exception e) {
      }

      Thread.sleep(1000);
    }

    selenium.type("//input[@id='_58_login']", RuntimeVariables.replace("*****@*****.**"));
    selenium.type("//input[@id='_58_password']", RuntimeVariables.replace("test"));
    selenium.clickAt(
        "//input[@id='_58_rememberMeCheckbox']", RuntimeVariables.replace("Remember Me"));
    selenium.clickAt("//input[@value='Sign In']", RuntimeVariables.replace("Sign In"));
    selenium.waitForPageToLoad("30000");
  }
Exemple #30
0
 public void testRemovePet() throws Exception {
   selenium.selectWindow("null");
   selenium.selectFrame("relative=top");
   selenium.open("/web/guest/home/");
   selenium.clickAt("link=Pets Test Page", RuntimeVariables.replace("Pets Test Page"));
   selenium.waitForPageToLoad("30000");
   assertEquals(
       RuntimeVariables.replace("Pets"), selenium.getText("//div[@class='portlet-body']/h1"));
   assertEquals(
       RuntimeVariables.replace("Remove"),
       selenium.getText(
           "//div[@class='portlet-body']/table/tbody/tr[contains(.,'Fish')]/td[contains(.,'Remove')]/a"));
   selenium.clickAt(
       "//div[@class='portlet-body']/table/tbody/tr[contains(.,'Fish')]/td[contains(.,'Remove')]/a",
       RuntimeVariables.replace("Remove"));
   selenium.waitForText(
       "//div[@class='portlet-body']/table",
       "Species Breed Name Bird Macaw Polly Remove Cat Calico Boots Remove Dog Poodle Fido Remove Snake Boa Bo Remove Add a Pet");
   assertEquals(
       RuntimeVariables.replace(
           "Species Breed Name Bird Macaw Polly Remove Cat Calico Boots Remove Dog Poodle Fido Remove Snake Boa Bo Remove Add a Pet"),
       selenium.getText("//div[@class='portlet-body']/table"));
   assertFalse(selenium.isTextPresent("Fish"));
   assertFalse(selenium.isTextPresent("Goldfish"));
   assertFalse(selenium.isTextPresent("Bubbles"));
 }