Commit Graph

17 Commits

Author SHA1 Message Date
Steve Sanderson 5b4f3003af
Fix E2E test use of logs (#27114) (#27166)
* Restore support for logs in E2E tests. Fixes #25803

* Revert earlier workaround

* Update message in assertion

* Remove redundant script references
2021-02-11 13:30:17 -08:00
Safia Abdalla 222a218187
Bump Selenium dependency versions (#27947) (#28001)
* Bump Selenium dependency versions (#27947)
* Fix up package references for Selenium deps
2020-11-19 17:24:52 -08:00
Pranav K 0e5d7ef1d4
Attempt to read the logs from the browser (#26289)
* Attempt to read the logs from the browser

Seleniunm currently does not return log messages (See https://github.com/SeleniumHQ/selenium/issues/8229).
This making figuring out blazor WASM test failures a lot harder.

This change adds some JS to the test apps to read the console output.

* WIP
2020-09-28 17:07:22 -07:00
Mackinnon Buck 36c6c2c2a6
ElementReference FocusAsync API (#23316)
* Added working focus extension method.

* Added return value documentation for FocusAsync().

* Removed IJSRuntime argument from FocusAsync().

* Removed ElementReference.JSRuntime in favor of IServiceProvider.

* Updated Web.JS release binaries.

* Implemented ElementReferenceContext.

* Made ElementReferenceContext a non-abstract property in Renderer.

* Made ElementReference.Context explicitly nullable.

* Removed useless IServiceProvider dependency in RemoteJSRuntime.

* Updated Microsoft.AspNetCore.Components reference assemblies.

* Improved documentation and limited public API.
2020-06-26 09:19:50 -07:00
Pranav K 8efeefb3d1
Merge branch 'blazor-wasm' into prkrishn/merge-blazor-wasm 2020-05-16 21:10:28 -07:00
Pranav K c935e9aa2d
Blazor WebAssembly package renames (#19026)
Fixes https://github.com/dotnet/aspnetcore/issues/18384
2020-02-18 10:54:28 -08:00
Javier Calvarro Nelson 0dbb01bd8c
[Blazor] Adds an authentication library for Blazor webassembly (#18851)
* Adds a Microsoft.AspNetCore.Components.WebAssembly.Authentication
  library for performing authentication in Blazor webassembly.
* Includes a default implementation that supports OIDC capable IdPs
  using oidc-client.js
* Includes multiple primitives to deal with authentication flows and
  supports acquiring access tokens to call APIs.
  * RemoteAuthenticatorView is responsible for handling authentication
    operations at the user interface level.
  * RemoteAuthenticatorService is responsible for handling the lower
    level authentication details by using JavaScript interop to interact
    with the underlying javascript library implementing the auth protocol.
  * SignOutSessionStateManager handles CSRF protection for the logout
    path.
  * IAccessTokenProvider handles provisioning access tokens to call APIs.
2020-02-17 14:36:57 -08:00
Ryan Brandenburg 5dc2d6eafa Extend timeout and report failure to WarmUp for template tests (#16759)
* Extend timeout and report failure to WarmUp for template tests

* Retry click events
2020-01-15 18:44:56 -08:00
Pranav K c298c94fe1
Validation fixes for Blazor (#14972)
* Validation fixes for Blazor

* Ensure validation result that are not associated with a member are recorded. Fixes https://github.com/aspnet/AspNetCore/issues/10643
* Add support for showing model-specific errors to ValidationSummary
* Add support for nested validation and a more suitable CompareAttribute. Fixes https://github.com/aspnet/AspNetCore/issues/10526
2019-10-18 11:26:17 -07:00
Ryan Brandenburg a68c961a58
Dev exception notifications (#14636)
Blazor dev exception notification
2019-10-09 16:37:57 -07:00
Javier Calvarro Nelson df771dbf43
[Blazor] Cleans up infrastructure used for tests (#13515)
* Removes unnecessary test projects.
* Add a sample project to quickly test changes.
* Breaks off tests based on multiple startups.
* Unifies assertions across tests.
* Captures all logs on test failures.
2019-09-11 15:15:50 +02:00
Javier Calvarro Nelson 73f969852b
[Templating] Infrastructure improvements (#13672)
* Automatically capture a screenshot when an assertion fails.
* Enable configurable options for different environments (CI|Dev).
* Include log errors in all exceptions.
* Add default timeout configurations and failure timeout configurations for CI and Dev environments.
2019-09-06 16:02:49 +02:00
Ryan Nowak 5d4c4d648f Make WaitAssert report browser errors
It turns out we frequently have errors in the browser console in cases
where we're hitting a "timeout".
2019-08-11 10:49:14 -07:00
Ryan Brandenburg 3ab8ebff42
Extend timeout and enforce usings (#12952)
Extend timeout and enforce usings
2019-08-09 13:38:09 -07:00
Javier Calvarro Nelson 437134f1da
[Infrastructure] Standarize E2E test asserts and increase wait time (#9080)
* Standarize E2E test asserts and increase wait time
2019-04-05 09:00:11 +02:00
Javier Calvarro Nelson 9f1a978230
[Infrastructure improvements] (#8275)
* Improved selenium start and tear down
  * Selenium is set up and torn down in an assembly fixture.
  * Selenium is initialized lazily and in a non-blocking way.
  * Selenium processes are tracked as part of the build and their pids
    written to a file on disk for cleanup in the event of unexpected
    termination of the test process.
  * Browser fixture retries with linear backoff to create a remote
    driver. Under heavy load (like when we are doing a simultaneous NPM
    restore) the selenium server can become unresponsive so we retry
    three times, with a longer comand timeout allowance each time up to
    a max of 3 minutes.
* Moved test project setup to build time instead of runtime.
  * Added target PrepareForTest to create the required files for testing
    * The template creation folder.
    * The template props file to use our built packages.
    * The folder for the custom hive.
  * Added assembly metadata attributes to find all the data we need to
    run the tests.
    * Path to the artifacts shipping packages folder.
    * Path to the artifacts non-shipping packages folder.
    * Path to the test templates creation folder.
    * Path to use for the custom templating hive used in tests.
  * Proper cleanup as part of the build
    * Remove the test templates creation folder.
    * Remove the test packages restore path.
    * Recreate the test templates creation folder.
    * Recreate the test packages restore path.
  * Generated Directory.Build.Props and Directory.Build.Targets in the
    test templates creation folder.
  * Cleaned up potentially stale templatetestsprops.
* Improved test flows
  * Initialization is done lazily and asynchronously.
    * Selenium
    * Browser fixture
    * Template initialization.
  * Flattened test flows to avoid assertions inside deep callstacks.
    * All assertions happen at the test level with improved error messages.
      * With the exception of the migrations assertions.
    * Assertions contain information about which step failed, for what
      project and what failure details.
  * Broke down tests to perform individual steps instead of mixing build
    and publish.
    * Publish project.
    * Build project. (Debug)
    * Run built project.
    * Run published project.
  * Concentrated build logic into the Project class.
    * Context between the different steps of a test is maintained in
      this class.
    * All operations that require coordination are performed within this
      class.
      * There is a lock for dotnet and a lock for nodejs. When building
        SPAs we acquire the nodejs lock to correctly prevent multiple
        runs of nodejs in parallel.

[ApiAuthorization template cleanups]
  * Fix preview3 issues with breaking changes on Entity framework by
    manually configuring the model in ApiAuthorizationDbContext.
  * Add app.db to the project file when using local db.
  * Fix linting errors on angular template.
  * Fix react tests
  * Add tests to cover new auth options in the SPA templates.
2019-03-20 08:44:20 +01:00
Javier Calvarro Nelson d7a9606040
[Templating][Components] Unify and improve E2E testing infrastructure (#8188)
* Unify the Templating and Components testing infrastructure.
* Enable test project discovery in the components E2E tests.
* Enable selectively disabling Selenium tests through build properties.
2019-03-11 18:40:18 +01:00