Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Http Test can now post files. Usage: post file <fileName> to <url>. #49

Merged
merged 6 commits into from
Apr 15, 2016
Merged

Conversation

tcnh
Copy link
Contributor

@tcnh tcnh commented Apr 13, 2016

Http Test can now post files. Usage: post file to .
File is expected to reside in fitnesse's files folder. Acceptance test and demo test will follow.

File is expected to reside in fitnesse's files folder.
@fhoeben
Copy link
Owner

fhoeben commented Apr 13, 2016

Cool!

I assume you will also update the documentation in the example pages.

@tcnh
Copy link
Contributor Author

tcnh commented Apr 13, 2016

Documentation in example is updated and this method is now als called in the acceptanceTests

@@ -5,6 +5,7 @@ The tests in this suite show example usage of this fixture:
>HttpGetTest shows how an example GET requests, specifying parameters in the query string.
>HttpPost1Test sends a POST request to a SOAP service, also adding an HTTP header.
The >HttpPost2UsingScenarioTest makes multiple SOAP calls to a service, where scenario parameters are used to change an input variable's value for each call.
>HttpPostFileTest sends a binary file to a mocked endpoint.
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here I would just mention it posts a binary file, and in the page describe its to a mocked endpoint

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@fhoeben
Copy link
Owner

fhoeben commented Apr 14, 2016

Ik zie nog falen acceptatie tests in travis:

  • HsacAcceptanceTests.SlimTests.HttpTest.XmlHttpTest(nl.hsac.fitnesse.fixture.AcceptanceTest)

Time elapsed: 3.293 sec <<< FAILURE!
java.lang.AssertionError: null

  • HsacAcceptanceTests.SlimTests.MockXmlServerTest(nl.hsac.fitnesse.fixture.AcceptanceTest)

    Time elapsed: 2.195 sec <<< ERROR!
    java.lang.Exception:

    3 extra request(s) received:
    1. --5zZIw8_CpYQUKncwCM23KqTo7MMPuUAOAJeAUgk
      Content-Disposition: form-data; name="test.png"; filename="test.png"
      Content-Type: application/octet-stream
      Content-Transfer-Encoding: binary

    2. --5zZIw8_CpYQUKncwCM23KqTo7MMPuUAOAJeAUgk
      Content-Disposition: form-data; name="test.png"; filename="test.png"
      Content-Type: application/octet-stream
      Content-Transfer-Encoding: binary

    3. --5zZIw8_CpYQUKncwCM23KqTo7MMPuUAOAJeAUgk
      Content-Disposition: form-data; name="test.png"; filename="test.png"
      Content-Type: application/octet-stream
      Content-Transfer-Encoding: binary

@tcnh
Copy link
Contributor Author

tcnh commented Apr 14, 2016

test.png was niet gecommit, daarom gaat de upload test mis. Staat nu wel in de tcnh branch in mijn fork. Gaat die niet automatisch mee met deze PR?

@fhoeben
Copy link
Owner

fhoeben commented Apr 14, 2016

Can we also support hyperlinks to the files section when posting?
So a reference in the wiki to the file like http://files/fileFixture/bye1.txt?

We probably need something like BrowserTest.getFilePathFromWikiUrl()...

@tcnh
Copy link
Contributor Author

tcnh commented Apr 14, 2016

Should not be too hard to do that.
I tried the travis build as well, but fails. It looks for the fitnesse files folder in: /home/travis/build/tcnh/hsac-fitnesse-fixtures/target/fitnesse-results/files/

It would make sense that this folder doesn't exist. Is this something we should fix in the build config or in code? The AcceptanceTest does succeed when it runs locally.

@fhoeben
Copy link
Owner

fhoeben commented Apr 14, 2016

The files section is moved when running tests in the CI environment. So far I mostly had files I downloaded during the test, and I wanted these to be available in the test report (and not a file in the files section available before the test started to be read by the test).

To work around this for this test we can first download a file in a test, and place that in a variable, we can then use that variable as input for the post (the fixture will see these as a wiki url).

@tcnh
Copy link
Contributor Author

tcnh commented Apr 14, 2016

nevermind. still broken, just with a different error

@tcnh tcnh closed this Apr 14, 2016
@tcnh tcnh reopened this Apr 14, 2016
@@ -35,6 +35,25 @@ public void setWaitAfterSwipe(int waitAfterSwipe) {
this.waitAfterSwipe = waitAfterSwipe;
}


Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any chance the changes to this class are meant for your other branch?

@fhoeben fhoeben merged commit 23226f9 into fhoeben:tcnh Apr 15, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants