コード例 #1
0
  /**
   * == Not update File activity after creating a new folder == Test case ID: 76991 Step 1: -
   * Connect to Intranet - Open Sites Explorer - Create a new folder - Back to the Home page
   */
  @Test
  public void test01_NotUpdateFileActivityAfterCreatingANewFolder() {
    // Declare variable
    String folder = "folder01";
    By elementFolder = By.linkText(folder);
    // Open Sites Explorer
    info("-- Open Sites Explorer --");
    navToolBar.goToSiteExplorer();

    // Create a new folder
    info("-- Create parent folder --");
    cTemplate.createNewFolder(folder, folderType.None);

    // Back to the Home page
    info("-- Back to the Home page --");
    navToolBar.goToHomePage();

    // No activity is displayed in the activity stream
    info("-- Check activity after adding a folder --");
    waitForElementNotPresent(activity.ELEMENT_CONTENT_NAME.replace("@{fileName}", folder));

    /*Clear data*/
    info("-- Clear data --");
    info("-- Open Sites Explorer --");
    navToolBar.goToSiteExplorer();
    cMenu.deleteData(elementFolder);
  }
コード例 #2
0
  /** CaseID 65862, 67863, 67862, 67861 Create, edit, execute, delete query in Advanced search */
  @Test
  public void test03_04_05_CreateQueryInAdvancedSearch() {
    String node1 = "test03Create";
    String nameQuery = "Query test03";
    String query =
        "select * from nt:base where jcr:path like '/sites/%' order by exo:dateCreated DESC";
    String edit =
        "select * from nt:base where jcr:primaryType like 'nt:file' order by exo:dateCreated DESC";
    By bNode1 = By.xpath(siteExp.ELEMENT_SE_NODE.replace("{$node}", node1));

    info("Create, edit, execute, delete query in Advanced search");
    actBar.goToAddNewContent();
    cTemplate.createNewFile(node1, node1, node1);

    // CaseID 65862 - Create query
    aSearch.goToNewQuery();
    aSearch.addQuery(nameQuery, "SQL", query);

    // CaseID 67863 - Edit query
    aSearch.goToEditQuery(nameQuery);
    aSearch.editQuery("", "SQL", edit);

    // CaseID 67862 execute query
    aSearch.executeQuery(nameQuery);
    waitForAndGetElement(aSearch.ELEMENT_SEARCH_RESULT_TEXT.replace("${result}", node1));
    btn.closeWindow();

    // CaseID 67861 - Delete query
    aSearch.deleteQuery(nameQuery);

    // Delete data
    click(siteExp.ELEMENT_SIDEBAR_FILE_EXPLORER);
    cMenu.deleteDocument(bNode1);
  }
