Uploaded image for project: 'Arquillian Graphene'
  1. Arquillian Graphene
  2. ARQGRA-165

Test enricher or resource provider for JSInterfaceFactory

This issue belongs to an archived project. You can view it, but you can't modify it. Learn more

    XMLWordPrintable

    Details

    • Type: Feature Request
    • Status: Closed
    • Priority: Critical
    • Resolution: Done
    • Affects Version/s: 2.0.0.Alpha2
    • Fix Version/s: 2.0.0.Alpha3
    • Component/s: None
    • Labels:
      None

      Description

      For creating Java-to-JavaScript calling interface, you need to use call JSInterfaceFactory.create(JavaScriptInterfaceToCreate.class).

      This is not really handy for direct usage:

      @RunWith(Arquillian.class)
      public class MyTestCase {
      
          @Drone
          private WebDriver browser;
      
          @Test
          public void test() throws InterruptedException {
              RequestGuard guard = JSInterfaceFactory.create(RequestGuard.class);
              Assert.assertEquals(RequestType.HTTP, guard.getRequestDone());
          }
      

      Let's implement test case enrichment, similarly as we did with @FindBy.

      You can re-use annotation @JavaScript:

      @RunWith(Arquillian.class)
      public class MyTestCase {
      
          @Drone
          private WebDriver browser;
          
          @JavaScript
          // or @ArquillianResource
          RequestGuard guard;
      
          @Test
          public void test() throws InterruptedException {
              Assert.assertEquals(RequestType.HTTP, guard.getRequestDone());
          }
      

      This injection should work also in component objects.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              jpapouse Jan Papousek (Inactive)
              Reporter:
              lfryc Lukáš Fryč (Inactive)
              Archiver:
              samahaja Sagar Mahajan

                Dates

                Created:
                Updated:
                Resolved:
                Archived: