コード例 #1
0
  public static void test_Create_EGCchannel(
      Selenium sel, String str_channelName, String str_vodMasterProgramName, String str_UserEmailID)
      throws Exception {

    Utility_Functions utilityFunction = new Utility_Functions();
    // Fetching values for Global Variables from XMl file
    String str_path = "Global_variables.xml";
    Date date = Calendar.getInstance().getTime();
    String VAR_MED_WAIT = utilityFunction.GetValue(str_path, "VAR_MED_WAIT");
    // Click on Programming
    sel.click(EnvObjectMap_Rep.LNK_Programming);
    // Click on Channel link
    sel.click(EnvObjectMap_Rep.LNK_Channel);
    // wait
    sel.waitForPageToLoad(VAR_MED_WAIT);
    if (sel.isTextPresent(str_channelName)) {
      sel.click("allbox");
      sel.click("delete");
      sel.click("//div[@id='mpiwidget_layout_ConfirmDialog_0']/div[2]/button[1]");
      sel.waitForPageToLoad("30000");
    }
    // Click on the add button
    sel.click(EnvObjectMap_Rep.btn_addChannel);
    // wait
    sel.waitForPageToLoad(VAR_MED_WAIT);
    // Provide the channel name
    sel.type(EnvObjectMap_Rep.txt_channelName, str_channelName);
    // Check the active checkbox
    sel.check(EnvObjectMap_Rep.chk_channelActive);
    // Check the checkbox for enabling the EGC in the channel
    sel.click(EnvObjectMap_Rep.chk_egcChannel);
    // Select the master program
    sel.select(EnvObjectMap_Rep.drp_channel_chooseEGCmaster, "label=" + str_vodMasterProgramName);
    // Click on Add button to add the author
    sel.click(EnvObjectMap_Rep.btn_addEGC_Author);
    // Wait
    utilityFunction.waitForElementToVisible(sel, EnvObjectMap_Rep.txt_searchEGC_Author, 300);
    // Bring the focus on the textbox
    sel.focus(EnvObjectMap_Rep.txt_searchEGC_Author);
    // Provide the user email for searching
    sel.type(EnvObjectMap_Rep.txt_searchEGC_Author, str_UserEmailID);
    // Click on Find button
    sel.click(EnvObjectMap_Rep.btn_searchEGC_Author);
    // wait
    utilityFunction.waitForChangesToReflect();
    // Check the searched user
    sel.click(EnvObjectMap_Rep.chk_selectSearchedEGC_author);
    // wait
    utilityFunction.waitForChangesToReflect();
    // Move the searche duser to teh selected
    sel.click(EnvObjectMap_Rep.lnk_EGCauthor_moveToSelected);
    // Bring the focus on to the selected user
    sel.focus(EnvObjectMap_Rep.chk_selectSearchedEGC_author1);
    // Bring the focus on to the save button
    sel.keyPressNative(java.awt.event.KeyEvent.VK_TAB + "");
    // wait
    // utilityFunction.waitForChangesToReflect();
    // Click on Save button
    sel.keyPressNative(java.awt.event.KeyEvent.VK_SPACE + "");
    // Wait
    utilityFunction.waitForChangesToReflect();
    // Click on SAve button to save the channel
    sel.click(EnvObjectMap_Rep.btn_saveEGC_Channel);
    // wait
    sel.waitForPageToLoad(VAR_MED_WAIT);
    // Verify that the channel is created successfully
    assertTrue(
        " ",
        "Verify that EGC enabled channel is created successfully.",
        date,
        sel.isTextPresent(str_channelName));
  }
  public void test_SVP_Sm_vpv_018_LiveSurveySummary_Report() throws Exception {
    {
      try {
        setUp();
        Utility_Functions utilityFunction = new Utility_Functions();
        String str_path = "Global_variables.xml";
        // local variable file name
        String local_path = "SVP_LiveProgramSurveySummary_Report.xml";
        // String VAR_MED_WAIT = utilityFunction.GetValue(str_path ,"VAR_MED_WAIT");
        String VAR_DomSocial = utilityFunction.GetValue(str_path, "VAR_DomSocial");
        // Variable for the user name
        String VAR_USR = utilityFunction.GetValue(str_path, "VAR_USR");
        // Variable for the Password
        String VAR_PWD = utilityFunction.GetValue(str_path, "VAR_PWD");
        // Encoder Name
        String VAR_Encodername = utilityFunction.GetValue(local_path, "VAR_Encodername");
        // Variable for Live program name
        String Var_LiveProgramName = utilityFunction.GetValue(local_path, "Var_LiveProgramName");
        // Variable for the archive of Live program
        String Var_LiveProgramArchive =
            utilityFunction.GetValue(local_path, "Var_LiveProgramArchive");
        // Variable for the Framework path
        String Var_frameWork_Path = utilityFunction.GetValue(str_path, "Var_frameWork_Path");
        // variable for media net name
        String VAR_MedianetName = utilityFunction.GetValue(local_path, "VAR_medianetName");
        // Variable for Encoder profile name
        String VAR_EncoderProfileName =
            utilityFunction.GetValue(local_path, "VAR_EncoderProfileName");
        // Variable for viewer portal
        String Var_Columbia_vpURL = utilityFunction.GetValue(str_path, "Var_Columbia_vpURL");
        // Variable for the Survey Name
        String VAR_SurveyName = utilityFunction.GetValue(local_path, "SurveyName");
        // Variable for Poll name
        String VAR_PollName = utilityFunction.GetValue(local_path, "PollName");
        // Variable for the Question Name
        String VAR_QuestionName = utilityFunction.GetValue(local_path, "QuestionName");
        // Variable for the Question Explanation
        String VAR_QuestionExp = utilityFunction.GetValue(local_path, "QuestionExp");
        // Variable for the Question Type
        String VAR_QuestionType = utilityFunction.GetValue(local_path, "QuestionType");
        // Variable for the slide display name
        String VAR_SlideDisplayName = utilityFunction.GetValue(local_path, "VAR_SlideDisplayName");
        // Reusable action for Login to VCC
        Login.test_login(selenium, VAR_USR, VAR_PWD, VAR_DomSocial);
        // Reusable action to add survey
        // Upload_Media.Add_Survey(selenium, VAR_PollName, VAR_QuestionName, VAR_QuestionExp,
        // VAR_QuestionType);
        // Reusable to create a live program
        Create_Program.test_create_LiveProg(
            selenium,
            Var_LiveProgramName,
            VAR_Encodername,
            VAR_EncoderProfileName,
            VAR_SlideDisplayName,
            VAR_PollName,
            VAR_SurveyName,
            VAR_MedianetName);
        // Launch the LBC
        Launch_LBC.test_LaunchLBC(
            selenium, "Sm_vpv_018", Var_LiveProgramName, Var_LiveProgramArchive);
        // wait
        // selenium.waitForPageToLoad("30000");
        selenium.selectWindow("null");
        utilityFunction.waitForChangesToReflect();
        // Launch the viewer portal video
        selenium.openWindow(Var_Columbia_vpURL + VAR_DomSocial + "/home.vp?debug=true", "SVP");
        // Select the viewer portal
        selenium.selectWindow("SVP");
        selenium.windowMaximize();
        utilityFunction.waitForElementToVisible(selenium, EnvObjectMap_Rep.LNK_AllVideos, 300);
        // selenium.setTimeout("90000");
        // utilityFunction.waitForChangesToReflect();
        // click the Live program from all videos
        selenium.click(EnvObjectMap_Rep.LNK_AllVideos);
        utilityFunction.waitForChangesToReflect();
        utilityFunction.waitForChangesToReflect();

        selenium.type(
            EnvObjectMap_Rep.TBX_SearchSVP,
            utilityFunction.GetValue(local_path, "Var_LiveProgramName"));
        utilityFunction.waitForChangesToReflect();

        // Set focus on the search textbox
        selenium.typeKeys(EnvObjectMap_Rep.TBX_SearchSVP, "t");
        // select the icon to perform search
        selenium.click(EnvObjectMap_Rep.ICN_SearchBoxArrowlinkSVP);
        // Wait
        utilityFunction.waitForChangesToReflect();
        // select the Live program from all Videos in search results
        for (int i = 1; i < 50; i++) {
          String str_var =
              selenium.getText(MessageFormat.format(EnvObjectMap_Rep.LST_Searchresult, i));
          System.out.println(str_var);
          if (str_var.equals(Var_LiveProgramName)) {
            selenium.click(MessageFormat.format(EnvObjectMap_Rep.LST_Searchresult, i));
            break;
          }
        }
        // Wait
        utilityFunction.waitForChangesToReflect();
        // variable for path where to save the screenshot
        String screenShot_locPath =
            Var_frameWork_Path + "\\commonfiles\\" + Var_LiveProgramName + ".jpg";
        // Capture the screen shot of the live program
        selenium.captureScreenshot(screenShot_locPath);
        // Wait
        //    utilityFunction.waitForChangesToReflect();
        // select the LBC window
        for (String windowName : selenium.getAllWindowNames()) {
          if (windowName.indexOf(EnvObjectMap_Rep.Select_LBC) != -1) {
            selenium.selectWindow(windowName);
          }
        }
        // Click on Broadcast control tab
        selenium.click(EnvObjectMap_Rep.tab_broadcastControlLBC);
        // wait
        utilityFunction.waitForChangesToReflect();
        // Stop the broadcast
        selenium.click(EnvObjectMap_Rep.btn_stopBroadcast);
        utilityFunction.waitForChangesToReflect();
        selenium.close();
        // Select the parent window
        selenium.selectWindow("null");
        // wait
        //	utilityFunction.waitForChangesToReflect();
        // select SVP window
        selenium.selectWindow("Qumu Program Browser Home");
        // wait
        utilityFunction.waitForChangesToReflect();
        // Verify that survey is available
        for (int second = 0; ; second++) {
          if (second >= 600) fail("timeout");

          try {
            if (selenium.isElementPresent(EnvObjectMap_Rep.LNK_SurveyWindow))
              assertTrue(
                  "Sm_vpv_018",
                  "Verify that Survey is displayed successfully on SVP after the broadcast is stopped on LBC.",
                  date,
                  selenium.isElementPresent(EnvObjectMap_Rep.LNK_SurveyWindow));
            break;
          } catch (Exception e) {
          }
          Thread.sleep(1000);
        }
        selenium.click(EnvObjectMap_Rep.CHK_SurveyWindow);
        selenium.click(EnvObjectMap_Rep.btn_SubmitSurveyanswer);
        utilityFunction.waitForChangesToReflect();
        selenium.selectWindow("null");
        // Click 'Reporting' menu
        selenium.click(EnvObjectMap_Rep.lnk_reporting);
        // Click 'Reports' link
        selenium.click(EnvObjectMap_Rep.lnk_reports);
        // wait
        selenium.waitForPageToLoad("30000");
        // Select Report name
        selenium.click(EnvObjectMap_Rep.radio_LiveProgramSurveySummary);
        // Click 'Next' button
        selenium.click(EnvObjectMap_Rep.btn_reportNext);
        // wait
        selenium.waitForPageToLoad("30000");
        // select Survey as the option
        selenium.select(EnvObjectMap_Rep.drp_SelectPollorSurvey, EnvObjectMap_Rep.txt_Survey);
        utilityFunction.waitForChangesToReflect();
        selenium.select("input_programId", "label=" + Var_LiveProgramName);
        // wait
        utilityFunction.waitForChangesToReflect();
        // click the Run report button
        selenium.click(EnvObjectMap_Rep.btn_runReport);
        // wait
        selenium.waitForPageToLoad("30000");
        // verify that 'Content Storage' report is generated
        assertTrue(
            "Sm_vpv_018",
            "Social VP: Ensure that 'Live Program Survey Summary' report is generated.",
            date,
            selenium.isTextPresent("Live Program Poll/Survey Summary Report"));
        assertTrue(
            "Sm_vpv_018",
            "Social VP: Ensure that correct Live program is displayed on 'Live Program Survey Summary' report.",
            date,
            selenium.isTextPresent(Var_LiveProgramName));
        selenium.close();
        // stop selenium
        utilityFunction = null;
      } catch (Exception e) {
        e.printStackTrace();
      } finally {
        selenium.close();
        selenium.stop();
      }
    }
  }