Test scope typically has an influence on the speed of the tests. Test scope describes how extensive the tests are. In E2E testing, the Razor component and all of its auxiliary infrastructure are part of the test, including CSS, JS, and the DOM and browser APIs. External dependencies, such as services and JS interop, must be mocked. In unit testing, only the Razor component (Razor/C#) is involved. NET is an example of an E2E testing framework that can be used with Blazor apps. The testing tool inspects and interacts with the CUT through the browser. Assertions that component behavior is correct.īUnit is an example of a library that enables Razor component unit testing.Į2E testing: A test runner runs a Blazor app containing the CUT and automates a browser instance.Triggering of event handlers and life cycle methods.Inspection of component output and state.Unit testing: Unit tests are written with a unit testing library that provides: Two common approaches for testing Razor components are end-to-end (E2E) testing and unit testing: A test passes when one or more inspected values matches the expected values for the test. For example, event handlers can be triggered, such as an onclick event for a button. Depending on the type of test performed, possibly subject to interaction or modification. ![]()
0 Comments
Leave a Reply. |