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

Test enricher or resource provider for JSInterfaceFactory

    Details

    • Type: Feature Request
    • Status: Closed (View Workflow)
    • 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.

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  jpapouse Jan Papousek
                  Reporter:
                  lfryc Lukáš Fryč
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  2 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: