Alan, well, maybe not. Are you testing the functionality of that service, or functionality that you are creating?
- George
toggle quoted message
Show quoted text
On 3/9/22 8:35 AM, Alan Baljeu via groups.io wrote:
Is that possible? I don¡¯t create auth tokens, but the service I consume does this.
On Mar 8, 2022, at 20:00, George Dinwiddie <lists@...> wrote:
?Alan,
Create an auth token in a setup method and use that. I would do so by calling the needed code directly rather than navigating to /login. You don't need an extra dependency on the URL structure.
- George
On 3/8/22 7:15 PM, Alan Baljeu via groups.io wrote:
I will keep Selenium in mind for future when I¡¯m doing UI work.
Maybe I can get more specific with my present concern.
I create an API service /xyz. That works by calling a 3rd party service but only works if I have an auth token. Otherwise it returns http redirect to the login page. Or maybe it should return ¡°Unauthorized¡± and my Javascript should react to this by navigating to /login.
In either case, now I want to write a test for /xyz. But this test cannot pass unless I have a token, that is only obtained by following the login process. So how can I write a test of /xyz? Maybe in the short term I just manually login for the server and then run all the tests, but longterm I want to avoid this. I must be missing some secret of how these things are done.
On Mar 8, 2022, at 13:28, Vijay via groups.io <vijay_nathani@...> wrote:
?NUnit is Ok for Unit Testing C# code.
For the Integration tests, you can use NUnit. Just ensure that these tests can be run seprately.
For UI testing, you will can add selenium to NUnit.
_._,_._,_
--
----------------------------------------------------------------------
* George Dinwiddie *
Software Development
Consultant and Coach
----------------------------------------------------------------------
--
----------------------------------------------------------------------
* George Dinwiddie *
Software Development
Consultant and Coach
----------------------------------------------------------------------