C
C#Davaaron

❔ E2E Test - Start MVC project

Hi, im using a testing tool for E2E testing and wondered how to get a MVC project started so the tool can visit the URL of the application and do some stuff? I call this in the constructor of the test class
OtherProjRefNs.Program.CreateWebHostBuilder(null)
.UseStartup<Startup>()
.Build()
.Start();
OtherProjRefNs.Program.CreateWebHostBuilder(null)
.UseStartup<Startup>()
.Build()
.Start();
but when I navigate to the URL within a browser after the Start() method, it says the page is not reachable. How can I start my MVC project?
UU
Unknown User400d ago
D
Davaaron400d ago
I see this (first attachment) when I open the page The network tab shows this (second attachment). I dont see errors in the output console or somewhere else. I reduced the call to
OtherProjRefNs.Program.CreateWebHostBuilder(null)
.UseStartup<Startup>()
OtherProjRefNs.Program.CreateWebHostBuilder(null)
.UseStartup<Startup>()
So it's going inside the ConfigureServices and Configure method, but it's too fast! I think the server is not started somehow.. when I debug the MVC project, it starts up correctly. Maybe the appsettings.json cannot be loaded, let's see I debug again
UU
Unknown User400d ago
D
Davaaron400d ago
I followed the IntegrationTest docs, as there was no E2E docs. I already tried the WebApplicationFactory but with the same results. The issue might be in my understanding of how it works, as it does not startup the whole MVC project, but I thought it would. We use Playwright in C# with XUnit. Unfortunately, there is no real documentation about that. Our idea was that the test could do start/shutdown the whole MVC project, so we dont have to start and shutdown the MVC project separately before and after all tests.
UU
Unknown User400d ago
A
Accord399d ago
Was this issue resolved? If so, run /close - otherwise I will mark this as stale and this post will be archived until there is new activity.
Want results from more Discord servers?
Add your server
More Posts
❔ implementing licensing system in my appHi guys, I would like to implement some kind of license system to my app written in c#. I've been coI want to connect an esp32 to VS (WPF) C# via BLE, can anyone help? Maybe a tutorial or an example?I want to read some sensors with the ESP32 Dev, this works very well and i can display the data in m✅ ResolvePackageAssets is failing because it can't find the NuGet fallback folderI installed something called Godot portably on a USB which ended up being more invasive than everybo❔ How to calculate event expression?like ```c# var result = a+b-c+d-c+d-b+a; ``` ``a,b,c,d`` are all events, and each of them contains m❔ Class Diagram Design questionSo I am doing this design puzzle in Heads First Design Pattern book. So for those who don´t know th✅ telling a console app to exithow do i tell a console app to stop and close the window?❔ I need help for my GameCan everyone help me with my game for my school project, I need help with the scripting? My Code doe❔ Microsoft.XmlSerializer.Generator causes failure to load assembly System.RuntimeHey all, as a way to get my program running under NativeAOT I've been looking into the Microsoft.Xml✅ Make method implemented in interface accessible from implementing typei have an interface ```csharp interface ICL { public IEnumerable<ICLPlatform> GetPlatforms() { ❔ ASP.NET, MongoDB, C#does anyone have experience with c#, mongodb and ASP.NET? I have a project and I need to get data to✅ Is there a working code editor for blazor server?i found one for blazor wasm https://github.com/serdarciplak/BlazorMonaco but that one does not work ✅ Multiple inheritance questionI have a partial class webform that is inheriting a base page class. Inside it there are multiple re❔ How to automatically set version of project to know what version deployed on specific server?The problem is that there is bunch of clients with different versions of .net core and netfx projecthow to make a target that will disappear after shooting a couple of times this is my scripts i havebut it doesnt seem to want to destroy https://paste.mod.gg/mppnwkqnmukq/2❔ ✅ Choosing an appropriate data structureSo I have a list of objects and I want one in the list to be active and the rest to be inactive. I ❔ Saving User DataI have it set up through properties, but I'm having a lot of trouble with showing it on other forms Unsupported statement value type: Microsoft.DotNet.DesignTools.Client.CodeDom.CodeBodyTextStatementhttps://github.com/Jordan-Belfort-88/Audio-Player-1.0/blob/master/Audio%20Player/Form1.Designer.cs IAssert.Raises<> in xUnitI'm trying to create tests for certain events. However it seems that xUnit assumes that I use EventH❔ I have an API function and I want to know what exception it can throw. How can I do that?This is not said in the documentationAmbiguity between 2 things idk how to fixGot an error message all of a sudden saying this when everything was working perfect before so i und