[arquillian-issues] [JBoss JIRA] (ARQ-1952) Warp requests hit the application port instead of LittleProxy`s one

Razvan Petre (JIRA) issues at jboss.org
Tue Oct 11 09:25:01 EDT 2016


    [ https://issues.jboss.org/browse/ARQ-1952?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13305570#comment-13305570 ] 

Razvan Petre commented on ARQ-1952:
-----------------------------------

hi [~mjobanek], Thank you for your reply. I am trying to migrate from glassfish 3, java 6 to glassfish 4, java 8 a quite large suite of arquillian /warp/ grapehene tests, I would say around 1200 tests in total. I am hitting this problem: https://developer.jboss.org/message/963976#963976

Warp helped me a lot in developing in a TDD style and I feel very confident that this is the way to go. (even though these tests are quite heavy sometimes, but you are sure it will work when deployed in the container).

If you could release a new version with the latest changes it would be of great help. I have added below and example of one of my tests.

{code:java}
@RunAsClient
@WarpTest
@RunWith(Arquillian.class)
public class ErrorInspectorPageManageErrorsTest extends SeleniumTestHelper {
    private static final String TAG_ERROR_FOR_TESTING = "comment on error";
    private static final String ERROR_CODE_100 = "100";
    private static final String ERROR_CODE_200 = "200";
    private static final String ERROR_CODE_300 = "300";
    private static final String ERROR_CODE_100_200 = "100,200";
    private static final String ERROR_CODE_100_DESCRIPTION = "Error code 100 description";
    private static final String ERROR_CODE_200_DESCRIPTION = "Error code 200 description";
    private static final String ERROR_CODE_300_DESCRIPTION = "Error code 300 description";

    @Deployment
    public static WebArchive createDeployment() {
        return Deployments.createFdsiDeployment();
    }

    @Test
    public void canCloseErrors() {
        Warp.initiate(new Activity() {
            
            public void perform() {
                //@formatter:off
                final ErrorInspectorPage page = new ErrorInspectorPage(selenium).withPath(ErrorInspectorPage.PATH);
                page.loginAs(BusinessRoles.Role.INTERFACE_ADMIN, ADMIN_USERS).addTestDataFor(CAN_CLOSE_ERRORS);

                page.open();

                assertThat(page.table().count().is(THREE_ERRORS), is(true));
                assertThat(page.table.checkBoxes().size(), is(FOURTH));

                assertThat(page.table.row(FIRST).cell(STATUS).text(), is(IS_OPEN));
                assertThat(page.table.row(SECOND).cell(STATUS).text(), is(IS_OPEN));
                assertThat(page.table.row(THIRD).cell(STATUS).text(), is(IS_OPEN));
                
                assertThat(page.button(BULK_ACTION_BUTTON).getText(), is("Bulk Action on 3 errors"));
                
                assertThat(page.topActionButton().isDisabled(), is(true));
                assertThat(page.topActionButton().getText(), is("Action on selected error(s)"));

                page.table.row(FIRST).selectionColumnCheckbox().click();
                waitForTwoSeconds();
                
                assertThat(page.topActionButton().isEnabled(), is(true));

                assertThat(page.topActionButton().getText(), is("Action on 1 error(s)"));
                
                page.topActionButton().click();
                page.waitUntilPresent(page.topCloseButton());
                page.waitUntilVisible(page.topCloseButton());

                waitFor(DEFAULT_TIMEOUT).until(new Predicate<WebDriver>() {
                    
                    public boolean apply(WebDriver input) {
                        page.button(CLOSE_BUTTON).click();
                        waitForTwoSeconds();
                        
                        return page.overlayTextArea(CLOSE_OVERLAY_TEXTAREA).isDisplayed();
                    }
                });
                  
                assertThat(page.closeErrorscounter().getText(), is("255 characters remaining."));
                page.overlayTextArea(CLOSE_OVERLAY_TEXTAREA).typeInto(CLOSING_THE_ERROR_FOR_TESTING);
                
                assertThat(page.overlayButton(OK_CLOSE_BUTTON).isPrimary(), is(true));
                page.overlayButton(OK_CLOSE_BUTTON).click();
                waitForTwoSeconds();
                assertThat(page.topActionButton().isDisabled(), is(true));
                page.waitUntilPresent(page.table());

                assertThat(page.infoMessage(), is("Error(s) closed:You closed 1 error(s). 0 error(s) were skipped."));
               
                assertThat(page.table().count().is(TWO_ERRORS), is(true));
                assertThat(page.table.row(FIRST).cell(STATUS).text(), is(IS_OPEN));
                assertThat(page.table.row(SECOND).cell(STATUS).text(), is(IS_OPEN));

                assertThat(page.button(BULK_ACTION_BUTTON).getText(), is("Bulk Action on 2 errors"));

                OurPage userAuditPage = new OurPage(selenium).withPath(UserAuditPage.PATH);
                userAuditPage.open();
                
                assertThat(userAuditPage.table().count().is(2), is(true));
                assertThat(userAuditPage.table.row(1).cell(1).text(), is(FixtureBuilder.PRICING_PATTERN));
                assertThat(userAuditPage.table.row(1).cell(2).text(), is(UserAction.UPDATE_ERROR.toCamelCase()));
                assertThat(userAuditPage.table.row(1).cell(3).text(), is(""));
                assertThat(userAuditPage.table.row(1).cell(4).text(), is("[1] errors were updated to [CLOSED]"));
                assertThat(userAuditPage.table.row(1).cell(5).text(), is(TEST_USER));
                
                page.assertDatabaseState(AssertTestData.CAN_CLOSE_ERRORS);
                //@formatter:on
           }
        }).inspect(new Inspection() {
            private static final long serialVersionUID = 1L;
        });        
    }
{code}




> Warp requests hit the application port instead of LittleProxy`s one
> -------------------------------------------------------------------
>
>                 Key: ARQ-1952
>                 URL: https://issues.jboss.org/browse/ARQ-1952
>             Project: Arquillian
>          Issue Type: Bug
>          Components: Extension - Warp
>    Affects Versions: warp_1.0.0.Alpha7, warp_1.0.0.Beta1
>         Environment: Linux x64, ChromeDriver , PhantomJSDriver, Wildfly 8.0 & 8.2, Mojarra 2.8 & 2.11
>            Reporter: Pëtr Andreev
>             Fix For: warp_1.0.0.Beta1
>
>         Attachments: ARQ-1952-failure.log, ARQ-1952-success.log
>
>
> Warp observer intermittently fails while inspecting the requests with:
> "There were no requests matched by observer \[containsParameter(XXXX)\] ".
> The technical reason for the failure is that the client request hits the original (application server) port and not the [LittleProxy`s|https://github.com/adamfisk/LittleProxy] one (HTTP successful  and failed traffic is attached showing the HTTP requests going to the wrong port, i.e 8080). Since Warp hooks into the client/server conversation providing its own implementation of _HttpFiltersSourceAdapter_ in _DefaultHttpFiltersSource_, while expecting the payload request from client after setting up a WarpContext, the Warp runs into timeout because of the HTTP request never reaches the LittleProxy.



--
This message was sent by Atlassian JIRA
(v6.4.11#64026)



More information about the arquillian-issues mailing list