/** * == Add File activity after uploading a file in a space == Test case ID: 76992 Step 1: - Connect * to Intranet - Add new space - Open Documents in this space - Upload a file - Back to the Home * page */ @Test public void test02_AddFileActivityAfterUploadingAFileInASpace() { // Declare variable String spacename = "Space02"; String spacedesc = "Description Of Space02"; String file = "ECMS_DMS_SE_Upload_imgfile.jpg"; // Add new space magMember.goToMySpacePage(); magMember.addNewSpace(spacename, spacedesc); // Open Documents in this space waitForAndGetElement(magMember.ELEMENT_DOCUMENTS_TAB); click(magMember.ELEMENT_DOCUMENTS_TAB); // Upload a file ecms.uploadFile("TestData/" + file); // Back to the Home page info("-- Back to the Home page --"); navToolBar.goToHomePage(); // - A File activity is added to the activity stream info("-- A File activity is added to the activity stream --"); activity.checkInforAfterAddingDocument(file, "", "File", "423 KB", "", "", "", ""); /*Clear data*/ info("-- Clear data --"); magMember.goToMySpacePage(); magMember.deleteSpace(spacename); }
/** * == Remove the File activity after deleting a file in Space document == Test case ID: 77326 Step * 1: Create file activity Step 2: Delete File */ @Test public void test10_RemoveTheFileActivityAfterDeletingAFileInSpaceDocument() { // Declare variable String file = "KS_Wiki_Attachment_pdffile.pdf"; By elementfile = By.linkText(file); String spacename = "Space10"; String spacedesc = "Description Of Space10"; /*Step 1: Create file activity*/ // Add new space magMember.goToMySpacePage(); magMember.addNewSpace(spacename, spacedesc); // Open Documents in this space waitForAndGetElement(magMember.ELEMENT_DOCUMENTS_TAB); click(magMember.ELEMENT_DOCUMENTS_TAB); // Upload a file ecms.uploadFile("TestData/" + file); // Back to the Home page info("-- Back to the Home page --"); navToolBar.goToHomePage(); // - The File activity is displayed in the activity stream info("-- A File activity is added to the activity stream --"); activity.checkInforAfterAddingDocument(file, "", "File", "1 MB", "", "", "", ""); /*Step 2: Delete File*/ // Delete file from space magMember.goToMySpacePage(); magMember.doAction("Edit", spacename); waitForAndGetElement(magMember.ELEMENT_DOCUMENTS_TAB); click(magMember.ELEMENT_DOCUMENTS_TAB); cMenu.deleteData(elementfile); // Back to the Home page info("-- Back to the Home page --"); navToolBar.goToHomePage(); // The File activity is removed from the activity stream info("-- The File activity is removed from the activity stream --"); waitForElementNotPresent(activity.ELEMENT_CONTENT_NAME.replace("@{fileName}", file)); /*Clear data*/ info("-- Clear data --"); magMember.goToMySpacePage(); magMember.deleteSpace(spacename); }
@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); }
/* * ==Display event quick result== * ID :104237 * Step 1: search 3.5 */ @Test public void test02_DisplayEventQuickResult() { String eventName = "Gatein 35 party" + getRandomNumber(); String researchWord = "35"; String eventDescription = "Gatein 35 has been released! It's time to make a party! Enjoy some good sounds and good sushis!"; String eventLocation = "Tatakis Suchis bar, San Francisco"; String spaceName = "Engineering" + getRandomNumber(); info("Test02 - Display Event quick result"); /* * Pre conditions */ magMember.goToMySpacePage(); magMember.addNewSpace(spaceName, ""); info("New space added : " + spaceName); click(spaceMag.ELEMENT_SPACE_CALENDAR_PORTLET); evt.addQuickEvent( eventName, eventDescription, getDate(1, "MM/dd/yyyy 20:00"), getDate(1, "MM/dd/yyyy 23:00"), false); evt.editEvent( eventName, eventName, eventDescription, eventLocation, getDate(1, "MM/dd/yyyy 20:00"), getDate(1, "MM/dd/yyyy 23:00"), false); info("New event " + eventName + " create"); /* * Step 1 : In search input 3.5 */ Utils.pause(2000); click(ELEMENT_QUICK_SEARCH_ICON); Utils.pause(2000); type(ELEMENT_QUICK_SEARCH_TEXTBOX, researchWord, true); waitForAndGetElement( By.xpath( qsPage .ELEMENT_QUICK_SEARCH_BOX_RESULTS .replace("{$result}", eventName) .replace("{$position}", "1"))); info("Delete all events and tasks"); goToCalendarPage(); goToView(selectViewOption.LIST); deleteAllTaskEvent(); }
/** * == Edit a file from the File activity from space == Test case ID: 77330 Step 1: Create file * activity Step 2: Edit file from activity stream */ @Test public void test12_EditAFileFromTheFileActivityFromSpace() { // Declare variable String file = "KS_Wiki_Attachment_pdffile.pdf"; String spacename = "Space12"; String spacedesc = "Description Of Space12"; /*Step 1: Create file activity*/ // Add new space magMember.goToMySpacePage(); magMember.addNewSpace(spacename, spacedesc); // Open Documents in this space waitForAndGetElement(magMember.ELEMENT_DOCUMENTS_TAB); click(magMember.ELEMENT_DOCUMENTS_TAB); // Upload a file ecms.uploadFile("TestData/" + file); // Back to the Home page info("-- Back to the Home page --"); navToolBar.goToHomePage(); // - The File activity is displayed in the activity stream info("-- A File activity is added to the activity stream --"); activity.checkInforAfterAddingDocument(file, "", "File", "1 MB", "", "", "", ""); /*Step 2: Edit file from activity stream*/ // From the file activity, click on the link "Edit" info("Click Edit icon in activity"); activity.goToEditFromContentActivity(file); assert getValue(cTemplate.ELEMENT_WEBCONTENT_NAME_TEXTBOX).equalsIgnoreCase(file); activity.backToHomePageFromEditContentScreen(); /*Clear data*/ info("-- Clear data --"); magMember.goToMySpacePage(); magMember.deleteSpace(spacename); }
/* * ==Search on futur events of users calendars== * Id : 104239 * Step 1 : Search Event */ @Test public void test06_SearchOnFutureEventsOfUsersCalendars() { String spaceName = "Engineering" + getRandomNumber(); String calendarNamePerso = "Perso" + getRandomNumber(); String calendarNameShare = "ShareCal" + getRandomNumber(); String calendarDefault = "John Smith"; String eventDescription = " "; String[] nomShare = {"james"}; boolean[] editRight = {false}; String eventName1 = "Future event" + getRandomNumber(); String eventName2 = "Future event" + getRandomNumber(); String eventName3 = "Future event" + getRandomNumber(); String eventName4 = "Future event" + getRandomNumber(); String eventName5 = "Past event" + getRandomNumber(); String eventName6 = "Past event" + getRandomNumber(); String eventName7 = "Past event" + getRandomNumber(); String eventName8 = "Past event" + getRandomNumber(); /* * pre condition */ info("Create the engineering space"); magMember.goToMySpacePage(); magMember.addNewSpace(spaceName, ""); goToCalendarPage(); info("Create a personal calendar"); addCalendar(calendarNamePerso, "", "blue"); info("Create a share calendar with James"); addCalendar(calendarNameShare, "", "pink"); shareCalendar(calendarNameShare, nomShare, editRight); info("Add one past and one future event in the default cal"); evt.addQuickEvent( eventName1, eventDescription, getDate(1, "MM/dd/yyyy 14:00"), getDate(1, "MM/dd/yyyy 15:00"), false, calendarDefault); evt.addQuickEvent( eventName5, eventDescription, getDate(-1, "MM/dd/yyyy 06:00"), getDate(-1, "MM/dd/yyyy 07:00"), false, calendarDefault); info("Add one past and one future event in the perso cal"); evt.addQuickEvent( eventName2, eventDescription, getDate(1, "MM/dd/yyyy 16:00"), getDate(1, "MM/dd/yyyy 17:00"), false, calendarNamePerso); evt.addQuickEvent( eventName6, eventDescription, getDate(-1, "MM/dd/yyyy 05:00"), getDate(-1, "MM/dd/yyyy 06:00"), false, calendarNamePerso); info("Add one past and one future event in the shared cal"); evt.addQuickEvent( eventName3, eventDescription, getDate(1, "MM/dd/yyyy 16:00"), getDate(1, "MM/dd/yyyy 17:00"), false, calendarNameShare); evt.addQuickEvent( eventName7, eventDescription, getDate(-1, "MM/dd/yyyy 10:00"), getDate(-1, "MM/dd/yyyy 11:00"), false, calendarNameShare); info("Add one past and one future event in the engineering cal"); evt.addQuickEvent( eventName4, eventDescription, getDate(1, "MM/dd/yyyy 18:00"), getDate(1, "MM/dd/yyyy 19:00"), false, spaceName); evt.addQuickEvent( eventName8, eventDescription, getDate(-1, "MM/dd/yyyy 12:00"), getDate(-1, "MM/dd/yyyy 13:00"), false, spaceName); /* * Step 1 : search event */ qsPage.quickSearch("event"); qsPage.searchInSearchPage(eventName1); waitForAndGetElement(qsPage.ELEMENT_RESULT_ITEM.replace("${keySearch}", eventName1)); qsPage.searchInSearchPage(eventName2); waitForAndGetElement(qsPage.ELEMENT_RESULT_ITEM.replace("${keySearch}", eventName2)); qsPage.searchInSearchPage(eventName3); waitForAndGetElement(qsPage.ELEMENT_RESULT_ITEM.replace("${keySearch}", eventName3)); qsPage.searchInSearchPage(eventName4); waitForAndGetElement(qsPage.ELEMENT_RESULT_ITEM.replace("${keySearch}", eventName4)); qsPage.searchInSearchPage(eventName5); waitForElementNotPresent(qsPage.ELEMENT_RESULT_ITEM.replace("${keySearch}", eventName5)); qsPage.searchInSearchPage(eventName6); waitForElementNotPresent(qsPage.ELEMENT_RESULT_ITEM.replace("${keySearch}", eventName6)); qsPage.searchInSearchPage(eventName7); waitForElementNotPresent(qsPage.ELEMENT_RESULT_ITEM.replace("${keySearch}", eventName7)); qsPage.searchInSearchPage(eventName8); waitForElementNotPresent(qsPage.ELEMENT_RESULT_ITEM.replace("${keySearch}", eventName8)); info("Delete all events and tasks"); goToCalendarPage(); goToView(selectViewOption.LIST); deleteAllTaskEvent(); }
/* * https://jira.exoplatform.org/browse/CAL-1117 * Id test :104241 * Name: Private events should only be searchable by their owner * Step 1 : User James search "SEARCH_EVENT_05". */ @Test(groups = "pending") public void test05_PrivateEventsShouldOnlyBeSearchableByTheirOwner() { String eventDescription = "SEARCH_EVENT_05"; String eventName1 = "Private shared" + getRandomNumber(); String eventName2 = "Public shared" + getRandomNumber(); String eventName3 = "Unset shared" + getRandomNumber(); String eventName4 = "Private group" + getRandomNumber(); String eventName5 = "Public group" + getRandomNumber(); String eventName6 = "Unset group" + getRandomNumber(); String spaceName = "Engineering" + getRandomNumber(); String calendarNameShare = "CalShared" + getRandomNumber(); String[] nomShare = {"james"}; boolean[] edit = {false}; goToCalendarPage(); info("Create a share calendar with James"); addCalendar(calendarNameShare, "", "pink"); shareCalendar(calendarNameShare, nomShare, edit, 1); // * pre conditions info("Add event1 with private privacy"); evt.addQuickEvent( eventName1, eventDescription, getDate(1, "MM/dd/yyyy 02:00"), getDate(1, "MM/dd/yyyy 03:00"), false, calendarNameShare); evt.goToEditEventForm(eventName1); click(evt.ELEMENT_PARTICIPANTS_TAB); check(evt.ELEMENT_PARTICIPANT_PRIVATE_RADIO, 2); waitForAndGetElement(ELEMENT_BUTTON_EVENT_SAVE_EDIT, DEFAULT_TIMEOUT, 1); click(ELEMENT_BUTTON_EVENT_SAVE_EDIT); waitForElementNotPresent(ELEMENT_BUTTON_EVENT_SAVE_EDIT, DEFAULT_TIMEOUT, 1); info("Add event2 with public shared"); evt.addQuickEvent( eventName2, eventDescription, getDate(1, "MM/dd/yyyy 06:00"), getDate(1, "MM/dd/yyyy 07:00"), false, calendarNameShare); evt.goToEditEventForm(eventName2); click(evt.ELEMENT_PARTICIPANTS_TAB); check(evt.ELEMENT_PARTICIPANT_PUBLIC_RADIO, 2); waitForAndGetElement(ELEMENT_BUTTON_EVENT_SAVE_EDIT, DEFAULT_TIMEOUT, 1); click(ELEMENT_BUTTON_EVENT_SAVE_EDIT); waitForElementNotPresent(ELEMENT_BUTTON_EVENT_SAVE_EDIT, DEFAULT_TIMEOUT, 1); info("add event3 with unset privacy"); evt.addQuickEvent( eventName3, eventDescription, getDate(1, "MM/dd/yyyy 08:00"), getDate(1, "MM/dd/yyyy 09:00"), false, calendarNameShare); magMember.goToMySpacePage(); magMember.addNewSpace(spaceName, ""); info("New space added : " + spaceName); click(spaceMag.ELEMENT_SPACE_CALENDAR_PORTLET); info("Add event3 with private privacy"); evt.addQuickEvent( eventName4, eventDescription, getDate(1, "MM/dd/yyyy 10:00"), getDate(1, "MM/dd/yyyy 11:00"), false); evt.goToEditEventForm(eventName4); click(evt.ELEMENT_PARTICIPANTS_TAB); check(evt.ELEMENT_PARTICIPANT_PRIVATE_RADIO, 2); waitForAndGetElement(ELEMENT_BUTTON_EVENT_SAVE_EDIT, DEFAULT_TIMEOUT, 1); click(ELEMENT_BUTTON_EVENT_SAVE_EDIT); waitForElementNotPresent(ELEMENT_BUTTON_EVENT_SAVE_EDIT, DEFAULT_TIMEOUT, 1); info("Add event4 with public privacy"); evt.addQuickEvent( eventName5, eventDescription, getDate(1, "MM/dd/yyyy 12:00"), getDate(1, "MM/dd/yyyy 13:00"), false); evt.goToEditEventForm(eventName5); click(evt.ELEMENT_PARTICIPANTS_TAB); check(evt.ELEMENT_PARTICIPANT_PUBLIC_RADIO, 2); waitForAndGetElement(ELEMENT_BUTTON_EVENT_SAVE_EDIT, DEFAULT_TIMEOUT, 1); click(ELEMENT_BUTTON_EVENT_SAVE_EDIT); waitForElementNotPresent(ELEMENT_BUTTON_EVENT_SAVE_EDIT, DEFAULT_TIMEOUT, 1); driver.navigate().refresh(); Utils.pause(2000); info("Add event5 with unset privacy"); evt.addQuickEvent( eventName6, eventDescription, getDate(1, "MM/dd/yyyy 14:00"), getDate(1, "MM/dd/yyyy 15:00"), false); info("Invit user James in space engineering "); click(magMember.ELEMENT_SPACE_SETTING_PORTLET); click(magMember.ELEMENT_MEMBER_TAB); magMember.inviteSingleUser("James"); /* * step 1 search for "SEARCH_EVENT_05 " */ info("Log with user James"); magAcc.userSignIn(userType.AUTHOR); info("Accept invitation"); hGadget.acceptSpaceInvitationGadget(spaceName); driver.navigate().refresh(); info("Search event : " + eventDescription); qsPage.quickSearch(eventDescription); qsPage.searchInSearchPage(eventDescription); info("Check the results"); waitForElementNotPresent(qsPage.ELEMENT_RESULT_ITEM.replace("${keySearch}", eventName1)); waitForAndGetElement(qsPage.ELEMENT_RESULT_ITEM.replace("${keySearch}", eventName2)); waitForAndGetElement(qsPage.ELEMENT_RESULT_ITEM.replace("${keySearch}", eventName3)); waitForElementNotPresent(qsPage.ELEMENT_RESULT_ITEM.replace("${keySearch}", eventName4)); waitForAndGetElement(qsPage.ELEMENT_RESULT_ITEM.replace("${keySearch}", eventName5)); waitForAndGetElement(qsPage.ELEMENT_RESULT_ITEM.replace("${keySearch}", eventName6)); magAcc.signIn(DATA_USER1, DATA_PASS); info("Delete all events and tasks"); goToCalendarPage(); goToView(selectViewOption.LIST); deleteAllTaskEvent(); }
/* * ==Display event result== * Case ID : 104238 * Step 1: In quick search input 3.5 * PLF-5212 */ @Test public void test03_DisplayEventResult() { String eventName = "Gatein 35"; String researchWord = "35"; String eventDescription = "Gatein 35 has been released! It's time to make a party! Enjoy some good sounds and good sushis!"; String eventLocation = "Tatakis Suchis bar, San Francisco"; String spaceName = "Engineering" + getRandomNumber(); info("Test03 - Display Event result"); /* * Pre conditions */ magMember.goToMySpacePage(); magMember.addNewSpace(spaceName, ""); info("New space added : " + spaceName); click(spaceMag.ELEMENT_SPACE_CALENDAR_PORTLET); setTimezoneForCalendar("(GMT +07:00) Asia/Ho_Chi_Minh"); evt.addQuickEvent( eventName, eventDescription, getDate(1, "MM/dd/yyyy 20:00"), getDate(1, "MM/dd/yyyy 23:00"), false); evt.editEvent( eventName, eventName, eventDescription, eventLocation, getDate(1, "MM/dd/yyyy 20:00"), getDate(1, "MM/dd/yyyy 23:00"), false); info("New event " + eventName + " create"); /* * Step 1 : In quick search input 3.5 */ qsPage.quickSearch(researchWord); qsPage.searchInSearchPage(researchWord); waitForAndGetElement(qsPage.ELEMENT_RESULT_ITEM.replace("${keySearch}", researchWord)); waitForAndGetElement( ELEMENT_SEARCH_EVENT_ICON .replace("${month}", getDate(1, "MMM")) .replace("${date}", getDate(1, "dd"))); waitForAndGetElement(qsPage.ELEMENT_RESULT_ITEM.replace("${keySearch}", researchWord)); String searchTaskDate = waitForAndGetElement( qsPage .ELEMENT_RESULT_LOCATION_DATETIME .replace("${keySearch}", researchWord) .replace("${item}", "Gatein ")) .getText(); String searchDate = searchTaskDate.substring(searchTaskDate.indexOf(',') + 1).trim(); assert searchDate.contains(getDate(1, "MMM")); assert searchDate.contains(getDate(1, "dd")); assert searchDate.contains("8:00 PM"); String comtentEvent = waitForAndGetElement(ELEMENT_RESULT_SEARCH_PAGE).getText(); assert comtentEvent.contains(eventDescription); String comtentEvent1 = waitForAndGetElement(ELEMENT_RESULT_SEARCH_PAGE).getText(); assert comtentEvent1.contains(eventLocation); String comtentEvent2 = waitForAndGetElement(ELEMENT_RESULT_SEARCH_PAGE).getText(); assert comtentEvent2.contains(spaceName); info("Delete all events and tasks"); goToCalendarPage(); goToView(selectViewOption.LIST); deleteAllTaskEvent(); }