コード例 #3
0
  /** Qmetry ID: 65855 Unlock a Node ================ */
  @Test
  public void test01_UnlockNode() {
    String fileTitle = "Ecms_Admin_Unlock_Node";
    String content = "Unlock A Node In Content Administration";
    By eLockedFile = By.xpath(cMenu.ELEMENT_FILE_TITLE.replace("${titleOfFile}", fileTitle));
    String elementLockedArticleIcon =
        cMenu.ELEMENT_FILE_LOCKED_BY_ADMIN.replace("${titleOfFile}", fileTitle);

    info("-- Test case: Unlock a node --");

    // Go to Site Explorer
    nav.goToSiteExplorer();
    // actBar.goToSitesManagement();
    ecms.goToNode("intranet/documents");

    // Create a new File
    actBar.goToAddNewContent();
    cTemplate.createNewFile(fileTitle, content, fileTitle);

    // Lock this File
    cMenu.contextMenuAction(eLockedFile, cMenu.ELEMENT_CONTEXT_MENU_LOCK);
    click(cMenu.ELEMENT_DOCUMENT);
    waitForAndGetElement(elementLockedArticleIcon);

    // Unlock Node in Admin
    ecMain.goToLockedTab();
    click(ecMain.ELEMENT_UNLOCK_NODE.replace("${lockedNode}", fileTitle));
    waitForElementNotPresent(ecMain.ELEMENT_UNLOCK_NODE.replace("${lockedNode}", fileTitle));

    info("-- Restore data --");
    nav.goToSiteExplorer();
    cMenu.deleteDocument(eLockedFile);
  }
  /** CaseId: 119496,119558,119560 Add Edit Delete a File document */
  @Test
  public void test01_02_03_AddEditDeleteFileDocument() {
    String File_Name = "File_Case_67416_ 78956";
    String File_Content = "File_Content_67416";
    String File_Content_Edit = "Edited File_Content_67416_To_ 78956";

    info("Add Edit Delete a File document");
    actBar.goToAddNewContent();
    conTemp.createNewFile(File_Name, File_Content, "");

    info("Edit File & verify edited content");
    conTemp.editFile(null, "", File_Content_Edit);
    assert driver.getPageSource().contains(File_Content_Edit);

    info("Delete Fle document");
    actBar.chooseDrive(ecms.ELEMENT_PERSONAL_DRIVE);
    actBar.actionsOnElement(File_Name, actionType.DELETE);
  }
  /** CaseId: 119559 Edit illustrated web content */
  @Test
  public void test15_EditIllustratedWebContent() {
    String Illustrated_WC_Name = "Illustrated_WC_case_78957";
    String Illustrated_WC_content = "Content Of Illustrated_WC";
    String path2Image = "TestData/Winter.jpg";
    String Illustrated_WC_Edited_content = "Edited: Content Of Illustrated_WC";

    info("Edit illustrated web content");
    actBar.goToAddNewContent();
    conTemp.createNewIllustratedWebContent(
        Illustrated_WC_Name, Illustrated_WC_content, path2Image, "", "", "", "");

    conTemp.editIllustratedWebContent(null, Illustrated_WC_Edited_content, "", "", "", "", "");
    waitForTextPresent(Illustrated_WC_Edited_content);

    info("Delete File document");
    actBar.chooseDrive(ecms.ELEMENT_PERSONAL_DRIVE);
    actBar.actionsOnElement(Illustrated_WC_Name, actionType.DELETE);
  }
  /** CaseId: 119548 Add new Web Content */
  @Test
  public void test12_AddNewWebContent() {

    String WC_Name = "WC_case_78927";
    String WC_content = "Content Of WC";
    info("Add new Web Content");
    actBar.goToAddNewContent();
    conTemp.createNewWebContent(WC_Name, WC_content, "", "", "", "", false);

    info("Restore data");
    actBar.chooseDrive(ecms.ELEMENT_PERSONAL_DRIVE);
    waitForAndGetElement(ecms.ELEMENT_NODE_ADMIN_VIEW.replace("${nodeName}", WC_Name));
    actBar.actionsOnElement(WC_Name, actionType.DELETE);
  }
  /** CaseId: 119544 Create an Announcement */
  @Test
  public void test08_AddNewAnnoucement() {

    String Announcement_Name = "Announcement_Case_78922";
    String Announcement_Summary = "Accounceent_summary_case_78922";
    info("Create an Announcement");
    actBar.goToAddNewContent();
    conTemp.createNewAnnouncement(Announcement_Name, Announcement_Summary, false);

    info("Restore data");
    actBar.chooseDrive(ecms.ELEMENT_PERSONAL_DRIVE);
    waitForAndGetElement(ecms.ELEMENT_NODE_ADMIN_VIEW.replace("${nodeName}", Announcement_Name));
    actBar.actionsOnElement(Announcement_Name, actionType.DELETE);
  }
  /** CaseId: 119541 Create JS file */
  @Test
  public void test05_AddNewJsFile() {
    String Js_Name = "Js_Case_78917";
    String Js_Data = "alert(\"Hello! I am an alert box!!\");";
    info("Create JS file");
    actBar.goToAddNewContent();
    click(conTemp.ELEMENT_NEW_JS_FILE_LINK);
    conTemp.createNewJsFile(Js_Name, "0", Js_Data);

    info("Restore data");
    actBar.chooseDrive(ecms.ELEMENT_PERSONAL_DRIVE);
    waitForAndGetElement(ecms.ELEMENT_NODE_ADMIN_VIEW.replace("${nodeName}", Js_Name));
    actBar.actionsOnElement(Js_Name, actionType.DELETE);
  }
  /** CaseId: 119545 Create a new css file */
  @Test
  public void test09_AddNewCssFile() {

    String CssFile_Name = "CSS_File_case_78923";
    String CSS_Data = "p{color: red;}";
    info("Create a new css file");
    actBar.goToAddNewContent();
    click(conTemp.ELEMENT_CSS_FILE_LINK);
    conTemp.createNewCssFile(CssFile_Name, "", CSS_Data);

    info("Restore data");
    actBar.chooseDrive(ecms.ELEMENT_PERSONAL_DRIVE);
    waitForAndGetElement(ecms.ELEMENT_NODE_ADMIN_VIEW.replace("${nodeName}", CssFile_Name));
    actBar.actionsOnElement(CssFile_Name, actionType.DELETE);
  }
  /** CaseId: 119546 Add new HTML File document */
  @Test
  public void test10_AddNewHtmlFile() {

    String Html_File_Name = "HTML_File_case_78925";
    String Html_content = "Content Of HTML file";

    info("Add new HTML File document");
    actBar.goToAddNewContent();
    conTemp.createNewHtmlFile(Html_File_Name, false, "", Html_content);

    info("Restore data");
    actBar.chooseDrive(ecms.ELEMENT_PERSONAL_DRIVE);
    waitForAndGetElement(ecms.ELEMENT_NODE_ADMIN_VIEW.replace("${nodeName}", Html_File_Name));
    actBar.actionsOnElement(Html_File_Name, actionType.DELETE);
  }
  /** CaseId: 119543 Create an Accessible media */
  @Test
  public void test07_AddNewAccessibleMedia() {
    String name = "AccessibleMedia_78920";
    String lang = "en";
    info("Create an Accessible media");
    actBar.goToAddNewContent();

    //	Create new accessible media here
    conTemp.createAccessibleMedia(name, lang, name, name, name);

    info("Restore data");
    actBar.chooseDrive(ecms.ELEMENT_PERSONAL_DRIVE);
    waitForAndGetElement(ecms.ELEMENT_NODE_ADMIN_VIEW.replace("${nodeName}", name));
    actBar.actionsOnElement(name, actionType.DELETE);
  }
  /** CaseId: 119542 Create a web Link */
  @Test
  public void test06_AddNewWebLink() {

    String Web_Link_Name = "Web_link_case_78918";
    String URL = "http://google.com.vn";
    info("reate a web Link");
    actBar.goToAddNewContent();

    click(conTemp.ELEMENT_WEBLINK_LINK);

    conTemp.createNewLink(Web_Link_Name, URL);

    info("Restore data");
    actBar.chooseDrive(ecms.ELEMENT_PERSONAL_DRIVE);
    waitForAndGetElement(ecms.ELEMENT_NODE_ADMIN_VIEW.replace("${nodeName}", Web_Link_Name));
    actBar.actionsOnElement(Web_Link_Name, actionType.DELETE);
  }
  /** CaseId: 119549 Add new Product */
  @Test
  public void test13_AddNewProduct() {
    String Product_Name = "Product_case_78928";
    String Product_Summary = "Summary of product case78928";
    String Product_Benefit = "Benefit of product case78928";
    String Product_Feature = "Features of product case78928";

    info("Add new Product");
    actBar.goToAddNewContent();
    conTemp.createFullNewProduct(
        Product_Name, "", Product_Summary, Product_Benefit, Product_Feature);

    info("Restore data");
    actBar.chooseDrive(ecms.ELEMENT_PERSONAL_DRIVE);
    waitForAndGetElement(ecms.ELEMENT_NODE_ADMIN_VIEW.replace("${nodeName}", Product_Name));
    actBar.actionsOnElement(Product_Name, actionType.DELETE);
  }
  /** CaseId: 119547 Add new Illustrated Web Content */
  @Test
  public void test11_AddNewIllustratedWebContent() {

    String Illustrated_WC_Name = "Illustrated_WC_case_78926";
    String Illustrated_WC_content = "Content Of Illustrated_WC";
    String path2Image = "TestData/Winter.jpg";

    info("Add new Illustrated Web Content");
    actBar.goToAddNewContent();
    conTemp.createNewIllustratedWebContent(
        Illustrated_WC_Name, Illustrated_WC_content, path2Image, "", "", "", "");

    info("Restore data");
    actBar.chooseDrive(ecms.ELEMENT_PERSONAL_DRIVE);
    waitForAndGetElement(ecms.ELEMENT_NODE_ADMIN_VIEW.replace("${nodeName}", Illustrated_WC_Name));
    actBar.actionsOnElement(Illustrated_WC_Name, actionType.DELETE);
  }
  /** CaseId: 119550 Add new Contact us */
  @Test
  public void test14_AddNewContactUs() {
    String Your_Name = "John Smith";
    String Your_Address = "Address of case 78930";
    String Your_Email = "*****@*****.**";
    String Your_Phone = "1234567890";
    String Your_Message = "I like this product";
    String ContactUs_Name = getCurrentDate("yyyy.MM.dd");

    info("Add new Contact us");
    actBar.goToAddNewContent();
    conTemp.createNewContactUs(Your_Name, Your_Address, Your_Email, Your_Phone, Your_Message);

    info("Restore data");
    actBar.chooseDrive(ecms.ELEMENT_PERSONAL_DRIVE);
    waitForAndGetElement(ecms.ELEMENT_NODE_ADMIN_VIEW.replace("${nodeName}", ContactUs_Name));
    actBar.actionsOnElement(ContactUs_Name, actionType.DELETE);
  }
