How to make a rich:modalPanel be displayed in jsf unit?

87 Views Asked by At

I'm running a jsf unit test and it includes to test if a modal is displayed and i want to test some action inside the modal but the isDisplayed is always false.

Is there something that I am missing here.

Here is piece of my code:

 HtmlSelect mSelection = (HtmlSelect) client.getElement("selecID");
        assertTrue( mSelection.isDisplayed() );
        assertFalse( mSelection.isDisabled() );

        HtmlOption mOption = mOption .getOptionByValue("18");
        mOption .setSelected(true);
        try {
            mOption .click();
        } catch (IOException e2) {
            e2.printStackTrace();
        }

        System.out.println(" SELECTED = " + mOption .getText());        
         HtmlButtonInput goButton = (HtmlButtonInput) client.getElement("goButton");
        assertTrue( goButton.isDisplayed() );
        assertFalse( goButton.isDisabled() );
        try {
            goButton.click();

        } catch (IOException e) {
        }

        try {
            Thread.sleep(10000);

        } catch (InterruptedException e1) {    
            e1.printStackTrace();
        }

            //This part is inside the modal
        HtmlSelect mmSetSelection = (HtmlSelect) client.getElement("mmSelection");
        assertTrue( mmSetSelection!= null );

        System.out.println(" IS DIAPLED? = " + mmSetSelection.isDisplayed() );
0

There are 0 best solutions below