Giraffe: Add integration/end-to-end tests

Created on 22 Dec 2017  Â·  9Comments  Â·  Source: giraffe-fsharp/Giraffe

I would like to see simple tests that create a webserver and try to browse it with some client.

help wanted samples

Most helpful comment

no. not UI test. That's another dimension (for later).

I mean:

  • start asp.net core
  • add couple of routes
  • create HttpClient in the test and browse the server

I will then copy such tests and expand it for the sockets:

  • start asp.net core
  • open Giraffe.Sockets on server
  • create a few socketclients in the test
  • send messages...

All 9 comments

You mean beyond the TestHost tests which you can do with ASP.NET Core? Selenium is what I've been using pre .NET Core everywhere, but not sure what the latest status is there now..

no. not UI test. That's another dimension (for later).

I mean:

  • start asp.net core
  • add couple of routes
  • create HttpClient in the test and browse the server

I will then copy such tests and expand it for the sockets:

  • start asp.net core
  • open Giraffe.Sockets on server
  • create a few socketclients in the test
  • send messages...

I think that's a good start. Did not see these yet.

Am 22.12.2017 18:10 schrieb "Jimmy Byrd" notifications@github.com:

So different from stuff like:

https://github.com/giraffe-fsharp/Giraffe/blob/master/tests/Giraffe.Tests/
HttpContextExtensionsTests.fs#L680

and

https://github.com/giraffe-fsharp/Giraffe/blob/master/
samples/SampleApp/SampleApp.Tests/Tests.fs#L108

—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/giraffe-fsharp/Giraffe/issues/188#issuecomment-353639083,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AADgNBusZnU5eOZX7oXJOokbcDpKtmDIks5tC-JvgaJpZM4RKyjD
.

I have updated the giraffe template today as well. If you get the latest
version you can run dotnet new giraffe --IncludeTests which will create a
default test project for integration tests.

On 22 Dec 2017 18:43, "Steffen Forkmann" notifications@github.com wrote:

I think that's a good start. Did not see these yet.

Am 22.12.2017 18:10 schrieb "Jimmy Byrd" notifications@github.com:

So different from stuff like:

https://github.com/giraffe-fsharp/Giraffe/blob/master/tests/Giraffe.Tests/
HttpContextExtensionsTests.fs#L680

and

https://github.com/giraffe-fsharp/Giraffe/blob/master/
samples/SampleApp/SampleApp.Tests/Tests.fs#L108

—
You are receiving this because you authored the thread.

Reply to this email directly, view it on GitHub
issuecomment-353639083>,
or mute the thread
AADgNBusZnU5eOZX7oXJOokbcDpKtmDIks5tC-JvgaJpZM4RKyjD>
.

—
You are receiving this because you commented.

Reply to this email directly, view it on GitHub
https://github.com/giraffe-fsharp/Giraffe/issues/188#issuecomment-353644608,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AEXlaonTlapu24cQcG0JvghHtZ4NIaMtks5tC-pTgaJpZM4RKyjD
.

Nice

Am 22.12.2017 19:54 schrieb "Dustin Moris Gorski" <[email protected]

:

I have updated the giraffe template today as well. If you get the latest
version you can run dotnet new giraffe --IncludeTests which will create a
default test project for integration tests.

On 22 Dec 2017 18:43, "Steffen Forkmann" notifications@github.com wrote:

I think that's a good start. Did not see these yet.

Am 22.12.2017 18:10 schrieb "Jimmy Byrd" notifications@github.com:

So different from stuff like:

https://github.com/giraffe-fsharp/Giraffe/blob/master/
tests/Giraffe.Tests/
HttpContextExtensionsTests.fs#L680

and

https://github.com/giraffe-fsharp/Giraffe/blob/master/
samples/SampleApp/SampleApp.Tests/Tests.fs#L108

—
You are receiving this because you authored the thread.

Reply to this email directly, view it on GitHub
issuecomment-353639083>,
or mute the thread
AADgNBusZnU5eOZX7oXJOokbcDpKtmDIks5tC-JvgaJpZM4RKyjD>
.

—
You are receiving this because you commented.

Reply to this email directly, view it on GitHub
issuecomment-353644608>,
or mute the thread
AEXlaonTlapu24cQcG0JvghHtZ4NIaMtks5tC-pTgaJpZM4RKyjD>
.

—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/giraffe-fsharp/Giraffe/issues/188#issuecomment-353656077,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AADgNNbGztOO_xVOUaoQlPyrlgVDWcgbks5tC_rfgaJpZM4RKyjD
.

@forki I'll send you a PR with a basic test real quick

Yes awesome. That will help a lot. We can then remove all the boilerplate afterwards.

@forki Can this be closed or is there still something missing?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

forki picture forki  Â·  8Comments

wiredsister picture wiredsister  Â·  5Comments

rmunn picture rmunn  Â·  6Comments

dustinmoris picture dustinmoris  Â·  6Comments

padzikm picture padzikm  Â·  6Comments