コード例 #16
0
  /** CaseID 65875 Simple Search Step 1: Simple Search */
  @Test
  public void test02_SimpleSearch() {
    String node1 = "test02SimpleSearch";
    String des = "test02 desc";
    By bNode1 = By.xpath(siteExp.ELEMENT_SE_NODE.replace("{$node}", node1));

    info("Simple search");
    // Create document
    actBar.goToAddNewContent();
    cTemplate.createNewFile(node1, node1, node1, des);

    // Simple search
    type(siteExp.ELEMENT_SIMPLESEARCH_TEXTBOX, node1, true);
    click(siteExp.ELEMENT_QUICKSEARCH_ICON);
    waitForAndGetElement(aSearch.ELEMENT_SEARCH_RESULT_TEXT.replace("${result}", node1));

    // Delete data
    cMenu.deleteDocument(bNode1);
  }
コード例 #17
0
  /** CaseID 85825 Advanced search Step 1: Advanced search */
  @Test
  public void test01_AdvancedSearch() {
    String node1 = "test01AdvancedSearch";
    String des = "test01 desc";
    By bNode1 = By.xpath(siteExp.ELEMENT_SE_NODE.replace("{$node}", node1));

    info("Advanced search");
    // Create document
    actBar.goToAddNewContent();
    cTemplate.createNewFile(node1, node1, node1, des);

    // Advance search
    aSearch.goToAdvancedSearch();
    click(aSearch.ELEMENT_CONSTRAINT_FORM);
    aSearch.selectDocumentType("nt:file");
    aSearch.searchContent(node1);
    waitForAndGetElement(aSearch.ELEMENT_SEARCH_RESULT_TEXT.replace("${result}", node1));
    btn.closeWindow();

    // Delete data
    click(siteExp.ELEMENT_SIDEBAR_FILE_EXPLORER);
    cMenu.deleteDocument(bNode1);
  }
