Wait for component to mount before checking for output (#24451)

* Wait for component to mount before checking for output
* Use Exists to check for element with timeout
* Update ComponentRenderingTest.cs
This commit is contained in:
Safia Abdalla 2020-07-31 12:44:27 -07:00 committed by GitHub
parent b2fe5dd4b1
commit c0c0a26000
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -46,7 +46,8 @@ namespace Microsoft.AspNetCore.Components.E2ETest.Tests
public void CanRenderTextOnlyComponent()
{
var appElement = Browser.MountTestComponent<TextOnlyComponent>();
Assert.Equal("Hello from TextOnlyComponent", appElement.Text);
Browser.Exists(By.XPath("//*[contains(., 'Hello from TextOnlyComponent')]"));
}
// This verifies that we've correctly configured the Razor language version via MSBuild.