3 Replies Latest reply on Oct 10, 2013 10:21 AM by Rafael Pestano

    Arquillian  Selenium Test - JSF Directory

    Gustavo Figueiredo Newbie

      Good Afternoon,

       

      Guys, I'm trying to run my test with arquillian but, in this JSF page we have to insert a template, but arquillian insert it on the root directory, but the path for it in my project is /page/template/commonLayout.xhtml. So how can I create a the same path with arquillian, the log of jboss is saying invalid path.

        • 1. Re: Arquillian  Selenium Test - JSF Directory
          Lukáš Fryč Master

          I'm afraid you will need to share some code snippets to allow us identify what's wrong in your case. :-)

           

          Please include the snippet of your @Deployment method.

          • 2. Re: Arquillian  Selenium Test - JSF Directory
            Gustavo Figueiredo Newbie

            This is my test. It´s a simple test, but it's given me Invalid Path, on the log of JBoss.

             

            @Deployment(testable = false)

                public static WebArchive createDeployment() {

                    return ShrinkWrap.create(WebArchive.class, "mis.war")

                            .addClasses(Usuario.class, Estado.class, Setor.class, Atribuicao.class, Cargo.class)   

                            .addAsResource("test-persistence.xml", "META-INF/persistence.xml")

                            .addAsWebResource(new File(WEBAPP_SRC, "index.jsp")) 

                            .addAsWebResource(new File(WEBAPP_SRC, "login.xhtml")) 

                            .addAsWebResource(new File(WEBAPP_SRC, "loginFail.xhtml")) 

                            .addAsWebResource(new File(WEBAPP_SRC, "pages/logout.jsp"))

                            .addAsWebResource(new File(WEBAPP_SRC, "pages/home.xhtml"))

                            .addAsWebResource(new File(WEBAPP_SRC, "pages/template/common/commonContent.xhtml"))

                            .addAsWebResource(new File(WEBAPP_SRC, "pages/template/common/commonFooter.xhtml"))

                            .addAsWebResource(new File(WEBAPP_SRC, "pages/template/common/commonHeader.xhtml"))

                            .addAsWebResource(new File(WEBAPP_SRC, "pages/template/common/commonLayout.xhtml"))

                            .addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml")

                            .addAsWebInfResource(new File(WEBAPP_SRC, "WEB-INF/faces-config.xml")) 

                            .setWebXML(new File(WEBAPP_SRC, "WEB-INF/web.xml")); 

                }

            @Drone
            DefaultSelenium driver;
            @ArquillianResource
            URL deploymentURL;
            @Test
            public void testLogin() {
            Assert.assertNotNull("Deployment URL should not be null", deploymentURL);
            driver.open(deploymentURL + "index.jsp");
            }

             

             

            }

            • 3. Re: Arquillian  Selenium Test - JSF Directory
              Rafael Pestano Novice

              Hi there,

               

              im using filters include from the new shrinkWrap API(2.x) for adding deployment resourses:

               

                  war.merge(ShrinkWrap.create(GenericArchive.class).as(ExplodedImporter.class).importDirectory(WEBAPP_SRC).as(GenericArchive.class), "/", Filters.include(".*\\.(xhtml|css|js|png)$"));

               

              but for your specific case make sure that pages/template/common/commonContent.xhml is inside src/test/resources  directory.

               

              I hope it helps.