コード例 #18
0
  /** Qmetry ID: 67841 Manage Lock ================ */
  @Test
  public void test02_ManageLock() {
    String fileTitle = "Ecms_Admin_Manage_Lock";
    String content = "All users in the selected group, would be able to unlock";
    By eLockedFile = By.xpath(cMenu.ELEMENT_FILE_TITLE.replace("${titleOfFile}", fileTitle));
    String elementLockedArticleIcon =
        cMenu.ELEMENT_FILE_LOCKED_BY_ADMIN.replace("${titleOfFile}", fileTitle);

    By ELEMENT_GROUP_MEMBERSHIP = By.linkText("manager");
    String ELEMENT_GROUP_MEMBERSHIP_DISPLAY = "manager";
    String ELEMENT_GROUP_TO_SELECT = "Platform/Content Management";
    String ELEMENT_GROUP_DISPLAY = "platform/web-contributors";

    info("-- Test case: Manage lock --");

    // Go to Site Explorer
    nav.goToSiteExplorer();
    // actBar.goToSitesManagement();
    ecms.goToNode("intranet/documents");

    // Create a new File
    actBar.goToAddNewContent();
    cTemplate.createNewFile(fileTitle, content, fileTitle);

    // Lock this File
    cMenu.contextMenuAction(eLockedFile, cMenu.ELEMENT_CONTEXT_MENU_LOCK);
    click(cMenu.ELEMENT_DOCUMENT);
    waitForAndGetElement(elementLockedArticleIcon);

    // Open form to add permission for Users/Group (unlock node)
    // Add permission for group to unlock node
    ecMain.goToManageLockTab();
    userGroup.selectGroup(ELEMENT_GROUP_TO_SELECT, true);
    click(ELEMENT_GROUP_MEMBERSHIP);

    // Groups are listed on the table
    waitForTextPresent(ELEMENT_GROUP_MEMBERSHIP_DISPLAY + ":/" + ELEMENT_GROUP_DISPLAY);

    // Login with user in the selected group and un lock that node
    driver.close();
    driver = new FirefoxDriver();
    driver.get(baseUrl);
    nav = new NavigationToolbar(driver);
    magAcc = new ManageAccount(driver);
    ecMain = new ECMainFunction(driver);
    adminPer = new Permission(driver);
    cMenu = new ContextMenu(driver);
    ecms = new EcmsBase(driver);

    magAcc.signIn("mary", "gtn");
    ecMain.goToLockedTab();
    click(ecMain.ELEMENT_UNLOCK_NODE.replace("${lockedNode}", fileTitle));
    waitForTextNotPresent(fileTitle);

    // Admin re-LogIn and Delete Permission...
    magAcc.signOut();
    magAcc.signIn(DATA_USER, DATA_PASS);
    ecMain.goToManageLockTab();
    click(
        adminPer.ELEMENT_DELETE_SELECTED_GROUP.replace("${selectedGroup}", ELEMENT_GROUP_DISPLAY));
    waitForTextNotPresent(ELEMENT_GROUP_MEMBERSHIP_DISPLAY + ":/" + ELEMENT_GROUP_DISPLAY);

    // Restore data
    nav.goToSiteExplorer();
    ecms.goToNode("intranet/documents");
    cMenu.deleteDocument(eLockedFile);
  }