diff --git a/Directory.Build.targets b/Directory.Build.targets index a8c939164a17..2ad1648579a2 100644 --- a/Directory.Build.targets +++ b/Directory.Build.targets @@ -172,6 +172,17 @@ SkipUnchangedFiles="$(SkipCopyUnchangedFiles)" /> + + + + + + + diff --git a/global.json b/global.json index 54319d126617..73e6bbb400ee 100644 --- a/global.json +++ b/global.json @@ -1,9 +1,9 @@ { "sdk": { - "version": "10.0.100-alpha.1.24573.1" + "version": "10.0.100-alpha.1.24609.2" }, "tools": { - "dotnet": "10.0.100-alpha.1.24573.1", + "dotnet": "10.0.100-alpha.1.24609.2", "runtimes": { "dotnet/x86": [ "$(MicrosoftInternalRuntimeAspNetCoreTransportVersion)" diff --git a/src/Components/test/E2ETest/ServerExecutionTests/HeadModificationPrerenderingTest.cs b/src/Components/test/E2ETest/ServerExecutionTests/HeadModificationPrerenderingTest.cs index 023ad77eadf4..759a67070ebf 100644 --- a/src/Components/test/E2ETest/ServerExecutionTests/HeadModificationPrerenderingTest.cs +++ b/src/Components/test/E2ETest/ServerExecutionTests/HeadModificationPrerenderingTest.cs @@ -49,7 +49,7 @@ public void CanModifyHeadDuringAndAfterPrerendering() // Check that head metadata can be changed after prerendering. Browser.Equal("Updated title 1", () => Browser.Title); - Browser.Equal("Updated description 1", () => Browser.FindElement(By.Id("meta-description")).GetAttribute("content")); + Browser.Equal("Updated description 1", () => Browser.FindElement(By.Id("meta-description")).GetDomAttribute("content")); } private void BeginInteractivity() diff --git a/src/Components/test/E2ETest/ServerExecutionTests/MultipleRootComponentsTest.cs b/src/Components/test/E2ETest/ServerExecutionTests/MultipleRootComponentsTest.cs index f8f3e84cc9c9..5d1575c6ab59 100644 --- a/src/Components/test/E2ETest/ServerExecutionTests/MultipleRootComponentsTest.cs +++ b/src/Components/test/E2ETest/ServerExecutionTests/MultipleRootComponentsTest.cs @@ -70,7 +70,7 @@ public void CanRenderMultipleRootComponents() Assert.Single(greets, "Hello Abraham"); Assert.Equal(2, greets.Where(g => g == "Hello Blue fish").Count()); Assert.Equal(3, greets.Where(g => string.Equals("Hello", g)).Count()); // 3 server prerendered without parameters - var content = Browser.Exists(By.Id("test-container")).GetAttribute("innerHTML"); + var content = Browser.Exists(By.Id("test-container")).GetDomProperty("innerHTML"); var markers = ReadMarkers(content); var componentSequence = markers.Select(m => m.Item1.PrerenderId != null).ToArray(); var expectedComponentSequence = new bool[] diff --git a/src/Components/test/E2ETest/ServerExecutionTests/PrerenderingTest.cs b/src/Components/test/E2ETest/ServerExecutionTests/PrerenderingTest.cs index 6bc0635946f8..9ab8248ec73f 100644 --- a/src/Components/test/E2ETest/ServerExecutionTests/PrerenderingTest.cs +++ b/src/Components/test/E2ETest/ServerExecutionTests/PrerenderingTest.cs @@ -56,13 +56,13 @@ public void CanUseJSInteropFromOnAfterRenderAsync() // Prerendered output can't use JSInterop Browser.Equal("No value yet", () => Browser.Exists(By.Id("val-get-by-interop")).Text); - Browser.Equal(string.Empty, () => Browser.Exists(By.Id("val-set-by-interop")).GetAttribute("value")); + Browser.Equal(string.Empty, () => Browser.Exists(By.Id("val-set-by-interop")).GetDomProperty("value")); BeginInteractivity(); // Once connected, we can Browser.Equal("Hello from interop call", () => Browser.Exists(By.Id("val-get-by-interop")).Text); - Browser.Equal("Hello from interop call", () => Browser.Exists(By.Id("val-set-by-interop")).GetAttribute("value")); + Browser.Equal("Hello from interop call", () => Browser.Exists(By.Id("val-set-by-interop")).GetDomProperty("value")); } [Fact] diff --git a/src/Components/test/E2ETest/ServerRenderingTests/EnhancedNavigationTest.cs b/src/Components/test/E2ETest/ServerRenderingTests/EnhancedNavigationTest.cs index 94b6b80f53a1..ba6526360afc 100644 --- a/src/Components/test/E2ETest/ServerRenderingTests/EnhancedNavigationTest.cs +++ b/src/Components/test/E2ETest/ServerRenderingTests/EnhancedNavigationTest.cs @@ -182,7 +182,7 @@ public void CanScrollToHashWithoutPerformingFullNavigation() Browser.True(() => Browser.GetScrollY() > 500); Browser.True(() => Browser .Exists(By.Id("uri-on-page-load")) - .GetAttribute("data-value") + .GetDomAttribute("data-value") .EndsWith("scroll-to-hash", StringComparison.Ordinal)); } diff --git a/src/Components/test/E2ETest/ServerRenderingTests/FocusOnNavigateTest.cs b/src/Components/test/E2ETest/ServerRenderingTests/FocusOnNavigateTest.cs index 2a0dd3acf350..14a16f49dd8f 100644 --- a/src/Components/test/E2ETest/ServerRenderingTests/FocusOnNavigateTest.cs +++ b/src/Components/test/E2ETest/ServerRenderingTests/FocusOnNavigateTest.cs @@ -29,21 +29,21 @@ public override Task InitializeAsync() public void FocusIsMoved_AfterInitialPageLoad_WhenNoElementHasFocus() { Navigate($"{ServerPathBase}/focus-on-navigate/static"); - Browser.True(() => Browser.SwitchTo().ActiveElement().GetAttribute("data-focus-on-navigate") is not null); + Browser.True(() => Browser.SwitchTo().ActiveElement().GetDomAttribute("data-focus-on-navigate") is not null); } [Fact] public void FocusIsPreserved_AfterInitialPageLoad_WhenAnyElementHasFocus() { Navigate($"{ServerPathBase}/focus-on-navigate/static-with-other-focused-element"); - Browser.True(() => Browser.SwitchTo().ActiveElement().GetAttribute("data-focus-on-load") is not null); + Browser.True(() => Browser.SwitchTo().ActiveElement().GetDomAttribute("data-focus-on-load") is not null); } [Fact] public void FocusIsPreserved_AfterInitialPageLoad_WhenAutofocusedElementIsPresent() { Navigate($"{ServerPathBase}/focus-on-navigate/autofocus"); - Browser.True(() => Browser.SwitchTo().ActiveElement().GetAttribute("autofocus") is not null); + Browser.True(() => Browser.SwitchTo().ActiveElement().GetDomAttribute("autofocus") is not null); } [Fact] @@ -59,7 +59,7 @@ public void FocusIsMoved_OnEnhancedNavigation_WhenAnyElementMatchesSelector() { Navigate($"{ServerPathBase}/focus-on-navigate"); Browser.Click(By.LinkText("Statically rendered")); - Browser.True(() => Browser.SwitchTo().ActiveElement().GetAttribute("data-focus-on-navigate") is not null); + Browser.True(() => Browser.SwitchTo().ActiveElement().GetDomAttribute("data-focus-on-navigate") is not null); } [Fact] @@ -67,11 +67,11 @@ public void FocusIsPreserved_OnEnhancedFormPost_WhenAnyElementMatchesSelector() { Navigate($"{ServerPathBase}/focus-on-navigate"); Browser.Click(By.LinkText("Form submission")); - Browser.True(() => Browser.SwitchTo().ActiveElement().GetAttribute("id") == "value-to-submit"); + Browser.True(() => Browser.SwitchTo().ActiveElement().GetDomAttribute("id") == "value-to-submit"); Browser.FindElement(By.Id("value-to-submit")).ReplaceText("Some value"); Browser.Click(By.Id("submit-button")); Browser.Equal("Some value", () => Browser.FindElement(By.Id("submitted-value")).Text); - Browser.True(() => Browser.SwitchTo().ActiveElement().GetAttribute("id") == "submit-button"); + Browser.True(() => Browser.SwitchTo().ActiveElement().GetDomAttribute("id") == "submit-button"); } [Fact] @@ -87,7 +87,7 @@ public void FocusIsMoved_AfterStreaming_WhenElementMatchesSelector() tcs.SetResult(); Browser.Equal("Complete", () => Browser.FindElement(By.Id("streaming-status")).Text); - Browser.True(() => Browser.SwitchTo().ActiveElement().GetAttribute("data-focus-on-navigate") is not null); + Browser.True(() => Browser.SwitchTo().ActiveElement().GetDomAttribute("data-focus-on-navigate") is not null); } [Fact] @@ -101,11 +101,11 @@ public void FocusIsPreserved_AfterStreaming_WhenElementMatchesSelector() Browser.True(() => Browser.SwitchTo().ActiveElement().TagName == "body"); Browser.Click(By.Id("focusable-input")); - Browser.True(() => Browser.SwitchTo().ActiveElement().GetAttribute("id") == "focusable-input"); + Browser.True(() => Browser.SwitchTo().ActiveElement().GetDomAttribute("id") == "focusable-input"); tcs.SetResult(); Browser.Equal("Complete", () => Browser.FindElement(By.Id("streaming-status")).Text); - Browser.True(() => Browser.SwitchTo().ActiveElement().GetAttribute("id") == "focusable-input"); + Browser.True(() => Browser.SwitchTo().ActiveElement().GetDomAttribute("id") == "focusable-input"); } } diff --git a/src/Components/test/E2ETest/ServerRenderingTests/FormHandlingTests/FormWithParentBindingContextTest.cs b/src/Components/test/E2ETest/ServerRenderingTests/FormHandlingTests/FormWithParentBindingContextTest.cs index 6afe7639ee83..c36af49520a4 100644 --- a/src/Components/test/E2ETest/ServerRenderingTests/FormHandlingTests/FormWithParentBindingContextTest.cs +++ b/src/Components/test/E2ETest/ServerRenderingTests/FormHandlingTests/FormWithParentBindingContextTest.cs @@ -107,7 +107,7 @@ public void DataAnnotationsWorkForForms(bool suppressEnhancedNavigation) { var error = Assert.Single(errors); Assert.Equal("Name is too long", error.Text); - Assert.Equal("John", Browser.FindElement(By.CssSelector("input[name='Parameter.FirstName']")).GetAttribute("value")); + Assert.Equal("John", Browser.FindElement(By.CssSelector("input[name='Parameter.FirstName']")).GetDomProperty("value")); }, }; DispatchToFormCore(dispatchToForm); @@ -150,7 +150,7 @@ public void MultipleParametersMultipleFormsDoNotConflict(bool suppressEnhancedNa { var error = Assert.Single(errors); Assert.Equal("The value 'abc' is not valid for 'Id'.", error.Text); - Assert.Equal("abc", Browser.FindElement(By.CssSelector("form[name=bind-integer] input[name=Id]")).GetAttribute("value")); + Assert.Equal("abc", Browser.FindElement(By.CssSelector("form[name=bind-integer] input[name=Id]")).GetDomProperty("value")); }, SuppressEnhancedNavigation = suppressEnhancedNavigation, }; @@ -265,8 +265,8 @@ public void CanDisplayErrorsFromMultipleParametersToTheDefaultForm(bool suppress { Assert.Equal("The value 'invalid' is not valid for 'OtherParameter'.", error.Text); }); - Assert.Equal("abcd", Browser.FindElement(By.CssSelector("input[name=Parameter]")).GetAttribute("value")); - Assert.Equal("invalid", Browser.FindElement(By.CssSelector("input[name=OtherParameter]")).GetAttribute("value")); + Assert.Equal("abcd", Browser.FindElement(By.CssSelector("input[name=Parameter]")).GetDomProperty("value")); + Assert.Equal("invalid", Browser.FindElement(By.CssSelector("input[name=OtherParameter]")).GetDomProperty("value")); }, SuppressEnhancedNavigation = suppressEnhancedNavigation, }; @@ -294,7 +294,7 @@ public void CanHandleBindingErrorsBindParameterToTheDefaultForm(bool suppressEnh { Assert.Equal("The value 'abc' is not valid for 'Parameter'.", error.Text); }); - Assert.Equal("abc", Browser.FindElement(By.CssSelector("input[name=Parameter]")).GetAttribute("value")); + Assert.Equal("abc", Browser.FindElement(By.CssSelector("input[name=Parameter]")).GetDomProperty("value")); } }; DispatchToFormCore(dispatchToForm); @@ -331,7 +331,7 @@ public void CanBindComplexTypeToDefaultForm(bool suppressEnhancedNavigation) { // Verify the same form element is still in the page // We wouldn't be allowed to read the attribute if the element is stale - Assert.NotEmpty(form.GetAttribute("action")); + Assert.NotEmpty(form.GetDomAttribute("action")); } } @@ -388,7 +388,7 @@ public void CanBreakFormIntoMultipleComponents(bool suppressEnhancedNavigation) { // Verify the same form element is still in the page // We wouldn't be allowed to read the attribute if the element is stale - Assert.NotEmpty(form.GetAttribute("action")); + Assert.NotEmpty(form.GetDomAttribute("action")); } } @@ -439,7 +439,7 @@ public void CanBreakFormIntoMultipleComponentsDisplaysErrorsCorrectly(bool suppr { // Verify the same form element is still in the page // We wouldn't be allowed to read the attribute if the element is stale - Assert.NotEmpty(form.GetAttribute("action")); + Assert.NotEmpty(form.GetDomAttribute("action")); } } @@ -477,7 +477,7 @@ public void CanDisplayBindingErrorsComplexTypeToDefaultForm(bool suppressEnhance { // Verify the same form element is still in the page // We wouldn't be allowed to read the attribute if the element is stale - Assert.NotEmpty(form.GetAttribute("action")); + Assert.NotEmpty(form.GetDomAttribute("action")); } } @@ -512,7 +512,7 @@ public void CanBindDictionaryToDefaultForm(bool suppressEnhancedNavigation) { // Verify the same form element is still in the page // We wouldn't be allowed to read the attribute if the element is stale - Assert.NotEmpty(form.GetAttribute("action")); + Assert.NotEmpty(form.GetDomAttribute("action")); } } @@ -551,7 +551,7 @@ public void CanDisplayBindingErrorsDictionaryToDefaultForm(bool suppressEnhanced { // Verify the same form element is still in the page // We wouldn't be allowed to read the attribute if the element is stale - Assert.NotEmpty(form.GetAttribute("action")); + Assert.NotEmpty(form.GetDomAttribute("action")); } } @@ -595,7 +595,7 @@ public void CanBindCollectionsToDefaultForm(bool suppressEnhancedNavigation) { // Verify the same form element is still in the page // We wouldn't be allowed to read the attribute if the element is stale - Assert.NotEmpty(form.GetAttribute("action")); + Assert.NotEmpty(form.GetDomAttribute("action")); } } @@ -644,7 +644,7 @@ public void CanDisplayBindingErrorsCollectionsToDefaultForm(bool suppressEnhance { // Verify the same form element is still in the page // We wouldn't be allowed to read the attribute if the element is stale - Assert.NotEmpty(form.GetAttribute("action")); + Assert.NotEmpty(form.GetDomAttribute("action")); } } @@ -670,7 +670,7 @@ public void CanHandleBindingErrorsBindParameterToNamedForm(bool suppressEnhanced { Assert.Equal("The value 'abc' is not valid for 'Parameter'.", error.Text); }); - Assert.Equal("abc", Browser.FindElement(By.CssSelector("input[name=Parameter]")).GetAttribute("value")); + Assert.Equal("abc", Browser.FindElement(By.CssSelector("input[name=Parameter]")).GetDomProperty("value")); } }; DispatchToFormCore(dispatchToForm); @@ -977,14 +977,14 @@ public void CanUsePlainForm(bool suppressEnhancedNavigation) Browser.Exists(By.Id("send")).Click(); Browser.Exists(By.Id("pass")); - Browser.Equal("StringViaExplicitPropertyName value", () => Browser.Exists(By.CssSelector("#StringViaExplicitPropertyName input")).GetAttribute("value")); - Browser.Equal("StringViaOverriddenName value", () => Browser.Exists(By.CssSelector("#StringViaOverriddenName input")).GetAttribute("value")); - Browser.Equal(/* should not match */ "", () => Browser.Exists(By.CssSelector("#StringViaOverriddenNameUnmatched input")).GetAttribute("value")); - Browser.Equal("StringViaExpression value", () => Browser.Exists(By.CssSelector("#StringViaExpression input")).GetAttribute("value")); - Browser.Equal("StringViaExpressionWithHandler value", () => Browser.Exists(By.CssSelector("#StringViaExpressionWithHandler input")).GetAttribute("value")); - Browser.Equal(/* should not match */ "", () => Browser.Exists(By.CssSelector("#StringViaExpressionWithUnmatchedHandler input")).GetAttribute("value")); - Browser.Equal("PersonName value", () => Browser.Exists(By.CssSelector("#PersonName input")).GetAttribute("value")); - Browser.Equal("123", () => Browser.Exists(By.CssSelector("#PersonAge input")).GetAttribute("value")); + Browser.Equal("StringViaExplicitPropertyName value", () => Browser.Exists(By.CssSelector("#StringViaExplicitPropertyName input")).GetDomProperty("value")); + Browser.Equal("StringViaOverriddenName value", () => Browser.Exists(By.CssSelector("#StringViaOverriddenName input")).GetDomProperty("value")); + Browser.Equal(/* should not match */ "", () => Browser.Exists(By.CssSelector("#StringViaOverriddenNameUnmatched input")).GetDomProperty("value")); + Browser.Equal("StringViaExpression value", () => Browser.Exists(By.CssSelector("#StringViaExpression input")).GetDomProperty("value")); + Browser.Equal("StringViaExpressionWithHandler value", () => Browser.Exists(By.CssSelector("#StringViaExpressionWithHandler input")).GetDomProperty("value")); + Browser.Equal(/* should not match */ "", () => Browser.Exists(By.CssSelector("#StringViaExpressionWithUnmatchedHandler input")).GetDomProperty("value")); + Browser.Equal("PersonName value", () => Browser.Exists(By.CssSelector("#PersonName input")).GetDomProperty("value")); + Browser.Equal("123", () => Browser.Exists(By.CssSelector("#PersonAge input")).GetDomProperty("value")); } [Fact] @@ -1159,15 +1159,15 @@ public void CanMutateDataSuppliedFromForm(bool suppressEnhancedNavigation) // Remember that the rendercount would be reset to zero since this is SSR, so // receiving 2 here shows we did render twice on this cycle Browser.Exists(By.Id("mutate-and-notify")).Click(); - Browser.Equal("Abc Modified", () => Browser.Exists(By.Id("simple-value")).GetAttribute("value")); - Browser.Equal("Def Modified", () => Browser.Exists(By.Id("complex-value")).GetAttribute("value")); + Browser.Equal("Abc Modified", () => Browser.Exists(By.Id("simple-value")).GetDomProperty("value")); + Browser.Equal("Def Modified", () => Browser.Exists(By.Id("complex-value")).GetDomProperty("value")); Browser.Equal("2", () => Browser.Exists(By.Id("render-count")).Text); Browser.Exists(By.Id("received-notification")); // Can perform a submit that replaces the received object entirely Browser.Exists(By.Id("clear-and-notify")).Click(); - Browser.Equal("", () => Browser.Exists(By.Id("simple-value")).GetAttribute("value")); - Browser.Equal("", () => Browser.Exists(By.Id("complex-value")).GetAttribute("value")); + Browser.Equal("", () => Browser.Exists(By.Id("simple-value")).GetDomProperty("value")); + Browser.Equal("", () => Browser.Exists(By.Id("complex-value")).GetDomProperty("value")); Browser.Equal("2", () => Browser.Exists(By.Id("render-count")).Text); Browser.Exists(By.Id("received-notification")); } @@ -1495,14 +1495,14 @@ public void EnhancedFormThatCallsNavigationManagerRefreshDoesNotPushHistoryEntry // Submit the form Browser.FindElement(By.Id("some-text")).SendKeys("test string"); - Browser.Equal("test string", () => Browser.FindElement(By.Id("some-text")).GetAttribute("value")); + Browser.Equal("test string", () => Browser.FindElement(By.Id("some-text")).GetDomProperty("value")); Browser.Exists(By.Id("submit-button")).Click(); // Wait for the async/streaming process to complete. We know this happened // if the loading indicator says we're done, and the textbox was cleared // due to the refresh Browser.Equal("False", () => Browser.FindElement(By.Id("loading-indicator")).Text); - Browser.Equal("", () => Browser.FindElement(By.Id("some-text")).GetAttribute("value")); + Browser.Equal("", () => Browser.FindElement(By.Id("some-text")).GetDomProperty("value")); // Checking that the history entry was not pushed Browser.Navigate().Back(); @@ -1532,7 +1532,7 @@ private void DispatchToFormCore(DispatchToForm dispatch) if (dispatch.ExpectedHandlerValue != null) { var handlerInput = form.FindElement(By.CssSelector("input[type=hidden][name=_handler]")); - Assert.Equal(dispatch.ExpectedHandlerValue, handlerInput.GetAttribute("value")); + Assert.Equal(dispatch.ExpectedHandlerValue, handlerInput.GetDomProperty("value")); } if (!dispatch.DispatchEvent) @@ -1598,7 +1598,7 @@ private void DispatchToFormCore(DispatchToForm dispatch) { // Verify the same form element is still in the page // We wouldn't be allowed to read the attribute if the element is stale - Assert.Equal("post", form.GetAttribute("method")); + Assert.Equal("post", form.GetDomAttribute("method"), ignoreCase: true); } } } diff --git a/src/Components/test/E2ETest/ServerRenderingTests/FormHandlingTests/NamedFormNoParentBindingContextTest.cs b/src/Components/test/E2ETest/ServerRenderingTests/FormHandlingTests/NamedFormNoParentBindingContextTest.cs index 0848a2793641..6034600f7e8b 100644 --- a/src/Components/test/E2ETest/ServerRenderingTests/FormHandlingTests/NamedFormNoParentBindingContextTest.cs +++ b/src/Components/test/E2ETest/ServerRenderingTests/FormHandlingTests/NamedFormNoParentBindingContextTest.cs @@ -32,7 +32,7 @@ public void CanDispatchToNamedFormNoParentBindingContext() Browser.Exists(By.Id("ready")); var form = Browser.Exists(By.CssSelector("form")); - Browser.Equal("named-form-handler", () => form.FindElement(By.CssSelector("input[name=_handler]")).GetAttribute("value")); + Browser.Equal("named-form-handler", () => form.FindElement(By.CssSelector("input[name=_handler]")).GetDomProperty("value")); Browser.Click(By.Id("send")); Browser.Exists(By.Id("pass")); diff --git a/src/Components/test/E2ETest/ServerRenderingTests/VirtualizationRenderModesTest.cs b/src/Components/test/E2ETest/ServerRenderingTests/VirtualizationRenderModesTest.cs index d080a7084a29..11218422ecf3 100644 --- a/src/Components/test/E2ETest/ServerRenderingTests/VirtualizationRenderModesTest.cs +++ b/src/Components/test/E2ETest/ServerRenderingTests/VirtualizationRenderModesTest.cs @@ -26,8 +26,8 @@ public void Virtualize_Works_WhenMultipleRenderModesAreActive() { Navigate($"{ServerPathBase}/interactivity/virtualization"); - Browser.Equal("interactive", () => Browser.FindElement(By.Id("virtualize-server")).GetAttribute("class")); - Browser.Equal("interactive", () => Browser.FindElement(By.Id("virtualize-webassembly")).GetAttribute("class")); + Browser.Equal("interactive", () => Browser.FindElement(By.Id("virtualize-server")).GetDomAttribute("class")); + Browser.Equal("interactive", () => Browser.FindElement(By.Id("virtualize-webassembly")).GetDomAttribute("class")); Browser.True(() => GetRenderedItems(Browser.FindElement(By.Id("virtualize-server"))).Contains("Item 1")); Browser.True(() => GetRenderedItems(Browser.FindElement(By.Id("virtualize-webassembly"))).Contains("Item 1")); diff --git a/src/Components/test/E2ETest/Tests/BindTest.cs b/src/Components/test/E2ETest/Tests/BindTest.cs index f64edb1b514e..f98a01a8ce35 100644 --- a/src/Components/test/E2ETest/Tests/BindTest.cs +++ b/src/Components/test/E2ETest/Tests/BindTest.cs @@ -38,23 +38,23 @@ public void CanBindTextbox_InitiallyBlank() var boundValue = Browser.Exists(By.Id("textbox-initially-blank-value")); var mirrorValue = Browser.Exists(By.Id("textbox-initially-blank-mirror")); var setNullButton = Browser.Exists(By.Id("textbox-initially-blank-setnull")); - Assert.Equal(string.Empty, target.GetAttribute("value")); + Assert.Equal(string.Empty, target.GetDomProperty("value")); Assert.Equal(string.Empty, boundValue.Text); - Assert.Equal(string.Empty, mirrorValue.GetAttribute("value")); + Assert.Equal(string.Empty, mirrorValue.GetDomProperty("value")); // Modify target; verify value is updated and that textboxes linked to the same data are updated target.SendKeys("Changed value"); Assert.Equal(string.Empty, boundValue.Text); // Doesn't update until change event - Assert.Equal(string.Empty, mirrorValue.GetAttribute("value")); + Assert.Equal(string.Empty, mirrorValue.GetDomProperty("value")); target.SendKeys("\t"); Browser.Equal("Changed value", () => boundValue.Text); - Assert.Equal("Changed value", mirrorValue.GetAttribute("value")); + Assert.Equal("Changed value", mirrorValue.GetDomProperty("value")); // Remove the value altogether setNullButton.Click(); - Browser.Equal(string.Empty, () => target.GetAttribute("value")); + Browser.Equal(string.Empty, () => target.GetDomProperty("value")); Assert.Equal(string.Empty, boundValue.Text); - Assert.Equal(string.Empty, mirrorValue.GetAttribute("value")); + Assert.Equal(string.Empty, mirrorValue.GetDomProperty("value")); } [Fact] @@ -64,21 +64,21 @@ public void CanBindTextbox_InitiallyPopulated() var boundValue = Browser.Exists(By.Id("textbox-initially-populated-value")); var mirrorValue = Browser.Exists(By.Id("textbox-initially-populated-mirror")); var setNullButton = Browser.Exists(By.Id("textbox-initially-populated-setnull")); - Assert.Equal("Hello", target.GetAttribute("value")); + Assert.Equal("Hello", target.GetDomProperty("value")); Assert.Equal("Hello", boundValue.Text); - Assert.Equal("Hello", mirrorValue.GetAttribute("value")); + Assert.Equal("Hello", mirrorValue.GetDomProperty("value")); // Modify target; verify value is updated and that textboxes linked to the same data are updated target.Clear(); target.SendKeys("Changed value\t"); Browser.Equal("Changed value", () => boundValue.Text); - Assert.Equal("Changed value", mirrorValue.GetAttribute("value")); + Assert.Equal("Changed value", mirrorValue.GetDomProperty("value")); // Remove the value altogether setNullButton.Click(); - Browser.Equal(string.Empty, () => target.GetAttribute("value")); + Browser.Equal(string.Empty, () => target.GetDomProperty("value")); Assert.Equal(string.Empty, boundValue.Text); - Assert.Equal(string.Empty, mirrorValue.GetAttribute("value")); + Assert.Equal(string.Empty, mirrorValue.GetDomProperty("value")); } [Fact] @@ -88,21 +88,21 @@ public void CanBindTextbox_WithBindSuffixInitiallyPopulated() var boundValue = Browser.Exists(By.Id("bind-with-suffix-textbox-initially-populated-value")); var mirrorValue = Browser.Exists(By.Id("bind-with-suffix-textbox-initially-populated-mirror")); var setNullButton = Browser.Exists(By.Id("bind-with-suffix-textbox-initially-populated-setnull")); - Assert.Equal("Hello", target.GetAttribute("value")); + Assert.Equal("Hello", target.GetDomProperty("value")); Assert.Equal("Hello", boundValue.Text); - Assert.Equal("Hello", mirrorValue.GetAttribute("value")); + Assert.Equal("Hello", mirrorValue.GetDomProperty("value")); // Modify target; verify value is updated and that textboxes linked to the same data are updated target.Clear(); target.SendKeys("Changed value\t"); Browser.Equal("Changed value", () => boundValue.Text); - Assert.Equal("Changed value", mirrorValue.GetAttribute("value")); + Assert.Equal("Changed value", mirrorValue.GetDomProperty("value")); // Remove the value altogether setNullButton.Click(); - Browser.Equal(string.Empty, () => target.GetAttribute("value")); + Browser.Equal(string.Empty, () => target.GetDomProperty("value")); Assert.Equal(string.Empty, boundValue.Text); - Assert.Equal(string.Empty, mirrorValue.GetAttribute("value")); + Assert.Equal(string.Empty, mirrorValue.GetDomProperty("value")); } [Fact] @@ -110,7 +110,7 @@ public void CanBindTextArea_InitiallyBlank() { var target = Browser.Exists(By.Id("textarea-initially-blank")); var boundValue = Browser.Exists(By.Id("textarea-initially-blank-value")); - Assert.Equal(string.Empty, target.GetAttribute("value")); + Assert.Equal(string.Empty, target.GetDomProperty("value")); Assert.Equal(string.Empty, boundValue.Text); // Modify target; verify value is updated @@ -125,7 +125,7 @@ public void CanBindTextArea_InitiallyPopulated() { var target = Browser.Exists(By.Id("textarea-initially-populated")); var boundValue = Browser.Exists(By.Id("textarea-initially-populated-value")); - Assert.Equal("Hello", target.GetAttribute("value")); + Assert.Equal("Hello", target.GetDomProperty("value")); Assert.Equal("Hello", boundValue.Text); // Modify target; verify value is updated @@ -249,24 +249,24 @@ public void CanBindTextboxInt() var target = Browser.Exists(By.Id("textbox-int")); var boundValue = Browser.Exists(By.Id("textbox-int-value")); var mirrorValue = Browser.Exists(By.Id("textbox-int-mirror")); - Assert.Equal("-42", target.GetAttribute("value")); + Assert.Equal("-42", target.GetDomProperty("value")); Assert.Equal("-42", boundValue.Text); - Assert.Equal("-42", mirrorValue.GetAttribute("value")); + Assert.Equal("-42", mirrorValue.GetDomProperty("value")); // Clear target; value resets to zero target.Clear(); - Browser.Equal("0", () => target.GetAttribute("value")); + Browser.Equal("0", () => target.GetDomProperty("value")); Assert.Equal("0", boundValue.Text); - Assert.Equal("0", mirrorValue.GetAttribute("value")); + Assert.Equal("0", mirrorValue.GetDomProperty("value")); // Modify target; verify value is updated and that textboxes linked to the same data are updated // Leading zeros are not preserved target.SendKeys("42"); - Browser.Equal("042", () => target.GetAttribute("value")); + Browser.Equal("042", () => target.GetDomProperty("value")); target.SendKeys("\t"); - Browser.Equal("42", () => target.GetAttribute("value")); + Browser.Equal("42", () => target.GetDomProperty("value")); Assert.Equal("42", boundValue.Text); - Assert.Equal("42", mirrorValue.GetAttribute("value")); + Assert.Equal("42", mirrorValue.GetDomProperty("value")); } [Fact] @@ -275,31 +275,31 @@ public void CanBindTextboxNullableInt() var target = Browser.Exists(By.Id("textbox-nullable-int")); var boundValue = Browser.Exists(By.Id("textbox-nullable-int-value")); var mirrorValue = Browser.Exists(By.Id("textbox-nullable-int-mirror")); - Assert.Equal(string.Empty, target.GetAttribute("value")); + Assert.Equal(string.Empty, target.GetDomProperty("value")); Assert.Equal(string.Empty, boundValue.Text); - Assert.Equal(string.Empty, mirrorValue.GetAttribute("value")); + Assert.Equal(string.Empty, mirrorValue.GetDomProperty("value")); // Modify target; verify value is updated and that textboxes linked to the same data are updated target.Clear(); Browser.Equal("", () => boundValue.Text); - Assert.Equal("", mirrorValue.GetAttribute("value")); + Assert.Equal("", mirrorValue.GetDomProperty("value")); // Modify target; verify value is updated and that textboxes linked to the same data are updated target.SendKeys("-42\t"); Browser.Equal("-42", () => boundValue.Text); - Assert.Equal("-42", mirrorValue.GetAttribute("value")); + Assert.Equal("-42", mirrorValue.GetDomProperty("value")); // Modify target; verify value is updated and that textboxes linked to the same data are updated target.Clear(); target.SendKeys("42\t"); Browser.Equal("42", () => boundValue.Text); - Assert.Equal("42", mirrorValue.GetAttribute("value")); + Assert.Equal("42", mirrorValue.GetDomProperty("value")); // Modify target; verify value is updated and that textboxes linked to the same data are updated target.Clear(); target.SendKeys("\t"); Browser.Equal(string.Empty, () => boundValue.Text); - Assert.Equal(string.Empty, mirrorValue.GetAttribute("value")); + Assert.Equal(string.Empty, mirrorValue.GetDomProperty("value")); } [Fact] @@ -308,22 +308,22 @@ public void CanBindTextboxLong() var target = Browser.Exists(By.Id("textbox-long")); var boundValue = Browser.Exists(By.Id("textbox-long-value")); var mirrorValue = Browser.Exists(By.Id("textbox-long-mirror")); - Assert.Equal("3000000000", target.GetAttribute("value")); + Assert.Equal("3000000000", target.GetDomProperty("value")); Assert.Equal("3000000000", boundValue.Text); - Assert.Equal("3000000000", mirrorValue.GetAttribute("value")); + Assert.Equal("3000000000", mirrorValue.GetDomProperty("value")); // Clear target; value resets to zero target.Clear(); - Browser.Equal("0", () => target.GetAttribute("value")); + Browser.Equal("0", () => target.GetDomProperty("value")); Assert.Equal("0", boundValue.Text); - Assert.Equal("0", mirrorValue.GetAttribute("value")); + Assert.Equal("0", mirrorValue.GetDomProperty("value")); // Modify target; verify value is updated and that textboxes linked to the same data are updated target.SendKeys(Keys.Backspace); target.SendKeys("-3000000000\t"); - Browser.Equal("-3000000000", () => target.GetAttribute("value")); + Browser.Equal("-3000000000", () => target.GetDomProperty("value")); Assert.Equal("-3000000000", boundValue.Text); - Assert.Equal("-3000000000", mirrorValue.GetAttribute("value")); + Assert.Equal("-3000000000", mirrorValue.GetDomProperty("value")); } [Fact] @@ -332,31 +332,31 @@ public void CanBindTextboxNullableLong() var target = Browser.Exists(By.Id("textbox-nullable-long")); var boundValue = Browser.Exists(By.Id("textbox-nullable-long-value")); var mirrorValue = Browser.Exists(By.Id("textbox-nullable-long-mirror")); - Assert.Equal(string.Empty, target.GetAttribute("value")); + Assert.Equal(string.Empty, target.GetDomProperty("value")); Assert.Equal(string.Empty, boundValue.Text); - Assert.Equal(string.Empty, mirrorValue.GetAttribute("value")); + Assert.Equal(string.Empty, mirrorValue.GetDomProperty("value")); // Modify target; verify value is updated and that textboxes linked to the same data are updated target.Clear(); Browser.Equal("", () => boundValue.Text); - Assert.Equal("", mirrorValue.GetAttribute("value")); + Assert.Equal("", mirrorValue.GetDomProperty("value")); // Modify target; verify value is updated and that textboxes linked to the same data are updated target.SendKeys("3000000000\t"); Browser.Equal("3000000000", () => boundValue.Text); - Assert.Equal("3000000000", mirrorValue.GetAttribute("value")); + Assert.Equal("3000000000", mirrorValue.GetDomProperty("value")); // Modify target; verify value is updated and that textboxes linked to the same data are updated target.Clear(); target.SendKeys("-3000000000\t"); Browser.Equal("-3000000000", () => boundValue.Text); - Assert.Equal("-3000000000", mirrorValue.GetAttribute("value")); + Assert.Equal("-3000000000", mirrorValue.GetDomProperty("value")); // Modify target; verify value is updated and that textboxes linked to the same data are updated target.Clear(); target.SendKeys("\t"); Browser.Equal(string.Empty, () => boundValue.Text); - Assert.Equal(string.Empty, mirrorValue.GetAttribute("value")); + Assert.Equal(string.Empty, mirrorValue.GetDomProperty("value")); } [Fact] @@ -365,24 +365,24 @@ public void CanBindTextboxShort() var target = Browser.Exists(By.Id("textbox-short")); var boundValue = Browser.Exists(By.Id("textbox-short-value")); var mirrorValue = Browser.Exists(By.Id("textbox-short-mirror")); - Assert.Equal("-42", target.GetAttribute("value")); + Assert.Equal("-42", target.GetDomProperty("value")); Assert.Equal("-42", boundValue.Text); - Assert.Equal("-42", mirrorValue.GetAttribute("value")); + Assert.Equal("-42", mirrorValue.GetDomProperty("value")); // Clear target; value resets to zero target.Clear(); - Browser.Equal("0", () => target.GetAttribute("value")); + Browser.Equal("0", () => target.GetDomProperty("value")); Assert.Equal("0", boundValue.Text); - Assert.Equal("0", mirrorValue.GetAttribute("value")); + Assert.Equal("0", mirrorValue.GetDomProperty("value")); // Modify target; verify value is updated and that textboxes linked to the same data are updated // Leading zeros are not preserved target.SendKeys("42"); - Browser.Equal("042", () => target.GetAttribute("value")); + Browser.Equal("042", () => target.GetDomProperty("value")); target.SendKeys("\t"); - Browser.Equal("42", () => target.GetAttribute("value")); + Browser.Equal("42", () => target.GetDomProperty("value")); Assert.Equal("42", boundValue.Text); - Assert.Equal("42", mirrorValue.GetAttribute("value")); + Assert.Equal("42", mirrorValue.GetDomProperty("value")); } [Fact] @@ -391,31 +391,31 @@ public void CanBindTextboxNullableShort() var target = Browser.Exists(By.Id("textbox-nullable-short")); var boundValue = Browser.Exists(By.Id("textbox-nullable-short-value")); var mirrorValue = Browser.Exists(By.Id("textbox-nullable-short-mirror")); - Assert.Equal(string.Empty, target.GetAttribute("value")); + Assert.Equal(string.Empty, target.GetDomProperty("value")); Assert.Equal(string.Empty, boundValue.Text); - Assert.Equal(string.Empty, mirrorValue.GetAttribute("value")); + Assert.Equal(string.Empty, mirrorValue.GetDomProperty("value")); // Modify target; verify value is updated and that textboxes linked to the same data are updated target.Clear(); Browser.Equal("", () => boundValue.Text); - Assert.Equal("", mirrorValue.GetAttribute("value")); + Assert.Equal("", mirrorValue.GetDomProperty("value")); // Modify target; verify value is updated and that textboxes linked to the same data are updated target.SendKeys("-42\t"); Browser.Equal("-42", () => boundValue.Text); - Browser.Equal("-42", () => mirrorValue.GetAttribute("value")); + Browser.Equal("-42", () => mirrorValue.GetDomProperty("value")); // Modify target; verify value is updated and that textboxes linked to the same data are updated target.Clear(); target.SendKeys("42\t"); Browser.Equal("42", () => boundValue.Text); - Browser.Equal("42", () => mirrorValue.GetAttribute("value")); + Browser.Equal("42", () => mirrorValue.GetDomProperty("value")); // Modify target; verify value is updated and that textboxes linked to the same data are updated target.Clear(); target.SendKeys("\t"); Browser.Equal(string.Empty, () => boundValue.Text); - Assert.Equal(string.Empty, mirrorValue.GetAttribute("value")); + Assert.Equal(string.Empty, mirrorValue.GetDomProperty("value")); } [Fact] @@ -424,22 +424,22 @@ public void CanBindTextboxFloat() var target = Browser.Exists(By.Id("textbox-float")); var boundValue = Browser.Exists(By.Id("textbox-float-value")); var mirrorValue = Browser.Exists(By.Id("textbox-float-mirror")); - Assert.Equal("3.141", target.GetAttribute("value")); + Assert.Equal("3.141", target.GetDomProperty("value")); Assert.Equal("3.141", boundValue.Text); - Assert.Equal("3.141", mirrorValue.GetAttribute("value")); + Assert.Equal("3.141", mirrorValue.GetDomProperty("value")); // Clear target; value resets to zero target.Clear(); - Browser.Equal("0", () => target.GetAttribute("value")); + Browser.Equal("0", () => target.GetDomProperty("value")); Assert.Equal("0", boundValue.Text); - Assert.Equal("0", mirrorValue.GetAttribute("value")); + Assert.Equal("0", mirrorValue.GetDomProperty("value")); // Modify target; verify value is updated and that textboxes linked to the same data are updated target.SendKeys(Keys.Backspace); target.SendKeys("-3.141\t"); - Browser.Equal("-3.141", () => target.GetAttribute("value")); + Browser.Equal("-3.141", () => target.GetDomProperty("value")); Browser.Equal("-3.141", () => boundValue.Text); - Browser.Equal("-3.141", () => mirrorValue.GetAttribute("value")); + Browser.Equal("-3.141", () => mirrorValue.GetDomProperty("value")); } [Fact] @@ -448,31 +448,31 @@ public void CanBindTextboxNullableFloat() var target = Browser.Exists(By.Id("textbox-nullable-float")); var boundValue = Browser.Exists(By.Id("textbox-nullable-float-value")); var mirrorValue = Browser.Exists(By.Id("textbox-nullable-float-mirror")); - Assert.Equal(string.Empty, target.GetAttribute("value")); + Assert.Equal(string.Empty, target.GetDomProperty("value")); Assert.Equal(string.Empty, boundValue.Text); - Assert.Equal(string.Empty, mirrorValue.GetAttribute("value")); + Assert.Equal(string.Empty, mirrorValue.GetDomProperty("value")); // Modify target; verify value is updated and that textboxes linked to the same data are updated target.Clear(); Browser.Equal("", () => boundValue.Text); - Assert.Equal("", mirrorValue.GetAttribute("value")); + Assert.Equal("", mirrorValue.GetDomProperty("value")); // Modify target; verify value is updated and that textboxes linked to the same data are updated target.SendKeys("3.141\t"); Browser.Equal("3.141", () => boundValue.Text); - Assert.Equal("3.141", mirrorValue.GetAttribute("value")); + Assert.Equal("3.141", mirrorValue.GetDomProperty("value")); // Modify target; verify value is updated and that textboxes linked to the same data are updated target.Clear(); target.SendKeys("-3.141\t"); Browser.Equal("-3.141", () => boundValue.Text); - Assert.Equal("-3.141", mirrorValue.GetAttribute("value")); + Assert.Equal("-3.141", mirrorValue.GetDomProperty("value")); // Modify target; verify value is updated and that textboxes linked to the same data are updated target.Clear(); target.SendKeys("\t"); Browser.Equal(string.Empty, () => boundValue.Text); - Assert.Equal(string.Empty, mirrorValue.GetAttribute("value")); + Assert.Equal(string.Empty, mirrorValue.GetDomProperty("value")); } [Fact] @@ -481,30 +481,30 @@ public void CanBindTextboxDouble() var target = Browser.Exists(By.Id("textbox-double")); var boundValue = Browser.Exists(By.Id("textbox-double-value")); var mirrorValue = Browser.Exists(By.Id("textbox-double-mirror")); - Assert.Equal("3.14159265359", target.GetAttribute("value")); + Assert.Equal("3.14159265359", target.GetDomProperty("value")); Assert.Equal("3.14159265359", boundValue.Text); - Assert.Equal("3.14159265359", mirrorValue.GetAttribute("value")); + Assert.Equal("3.14159265359", mirrorValue.GetDomProperty("value")); // Clear target; value resets to default target.Clear(); - Browser.Equal("0", () => target.GetAttribute("value")); + Browser.Equal("0", () => target.GetDomProperty("value")); Assert.Equal("0", boundValue.Text); - Assert.Equal("0", mirrorValue.GetAttribute("value")); + Assert.Equal("0", mirrorValue.GetDomProperty("value")); // Modify target; verify value is updated and that textboxes linked to the same data are updated target.SendKeys(Keys.Backspace); target.SendKeys("-3.14159265359\t"); Browser.Equal("-3.14159265359", () => boundValue.Text); - Assert.Equal("-3.14159265359", mirrorValue.GetAttribute("value")); + Assert.Equal("-3.14159265359", mirrorValue.GetDomProperty("value")); // Modify target; verify value is updated and that textboxes linked to the same data are updated // Double shouldn't preserve trailing zeros target.Clear(); target.SendKeys(Keys.Backspace); target.SendKeys("0.010\t"); - Browser.Equal("0.01", () => target.GetAttribute("value")); + Browser.Equal("0.01", () => target.GetDomProperty("value")); Assert.Equal("0.01", boundValue.Text); - Assert.Equal("0.01", mirrorValue.GetAttribute("value")); + Assert.Equal("0.01", mirrorValue.GetDomProperty("value")); } [Fact] @@ -513,38 +513,38 @@ public void CanBindTextboxNullableDouble() var target = Browser.Exists(By.Id("textbox-nullable-double")); var boundValue = Browser.Exists(By.Id("textbox-nullable-double-value")); var mirrorValue = Browser.Exists(By.Id("textbox-nullable-double-mirror")); - Assert.Equal(string.Empty, target.GetAttribute("value")); + Assert.Equal(string.Empty, target.GetDomProperty("value")); Assert.Equal(string.Empty, boundValue.Text); - Assert.Equal(string.Empty, mirrorValue.GetAttribute("value")); + Assert.Equal(string.Empty, mirrorValue.GetDomProperty("value")); // Modify target; verify value is updated and that textboxes linked to the same data are updated target.Clear(); Browser.Equal("", () => boundValue.Text); - Assert.Equal("", mirrorValue.GetAttribute("value")); + Assert.Equal("", mirrorValue.GetDomProperty("value")); // Modify target; verify value is updated and that textboxes linked to the same data are updated target.SendKeys("3.14159265359\t"); Browser.Equal("3.14159265359", () => boundValue.Text); - Assert.Equal("3.14159265359", mirrorValue.GetAttribute("value")); + Assert.Equal("3.14159265359", mirrorValue.GetDomProperty("value")); // Modify target; verify value is updated and that textboxes linked to the same data are updated target.Clear(); target.SendKeys("-3.14159265359\t"); Browser.Equal("-3.14159265359", () => boundValue.Text); - Assert.Equal("-3.14159265359", mirrorValue.GetAttribute("value")); + Assert.Equal("-3.14159265359", mirrorValue.GetDomProperty("value")); // Modify target; verify value is updated and that textboxes linked to the same data are updated // Double shouldn't preserve trailing zeros target.Clear(); target.SendKeys("0.010\t"); Browser.Equal("0.01", () => boundValue.Text); - Assert.Equal("0.01", mirrorValue.GetAttribute("value")); + Assert.Equal("0.01", mirrorValue.GetDomProperty("value")); // Modify target; verify value is updated and that textboxes linked to the same data are updated target.Clear(); target.SendKeys("\t"); Browser.Equal(string.Empty, () => boundValue.Text); - Assert.Equal(string.Empty, mirrorValue.GetAttribute("value")); + Assert.Equal(string.Empty, mirrorValue.GetDomProperty("value")); } [Fact] @@ -553,21 +553,21 @@ public void CanBindTextboxDecimal() var target = Browser.Exists(By.Id("textbox-decimal")); var boundValue = Browser.Exists(By.Id("textbox-decimal-value")); var mirrorValue = Browser.Exists(By.Id("textbox-decimal-mirror")); - Assert.Equal("0.0000000000000000000000000001", target.GetAttribute("value")); + Assert.Equal("0.0000000000000000000000000001", target.GetDomProperty("value")); Assert.Equal("0.0000000000000000000000000001", boundValue.Text); - Assert.Equal("0.0000000000000000000000000001", mirrorValue.GetAttribute("value")); + Assert.Equal("0.0000000000000000000000000001", mirrorValue.GetDomProperty("value")); // Clear textbox; value updates to zero because that's the default target.Clear(); - Browser.Equal("0", () => target.GetAttribute("value")); + Browser.Equal("0", () => target.GetDomProperty("value")); Assert.Equal("0", boundValue.Text); - Assert.Equal("0", mirrorValue.GetAttribute("value")); + Assert.Equal("0", mirrorValue.GetDomProperty("value")); // Modify target; verify value is updated and that textboxes linked to the same data are updated // Decimal should preserve trailing zeros target.SendKeys("0.010\t"); Browser.Equal("0.010", () => boundValue.Text); - Assert.Equal("0.010", mirrorValue.GetAttribute("value")); + Assert.Equal("0.010", mirrorValue.GetDomProperty("value")); } [Fact] @@ -576,32 +576,32 @@ public void CanBindTextboxNullableDecimal() var target = Browser.Exists(By.Id("textbox-nullable-decimal")); var boundValue = Browser.Exists(By.Id("textbox-nullable-decimal-value")); var mirrorValue = Browser.Exists(By.Id("textbox-nullable-decimal-mirror")); - Assert.Equal(string.Empty, target.GetAttribute("value")); + Assert.Equal(string.Empty, target.GetDomProperty("value")); Assert.Equal(string.Empty, boundValue.Text); - Assert.Equal(string.Empty, mirrorValue.GetAttribute("value")); + Assert.Equal(string.Empty, mirrorValue.GetDomProperty("value")); // Modify target; verify value is updated and that textboxes linked to the same data are updated target.Clear(); Browser.Equal("", () => boundValue.Text); - Assert.Equal("", mirrorValue.GetAttribute("value")); + Assert.Equal("", mirrorValue.GetDomProperty("value")); // Modify target; verify value is updated and that textboxes linked to the same data are updated target.SendKeys("0.0000000000000000000000000001\t"); Browser.Equal("0.0000000000000000000000000001", () => boundValue.Text); - Assert.Equal("0.0000000000000000000000000001", mirrorValue.GetAttribute("value")); + Assert.Equal("0.0000000000000000000000000001", mirrorValue.GetDomProperty("value")); // Modify target; verify value is updated and that textboxes linked to the same data are updated // Decimal should preserve trailing zeros target.Clear(); target.SendKeys("0.010\t"); Browser.Equal("0.010", () => boundValue.Text); - Browser.Equal("0.010", () => mirrorValue.GetAttribute("value")); + Browser.Equal("0.010", () => mirrorValue.GetDomProperty("value")); // Modify target; verify value is updated and that textboxes linked to the same data are updated target.Clear(); target.SendKeys("\t"); Browser.Equal(string.Empty, () => boundValue.Text); - Assert.Equal(string.Empty, mirrorValue.GetAttribute("value")); + Assert.Equal(string.Empty, mirrorValue.GetDomProperty("value")); } // This tests what happens you put invalid (unconvertable) input in. This is separate from the @@ -612,30 +612,30 @@ public void CanBindTextbox_Decimal_InvalidInput() var target = Browser.Exists(By.Id("textbox-decimal-invalid")); var boundValue = Browser.Exists(By.Id("textbox-decimal-invalid-value")); var mirrorValue = Browser.Exists(By.Id("textbox-decimal-invalid-mirror")); - Assert.Equal("0.0000000000000000000000000001", target.GetAttribute("value")); + Assert.Equal("0.0000000000000000000000000001", target.GetDomProperty("value")); Assert.Equal("0.0000000000000000000000000001", boundValue.Text); - Assert.Equal("0.0000000000000000000000000001", mirrorValue.GetAttribute("value")); + Assert.Equal("0.0000000000000000000000000001", mirrorValue.GetDomProperty("value")); // Modify target; verify value is updated and that textboxes linked to the same data are updated target.Clear(); target.SendKeys("0.01\t"); Browser.Equal("0.01", () => boundValue.Text); - Assert.Equal("0.01", mirrorValue.GetAttribute("value")); + Assert.Equal("0.01", mirrorValue.GetDomProperty("value")); // Modify target to something invalid - the invalid change is reverted // back to the last valid value target.SendKeys("2A"); - Assert.Equal("0.012A", target.GetAttribute("value")); + Assert.Equal("0.012A", target.GetDomProperty("value")); target.SendKeys("\t"); Browser.Equal("0.01", () => boundValue.Text); - Browser.Equal("0.01", () => mirrorValue.GetAttribute("value")); - Browser.Equal("0.01", () => target.GetAttribute("value")); + Browser.Equal("0.01", () => mirrorValue.GetDomProperty("value")); + Browser.Equal("0.01", () => target.GetDomProperty("value")); // Continue editing with valid inputs target.SendKeys(Keys.Backspace); target.SendKeys("2\t"); Browser.Equal("0.02", () => boundValue.Text); - Browser.Equal("0.02", () => mirrorValue.GetAttribute("value")); + Browser.Equal("0.02", () => mirrorValue.GetDomProperty("value")); } // This tests what happens you put invalid (unconvertable) input in. This is separate from the @@ -646,30 +646,30 @@ public void CanBindTextbox_NullableDecimal_InvalidInput() var target = Browser.Exists(By.Id("textbox-nullable-decimal-invalid")); var boundValue = Browser.Exists(By.Id("textbox-nullable-decimal-invalid-value")); var mirrorValue = Browser.Exists(By.Id("textbox-nullable-decimal-invalid-mirror")); - Assert.Equal(string.Empty, target.GetAttribute("value")); + Assert.Equal(string.Empty, target.GetDomProperty("value")); Assert.Equal(string.Empty, boundValue.Text); - Assert.Equal(string.Empty, mirrorValue.GetAttribute("value")); + Assert.Equal(string.Empty, mirrorValue.GetDomProperty("value")); // Modify target; verify value is updated and that textboxes linked to the same data are updated target.Clear(); target.SendKeys("0.01\t"); Browser.Equal("0.01", () => boundValue.Text); - Assert.Equal("0.01", mirrorValue.GetAttribute("value")); + Assert.Equal("0.01", mirrorValue.GetDomProperty("value")); // Modify target to something invalid - the invalid change is reverted // back to the last valid value target.SendKeys("2A"); - Assert.Equal("0.012A", target.GetAttribute("value")); + Assert.Equal("0.012A", target.GetDomProperty("value")); target.SendKeys("\t"); Browser.Equal("0.01", () => boundValue.Text); - Assert.Equal("0.01", mirrorValue.GetAttribute("value")); - Assert.Equal("0.01", target.GetAttribute("value")); + Assert.Equal("0.01", mirrorValue.GetDomProperty("value")); + Assert.Equal("0.01", target.GetDomProperty("value")); // Continue editing with valid inputs target.SendKeys(Keys.Backspace); target.SendKeys("2\t"); Browser.Equal("0.02", () => boundValue.Text); - Assert.Equal("0.02", mirrorValue.GetAttribute("value")); + Assert.Equal("0.02", mirrorValue.GetDomProperty("value")); } [Fact] @@ -678,20 +678,20 @@ public void CanBindTextboxGenericInt() var target = Browser.Exists(By.Id("textbox-generic-int")); var boundValue = Browser.Exists(By.Id("textbox-generic-int-value")); var mirrorValue = Browser.Exists(By.Id("textbox-generic-int-mirror")); - Assert.Equal("-42", target.GetAttribute("value")); + Assert.Equal("-42", target.GetDomProperty("value")); Assert.Equal("-42", boundValue.Text); - Assert.Equal("-42", mirrorValue.GetAttribute("value")); + Assert.Equal("-42", mirrorValue.GetDomProperty("value")); // Clear target; value resets to zero target.Clear(); - Browser.Equal("0", () => target.GetAttribute("value")); + Browser.Equal("0", () => target.GetDomProperty("value")); Assert.Equal("0", boundValue.Text); - Assert.Equal("0", mirrorValue.GetAttribute("value")); + Assert.Equal("0", mirrorValue.GetDomProperty("value")); // Modify target; verify value is updated and that textboxes linked to the same data are updated target.SendKeys("42\t"); Browser.Equal("42", () => boundValue.Text); - Assert.Equal("42", mirrorValue.GetAttribute("value")); + Assert.Equal("42", mirrorValue.GetDomProperty("value")); } [Fact] @@ -700,20 +700,20 @@ public void CanBindTextboxGenericGuid() var target = Browser.Exists(By.Id("textbox-generic-guid")); var boundValue = Browser.Exists(By.Id("textbox-generic-guid-value")); var mirrorValue = Browser.Exists(By.Id("textbox-generic-guid-mirror")); - Assert.Equal("00000000-0000-0000-0000-000000000000", target.GetAttribute("value")); + Assert.Equal("00000000-0000-0000-0000-000000000000", target.GetDomProperty("value")); Assert.Equal("00000000-0000-0000-0000-000000000000", boundValue.Text); - Assert.Equal("00000000-0000-0000-0000-000000000000", mirrorValue.GetAttribute("value")); + Assert.Equal("00000000-0000-0000-0000-000000000000", mirrorValue.GetDomProperty("value")); // Modify target; value is not updated because it's not convertable. target.Clear(); Browser.Equal("00000000-0000-0000-0000-000000000000", () => boundValue.Text); - Assert.Equal("00000000-0000-0000-0000-000000000000", mirrorValue.GetAttribute("value")); + Assert.Equal("00000000-0000-0000-0000-000000000000", mirrorValue.GetDomProperty("value")); // Modify target; verify value is updated and that textboxes linked to the same data are updated var newValue = Guid.NewGuid().ToString(); target.SendKeys(newValue + "\t"); Browser.Equal(newValue, () => boundValue.Text); - Assert.Equal(newValue, mirrorValue.GetAttribute("value")); + Assert.Equal(newValue, mirrorValue.GetDomProperty("value")); } // For date comparisons, we parse (non-formatted) values to compare them. Client-side and server-side @@ -725,23 +725,23 @@ public void CanBindTextboxDateTime() var boundValue = Browser.Exists(By.Id("textbox-datetime-value")); var mirrorValue = Browser.Exists(By.Id("textbox-datetime-mirror")); var expected = new DateTime(1985, 3, 4); - Assert.Equal(expected, DateTime.Parse(target.GetAttribute("value"), CultureInfo.InvariantCulture)); + Assert.Equal(expected, DateTime.Parse(target.GetDomProperty("value"), CultureInfo.InvariantCulture)); Assert.Equal(expected, DateTime.Parse(boundValue.Text, CultureInfo.InvariantCulture)); - Assert.Equal(expected, DateTime.Parse(mirrorValue.GetAttribute("value"), CultureInfo.InvariantCulture)); + Assert.Equal(expected, DateTime.Parse(mirrorValue.GetDomProperty("value"), CultureInfo.InvariantCulture)); // Clear textbox; value updates to 01/01/0001 because that's the default target.Clear(); expected = default; - Browser.Equal(expected, () => DateTime.Parse(target.GetAttribute("value"), CultureInfo.InvariantCulture)); + Browser.Equal(expected, () => DateTime.Parse(target.GetDomProperty("value"), CultureInfo.InvariantCulture)); Assert.Equal(expected, DateTime.Parse(boundValue.Text, CultureInfo.InvariantCulture)); - Assert.Equal(expected, DateTime.Parse(mirrorValue.GetAttribute("value"), CultureInfo.InvariantCulture)); + Assert.Equal(expected, DateTime.Parse(mirrorValue.GetDomProperty("value"), CultureInfo.InvariantCulture)); // Modify target; verify value is updated and that textboxes linked to the same data are updated target.SendKeys(Keys.Control + "a"); // select all target.SendKeys("01/02/2000 00:00:00\t"); expected = new DateTime(2000, 1, 2); Browser.Equal(expected, () => DateTime.Parse(boundValue.Text, CultureInfo.InvariantCulture)); - Assert.Equal(expected, DateTime.Parse(mirrorValue.GetAttribute("value"), CultureInfo.InvariantCulture)); + Assert.Equal(expected, DateTime.Parse(mirrorValue.GetDomProperty("value"), CultureInfo.InvariantCulture)); } // For date comparisons, we parse (non-formatted) values to compare them. Client-side and server-side @@ -752,26 +752,26 @@ public void CanBindTextboxNullableDateTime() var target = Browser.Exists(By.Id("textbox-nullable-datetime")); var boundValue = Browser.Exists(By.Id("textbox-nullable-datetime-value")); var mirrorValue = Browser.Exists(By.Id("textbox-nullable-datetime-mirror")); - Assert.Equal(string.Empty, target.GetAttribute("value")); + Assert.Equal(string.Empty, target.GetDomProperty("value")); Assert.Equal(string.Empty, boundValue.Text); - Assert.Equal(string.Empty, mirrorValue.GetAttribute("value")); + Assert.Equal(string.Empty, mirrorValue.GetDomProperty("value")); // Modify target; verify value is updated and that textboxes linked to the same data are updated target.Clear(); Browser.Equal("", () => boundValue.Text); - Assert.Equal("", mirrorValue.GetAttribute("value")); + Assert.Equal("", mirrorValue.GetDomProperty("value")); // Modify target; verify value is updated and that textboxes linked to the same data are updated var expected = new DateTime(2000, 1, 2); target.SendKeys("01/02/2000 00:00:00\t"); Browser.Equal(expected, () => DateTime.Parse(boundValue.Text, CultureInfo.InvariantCulture)); - Assert.Equal(expected, DateTime.Parse(mirrorValue.GetAttribute("value"), CultureInfo.InvariantCulture)); + Assert.Equal(expected, DateTime.Parse(mirrorValue.GetDomProperty("value"), CultureInfo.InvariantCulture)); // Modify target; verify value is updated and that textboxes linked to the same data are updated target.Clear(); target.SendKeys("\t"); Browser.Equal(string.Empty, () => boundValue.Text); - Assert.Equal(string.Empty, mirrorValue.GetAttribute("value")); + Assert.Equal(string.Empty, mirrorValue.GetDomProperty("value")); } // For date comparisons, we parse (non-formatted) values to compare them. Client-side and server-side @@ -783,23 +783,23 @@ public void CanBindTextboxDateTimeOffset() var boundValue = Browser.Exists(By.Id("textbox-datetimeoffset-value")); var mirrorValue = Browser.Exists(By.Id("textbox-datetimeoffset-mirror")); var expected = new DateTimeOffset(new DateTime(1985, 3, 4), TimeSpan.FromHours(8)); - Assert.Equal(expected, DateTimeOffset.Parse(target.GetAttribute("value"), CultureInfo.InvariantCulture)); + Assert.Equal(expected, DateTimeOffset.Parse(target.GetDomProperty("value"), CultureInfo.InvariantCulture)); Assert.Equal(expected, DateTimeOffset.Parse(boundValue.Text, CultureInfo.InvariantCulture)); - Assert.Equal(expected, DateTimeOffset.Parse(mirrorValue.GetAttribute("value"), CultureInfo.InvariantCulture)); + Assert.Equal(expected, DateTimeOffset.Parse(mirrorValue.GetDomProperty("value"), CultureInfo.InvariantCulture)); // Clear textbox; value updates to 01/01/0001 because that's the default target.Clear(); expected = default; - Browser.Equal(expected, () => DateTimeOffset.Parse(target.GetAttribute("value"), CultureInfo.InvariantCulture)); + Browser.Equal(expected, () => DateTimeOffset.Parse(target.GetDomProperty("value"), CultureInfo.InvariantCulture)); Assert.Equal(expected, DateTimeOffset.Parse(boundValue.Text, CultureInfo.InvariantCulture)); - Assert.Equal(expected, DateTimeOffset.Parse(mirrorValue.GetAttribute("value"), CultureInfo.InvariantCulture)); + Assert.Equal(expected, DateTimeOffset.Parse(mirrorValue.GetDomProperty("value"), CultureInfo.InvariantCulture)); // Modify target; verify value is updated and that textboxes linked to the same data are updated target.SendKeys(Keys.Control + "a"); // select all target.SendKeys("01/02/2000 00:00:00 +08:00\t"); expected = new DateTimeOffset(new DateTime(2000, 1, 2), TimeSpan.FromHours(8)); Browser.Equal(expected, () => DateTimeOffset.Parse(boundValue.Text, CultureInfo.InvariantCulture)); - Assert.Equal(expected, DateTimeOffset.Parse(mirrorValue.GetAttribute("value"), CultureInfo.InvariantCulture)); + Assert.Equal(expected, DateTimeOffset.Parse(mirrorValue.GetDomProperty("value"), CultureInfo.InvariantCulture)); } // For date comparisons, we parse (non-formatted) values to compare them. Client-side and server-side @@ -810,26 +810,26 @@ public void CanBindTextboxNullableDateTimeOffset() var target = Browser.Exists(By.Id("textbox-nullable-datetimeoffset")); var boundValue = Browser.Exists(By.Id("textbox-nullable-datetimeoffset-value")); var mirrorValue = Browser.Exists(By.Id("textbox-nullable-datetimeoffset-mirror")); - Assert.Equal(string.Empty, target.GetAttribute("value")); + Assert.Equal(string.Empty, target.GetDomProperty("value")); Assert.Equal(string.Empty, boundValue.Text); - Assert.Equal(string.Empty, mirrorValue.GetAttribute("value")); + Assert.Equal(string.Empty, mirrorValue.GetDomProperty("value")); // Modify target; verify value is updated and that textboxes linked to the same data are updated target.Clear(); Browser.Equal("", () => boundValue.Text); - Assert.Equal("", mirrorValue.GetAttribute("value")); + Assert.Equal("", mirrorValue.GetDomProperty("value")); // Modify target; verify value is updated and that textboxes linked to the same data are updated target.SendKeys("01/02/2000 00:00:00 +08:00" + "\t"); var expected = new DateTimeOffset(new DateTime(2000, 1, 2), TimeSpan.FromHours(8)); Browser.Equal(expected, () => DateTimeOffset.Parse(boundValue.Text, CultureInfo.InvariantCulture)); - Assert.Equal(expected, DateTimeOffset.Parse(mirrorValue.GetAttribute("value"), CultureInfo.InvariantCulture)); + Assert.Equal(expected, DateTimeOffset.Parse(mirrorValue.GetDomProperty("value"), CultureInfo.InvariantCulture)); // Modify target; verify value is updated and that textboxes linked to the same data are updated target.Clear(); target.SendKeys("\t"); Browser.Equal(string.Empty, () => boundValue.Text); - Assert.Equal(string.Empty, mirrorValue.GetAttribute("value")); + Assert.Equal(string.Empty, mirrorValue.GetDomProperty("value")); } // For date comparisons, we parse (non-formatted) values to compare them. Client-side and server-side @@ -841,23 +841,23 @@ public void CanBindTextboxDateOnly() var boundValue = Browser.Exists(By.Id("textbox-dateonly-value")); var mirrorValue = Browser.Exists(By.Id("textbox-dateonly-mirror")); var expected = new DateOnly(1985, 3, 4); - Assert.Equal(expected, DateOnly.Parse(target.GetAttribute("value"), CultureInfo.InvariantCulture)); + Assert.Equal(expected, DateOnly.Parse(target.GetDomProperty("value"), CultureInfo.InvariantCulture)); Assert.Equal(expected, DateOnly.Parse(boundValue.Text, CultureInfo.InvariantCulture)); - Assert.Equal(expected, DateOnly.Parse(mirrorValue.GetAttribute("value"), CultureInfo.InvariantCulture)); + Assert.Equal(expected, DateOnly.Parse(mirrorValue.GetDomProperty("value"), CultureInfo.InvariantCulture)); // Clear textbox; value updates to 01/01/0001 because that's the default target.Clear(); expected = default; - Browser.Equal(expected, () => DateOnly.Parse(target.GetAttribute("value"), CultureInfo.InvariantCulture)); + Browser.Equal(expected, () => DateOnly.Parse(target.GetDomProperty("value"), CultureInfo.InvariantCulture)); Assert.Equal(expected, DateOnly.Parse(boundValue.Text, CultureInfo.InvariantCulture)); - Assert.Equal(expected, DateOnly.Parse(mirrorValue.GetAttribute("value"), CultureInfo.InvariantCulture)); + Assert.Equal(expected, DateOnly.Parse(mirrorValue.GetDomProperty("value"), CultureInfo.InvariantCulture)); // Modify target; verify value is updated and that textboxes linked to the same data are updated target.SendKeys(Keys.Control + "a"); // select all target.SendKeys("01/02/2000\t"); expected = new DateOnly(2000, 1, 2); Browser.Equal(expected, () => DateOnly.Parse(boundValue.Text, CultureInfo.InvariantCulture)); - Assert.Equal(expected, DateOnly.Parse(mirrorValue.GetAttribute("value"), CultureInfo.InvariantCulture)); + Assert.Equal(expected, DateOnly.Parse(mirrorValue.GetDomProperty("value"), CultureInfo.InvariantCulture)); } // For date comparisons, we parse (non-formatted) values to compare them. Client-side and server-side @@ -868,26 +868,26 @@ public void CanBindTextboxNullableDateOnly() var target = Browser.Exists(By.Id("textbox-nullable-dateonly")); var boundValue = Browser.Exists(By.Id("textbox-nullable-dateonly-value")); var mirrorValue = Browser.Exists(By.Id("textbox-nullable-dateonly-mirror")); - Assert.Equal(string.Empty, target.GetAttribute("value")); + Assert.Equal(string.Empty, target.GetDomProperty("value")); Assert.Equal(string.Empty, boundValue.Text); - Assert.Equal(string.Empty, mirrorValue.GetAttribute("value")); + Assert.Equal(string.Empty, mirrorValue.GetDomProperty("value")); // Modify target; verify value is updated and that textboxes linked to the same data are updated target.Clear(); Browser.Equal("", () => boundValue.Text); - Assert.Equal("", mirrorValue.GetAttribute("value")); + Assert.Equal("", mirrorValue.GetDomProperty("value")); // Modify target; verify value is updated and that textboxes linked to the same data are updated var expected = new DateOnly(2000, 1, 2); target.SendKeys("01/02/2000\t"); Browser.Equal(expected, () => DateOnly.Parse(boundValue.Text, CultureInfo.InvariantCulture)); - Assert.Equal(expected, DateOnly.Parse(mirrorValue.GetAttribute("value"), CultureInfo.InvariantCulture)); + Assert.Equal(expected, DateOnly.Parse(mirrorValue.GetDomProperty("value"), CultureInfo.InvariantCulture)); // Modify target; verify value is updated and that textboxes linked to the same data are updated target.Clear(); target.SendKeys("\t"); Browser.Equal(string.Empty, () => boundValue.Text); - Assert.Equal(string.Empty, mirrorValue.GetAttribute("value")); + Assert.Equal(string.Empty, mirrorValue.GetDomProperty("value")); } // For date comparisons, we parse (non-formatted) values to compare them. Client-side and server-side @@ -899,23 +899,23 @@ public void CanBindTextboxTimeOnly() var boundValue = Browser.Exists(By.Id("textbox-timeonly-value")); var mirrorValue = Browser.Exists(By.Id("textbox-timeonly-mirror")); var expected = new TimeOnly(8, 5); - Assert.Equal(expected, TimeOnly.Parse(target.GetAttribute("value"), CultureInfo.InvariantCulture)); + Assert.Equal(expected, TimeOnly.Parse(target.GetDomProperty("value"), CultureInfo.InvariantCulture)); Assert.Equal(expected, TimeOnly.Parse(boundValue.Text, CultureInfo.InvariantCulture)); - Assert.Equal(expected, TimeOnly.Parse(mirrorValue.GetAttribute("value"), CultureInfo.InvariantCulture)); + Assert.Equal(expected, TimeOnly.Parse(mirrorValue.GetDomProperty("value"), CultureInfo.InvariantCulture)); // Clear textbox; value updates to 00:00 because that's the default target.Clear(); expected = default; - Browser.Equal(expected, () => TimeOnly.Parse(target.GetAttribute("value"), CultureInfo.InvariantCulture)); + Browser.Equal(expected, () => TimeOnly.Parse(target.GetDomProperty("value"), CultureInfo.InvariantCulture)); Assert.Equal(expected, TimeOnly.Parse(boundValue.Text, CultureInfo.InvariantCulture)); - Assert.Equal(expected, TimeOnly.Parse(mirrorValue.GetAttribute("value"), CultureInfo.InvariantCulture)); + Assert.Equal(expected, TimeOnly.Parse(mirrorValue.GetDomProperty("value"), CultureInfo.InvariantCulture)); // Modify target; verify value is updated and that textboxes linked to the same data are updated target.SendKeys(Keys.Control + "a"); // select all target.SendKeys("10:42\t"); expected = new TimeOnly(10, 42); Browser.Equal(expected, () => TimeOnly.Parse(boundValue.Text, CultureInfo.InvariantCulture)); - Assert.Equal(expected, TimeOnly.Parse(mirrorValue.GetAttribute("value"), CultureInfo.InvariantCulture)); + Assert.Equal(expected, TimeOnly.Parse(mirrorValue.GetDomProperty("value"), CultureInfo.InvariantCulture)); } // For date comparisons, we parse (non-formatted) values to compare them. Client-side and server-side @@ -926,26 +926,26 @@ public void CanBindTextboxNullableTimeOnly() var target = Browser.Exists(By.Id("textbox-nullable-timeonly")); var boundValue = Browser.Exists(By.Id("textbox-nullable-timeonly-value")); var mirrorValue = Browser.Exists(By.Id("textbox-nullable-timeonly-mirror")); - Assert.Equal(string.Empty, target.GetAttribute("value")); + Assert.Equal(string.Empty, target.GetDomProperty("value")); Assert.Equal(string.Empty, boundValue.Text); - Assert.Equal(string.Empty, mirrorValue.GetAttribute("value")); + Assert.Equal(string.Empty, mirrorValue.GetDomProperty("value")); // Modify target; verify value is updated and that textboxes linked to the same data are updated target.Clear(); Browser.Equal("", () => boundValue.Text); - Assert.Equal("", mirrorValue.GetAttribute("value")); + Assert.Equal("", mirrorValue.GetDomProperty("value")); // Modify target; verify value is updated and that textboxes linked to the same data are updated var expected = new TimeOnly(8, 5); target.SendKeys("08:05\t"); Browser.Equal(expected, () => TimeOnly.Parse(boundValue.Text, CultureInfo.InvariantCulture)); - Assert.Equal(expected, TimeOnly.Parse(mirrorValue.GetAttribute("value"), CultureInfo.InvariantCulture)); + Assert.Equal(expected, TimeOnly.Parse(mirrorValue.GetDomProperty("value"), CultureInfo.InvariantCulture)); // Modify target; verify value is updated and that textboxes linked to the same data are updated target.Clear(); target.SendKeys("\t"); Browser.Equal(string.Empty, () => boundValue.Text); - Assert.Equal(string.Empty, mirrorValue.GetAttribute("value")); + Assert.Equal(string.Empty, mirrorValue.GetDomProperty("value")); } // For date comparisons, we parse (non-formatted) values to compare them. Client-side and server-side @@ -957,24 +957,24 @@ public void CanBindTextboxDateTimeWithFormat() var boundValue = Browser.Exists(By.Id("textbox-datetime-format-value")); var mirrorValue = Browser.Exists(By.Id("textbox-datetime-format-mirror")); var expected = new DateTime(1985, 3, 4); - Assert.Equal("03-04", target.GetAttribute("value")); + Assert.Equal("03-04", target.GetDomProperty("value")); Assert.Equal(expected, DateTime.Parse(boundValue.Text, CultureInfo.InvariantCulture)); - Assert.Equal(expected, DateTime.Parse(mirrorValue.GetAttribute("value"), CultureInfo.InvariantCulture)); + Assert.Equal(expected, DateTime.Parse(mirrorValue.GetDomProperty("value"), CultureInfo.InvariantCulture)); // Clear textbox; value updates to the default target.Clear(); target.SendKeys("\t"); expected = default; - Browser.Equal("01-01", () => target.GetAttribute("value")); + Browser.Equal("01-01", () => target.GetDomProperty("value")); Assert.Equal(expected, DateTime.Parse(boundValue.Text, CultureInfo.InvariantCulture)); - Assert.Equal(expected, DateTime.Parse(mirrorValue.GetAttribute("value"), CultureInfo.InvariantCulture)); + Assert.Equal(expected, DateTime.Parse(mirrorValue.GetDomProperty("value"), CultureInfo.InvariantCulture)); // Modify target; verify value is updated and that textboxes linked to the same data are updated target.SendKeys(Keys.Control + "a"); // select all target.SendKeys("01-02\t"); expected = new DateTime(DateTime.Now.Year, 1, 2); Browser.Equal(expected, () => DateTime.Parse(boundValue.Text, CultureInfo.InvariantCulture)); - Assert.Equal(expected, DateTime.Parse(mirrorValue.GetAttribute("value"), CultureInfo.InvariantCulture)); + Assert.Equal(expected, DateTime.Parse(mirrorValue.GetDomProperty("value"), CultureInfo.InvariantCulture)); } // For date comparisons, we parse (non-formatted) values to compare them. Client-side and server-side @@ -985,26 +985,26 @@ public void CanBindTextboxNullableDateTimeWithFormat() var target = Browser.Exists(By.Id("textbox-nullable-datetime-format")); var boundValue = Browser.Exists(By.Id("textbox-nullable-datetime-format-value")); var mirrorValue = Browser.Exists(By.Id("textbox-nullable-datetime-format-mirror")); - Assert.Equal(string.Empty, target.GetAttribute("value")); + Assert.Equal(string.Empty, target.GetDomProperty("value")); Assert.Equal(string.Empty, boundValue.Text); - Assert.Equal(string.Empty, mirrorValue.GetAttribute("value")); + Assert.Equal(string.Empty, mirrorValue.GetDomProperty("value")); // Modify target; verify value is updated and that textboxes linked to the same data are updated target.Clear(); Browser.Equal("", () => boundValue.Text); - Assert.Equal("", mirrorValue.GetAttribute("value")); + Assert.Equal("", mirrorValue.GetDomProperty("value")); // Modify target; verify value is updated and that textboxes linked to the same data are updated target.SendKeys("01-02\t"); var expected = new DateTime(DateTime.Now.Year, 1, 2); Browser.Equal(expected, () => DateTime.Parse(boundValue.Text, CultureInfo.InvariantCulture)); - Assert.Equal(expected, DateTime.Parse(mirrorValue.GetAttribute("value"), CultureInfo.InvariantCulture)); + Assert.Equal(expected, DateTime.Parse(mirrorValue.GetDomProperty("value"), CultureInfo.InvariantCulture)); // Modify target; verify value is updated and that textboxes linked to the same data are updated target.Clear(); target.SendKeys("\t"); Browser.Equal(string.Empty, () => boundValue.Text); - Assert.Equal(string.Empty, mirrorValue.GetAttribute("value")); + Assert.Equal(string.Empty, mirrorValue.GetDomProperty("value")); } // For date comparisons, we parse (non-formatted) values to compare them. Client-side and server-side @@ -1016,23 +1016,23 @@ public void CanBindTextboxDateTimeOffsetWithFormat() var boundValue = Browser.Exists(By.Id("textbox-datetimeoffset-format-value")); var mirrorValue = Browser.Exists(By.Id("textbox-datetimeoffset-format-mirror")); var expected = new DateTimeOffset(new DateTime(1985, 3, 4), TimeSpan.FromHours(8)); - Assert.Equal("03-04", target.GetAttribute("value")); + Assert.Equal("03-04", target.GetDomProperty("value")); Assert.Equal(expected, DateTimeOffset.Parse(boundValue.Text, CultureInfo.InvariantCulture)); - Assert.Equal(expected, DateTimeOffset.Parse(mirrorValue.GetAttribute("value"), CultureInfo.InvariantCulture)); + Assert.Equal(expected, DateTimeOffset.Parse(mirrorValue.GetDomProperty("value"), CultureInfo.InvariantCulture)); // Clear textbox; value updates to the default target.Clear(); expected = default; - Browser.Equal("01-01", () => target.GetAttribute("value")); + Browser.Equal("01-01", () => target.GetDomProperty("value")); Assert.Equal(expected, DateTimeOffset.Parse(boundValue.Text, CultureInfo.InvariantCulture)); - Assert.Equal(expected, DateTimeOffset.Parse(mirrorValue.GetAttribute("value"), CultureInfo.InvariantCulture)); + Assert.Equal(expected, DateTimeOffset.Parse(mirrorValue.GetDomProperty("value"), CultureInfo.InvariantCulture)); // Modify target; verify value is updated and that textboxes linked to the same data are updated target.SendKeys(Keys.Control + "a"); // select all target.SendKeys("01-02\t"); expected = new DateTimeOffset(new DateTime(DateTime.Now.Year, 1, 2), TimeSpan.FromHours(0)); Browser.Equal(expected.DateTime, () => DateTimeOffset.Parse(boundValue.Text, CultureInfo.InvariantCulture).DateTime); - Assert.Equal(expected.DateTime, DateTimeOffset.Parse(mirrorValue.GetAttribute("value"), CultureInfo.InvariantCulture).DateTime); + Assert.Equal(expected.DateTime, DateTimeOffset.Parse(mirrorValue.GetDomProperty("value"), CultureInfo.InvariantCulture).DateTime); } // For date comparisons, we parse (non-formatted) values to compare them. Client-side and server-side @@ -1046,26 +1046,26 @@ public void CanBindTextboxNullableDateTimeOffsetWithFormat() var target = Browser.Exists(By.Id("textbox-nullable-datetimeoffset")); var boundValue = Browser.Exists(By.Id("textbox-nullable-datetimeoffset-value")); var mirrorValue = Browser.Exists(By.Id("textbox-nullable-datetimeoffset-mirror")); - Assert.Equal(string.Empty, target.GetAttribute("value")); + Assert.Equal(string.Empty, target.GetDomProperty("value")); Assert.Equal(string.Empty, boundValue.Text); - Assert.Equal(string.Empty, mirrorValue.GetAttribute("value")); + Assert.Equal(string.Empty, mirrorValue.GetDomProperty("value")); // Modify target; verify value is updated and that textboxes linked to the same data are updated target.Clear(); Browser.Equal("", () => boundValue.Text); - Assert.Equal("", mirrorValue.GetAttribute("value")); + Assert.Equal("", mirrorValue.GetDomProperty("value")); // Modify target; verify value is updated and that textboxes linked to the same data are updated target.SendKeys("01-02" + "\t"); var expected = new DateTimeOffset(new DateTime(DateTime.Now.Year, 1, 2), TimeSpan.FromHours(0)); Browser.Equal(expected.DateTime, () => DateTimeOffset.Parse(boundValue.Text, CultureInfo.InvariantCulture).DateTime); - Assert.Equal(expected.DateTime, DateTimeOffset.Parse(mirrorValue.GetAttribute("value"), CultureInfo.InvariantCulture).DateTime); + Assert.Equal(expected.DateTime, DateTimeOffset.Parse(mirrorValue.GetDomProperty("value"), CultureInfo.InvariantCulture).DateTime); // Modify target; verify value is updated and that textboxes linked to the same data are updated target.Clear(); target.SendKeys("\t"); Browser.Equal(string.Empty, () => boundValue.Text); - Assert.Equal(string.Empty, mirrorValue.GetAttribute("value")); + Assert.Equal(string.Empty, mirrorValue.GetDomProperty("value")); } // For date comparisons, we parse (non-formatted) values to compare them. Client-side and server-side @@ -1077,24 +1077,24 @@ public void CanBindTextboxDateOnlyWithFormat() var boundValue = Browser.Exists(By.Id("textbox-dateonly-format-value")); var mirrorValue = Browser.Exists(By.Id("textbox-dateonly-format-mirror")); var expected = new DateOnly(1985, 3, 4); - Assert.Equal("03-04", target.GetAttribute("value")); + Assert.Equal("03-04", target.GetDomProperty("value")); Assert.Equal(expected, DateOnly.Parse(boundValue.Text, CultureInfo.InvariantCulture)); - Assert.Equal(expected, DateOnly.Parse(mirrorValue.GetAttribute("value"), CultureInfo.InvariantCulture)); + Assert.Equal(expected, DateOnly.Parse(mirrorValue.GetDomProperty("value"), CultureInfo.InvariantCulture)); // Clear textbox; value updates to the default target.Clear(); target.SendKeys("\t"); expected = default; - Browser.Equal("01-01", () => target.GetAttribute("value")); + Browser.Equal("01-01", () => target.GetDomProperty("value")); Assert.Equal(expected, DateOnly.Parse(boundValue.Text, CultureInfo.InvariantCulture)); - Assert.Equal(expected, DateOnly.Parse(mirrorValue.GetAttribute("value"), CultureInfo.InvariantCulture)); + Assert.Equal(expected, DateOnly.Parse(mirrorValue.GetDomProperty("value"), CultureInfo.InvariantCulture)); // Modify target; verify value is updated and that textboxes linked to the same data are updated target.SendKeys(Keys.Control + "a"); // select all target.SendKeys("01-02\t"); expected = new DateOnly(DateTime.Now.Year, 1, 2); Browser.Equal(expected, () => DateOnly.Parse(boundValue.Text, CultureInfo.InvariantCulture)); - Assert.Equal(expected, DateOnly.Parse(mirrorValue.GetAttribute("value"), CultureInfo.InvariantCulture)); + Assert.Equal(expected, DateOnly.Parse(mirrorValue.GetDomProperty("value"), CultureInfo.InvariantCulture)); } // For date comparisons, we parse (non-formatted) values to compare them. Client-side and server-side @@ -1105,26 +1105,26 @@ public void CanBindTextboxNullableDateOnlyWithFormat() var target = Browser.Exists(By.Id("textbox-nullable-dateonly-format")); var boundValue = Browser.Exists(By.Id("textbox-nullable-dateonly-format-value")); var mirrorValue = Browser.Exists(By.Id("textbox-nullable-dateonly-format-mirror")); - Assert.Equal(string.Empty, target.GetAttribute("value")); + Assert.Equal(string.Empty, target.GetDomProperty("value")); Assert.Equal(string.Empty, boundValue.Text); - Assert.Equal(string.Empty, mirrorValue.GetAttribute("value")); + Assert.Equal(string.Empty, mirrorValue.GetDomProperty("value")); // Modify target; verify value is updated and that textboxes linked to the same data are updated target.Clear(); Browser.Equal("", () => boundValue.Text); - Assert.Equal("", mirrorValue.GetAttribute("value")); + Assert.Equal("", mirrorValue.GetDomProperty("value")); // Modify target; verify value is updated and that textboxes linked to the same data are updated target.SendKeys("01-02\t"); var expected = new DateOnly(DateTime.Now.Year, 1, 2); Browser.Equal(expected, () => DateOnly.Parse(boundValue.Text, CultureInfo.InvariantCulture)); - Assert.Equal(expected, DateOnly.Parse(mirrorValue.GetAttribute("value"), CultureInfo.InvariantCulture)); + Assert.Equal(expected, DateOnly.Parse(mirrorValue.GetDomProperty("value"), CultureInfo.InvariantCulture)); // Modify target; verify value is updated and that textboxes linked to the same data are updated target.Clear(); target.SendKeys("\t"); Browser.Equal(string.Empty, () => boundValue.Text); - Assert.Equal(string.Empty, mirrorValue.GetAttribute("value")); + Assert.Equal(string.Empty, mirrorValue.GetDomProperty("value")); } // For date comparisons, we parse (non-formatted) values to compare them. Client-side and server-side @@ -1136,24 +1136,24 @@ public void CanBindTextboxTimeOnlyWithFormat() var boundValue = Browser.Exists(By.Id("textbox-timeonly-format-value")); var mirrorValue = Browser.Exists(By.Id("textbox-timeonly-format-mirror")); var expected = new TimeOnly(8, 5); - Assert.Equal("08:05:00", target.GetAttribute("value")); + Assert.Equal("08:05:00", target.GetDomProperty("value")); Assert.Equal(expected, TimeOnly.Parse(boundValue.Text, CultureInfo.InvariantCulture)); - Assert.Equal(expected, TimeOnly.Parse(mirrorValue.GetAttribute("value"), CultureInfo.InvariantCulture)); + Assert.Equal(expected, TimeOnly.Parse(mirrorValue.GetDomProperty("value"), CultureInfo.InvariantCulture)); // Clear textbox; value updates to the default target.Clear(); target.SendKeys("\t"); expected = default; - Browser.Equal("00:00:00", () => target.GetAttribute("value")); + Browser.Equal("00:00:00", () => target.GetDomProperty("value")); Assert.Equal(expected, TimeOnly.Parse(boundValue.Text, CultureInfo.InvariantCulture)); - Assert.Equal(expected, TimeOnly.Parse(mirrorValue.GetAttribute("value"), CultureInfo.InvariantCulture)); + Assert.Equal(expected, TimeOnly.Parse(mirrorValue.GetDomProperty("value"), CultureInfo.InvariantCulture)); // Modify target; verify value is updated and that textboxes linked to the same data are updated target.SendKeys(Keys.Control + "a"); // select all target.SendKeys("10:42:00\t"); expected = new TimeOnly(10, 42); Browser.Equal(expected, () => TimeOnly.Parse(boundValue.Text, CultureInfo.InvariantCulture)); - Assert.Equal(expected, TimeOnly.Parse(mirrorValue.GetAttribute("value"), CultureInfo.InvariantCulture)); + Assert.Equal(expected, TimeOnly.Parse(mirrorValue.GetDomProperty("value"), CultureInfo.InvariantCulture)); } // For date comparisons, we parse (non-formatted) values to compare them. Client-side and server-side @@ -1164,26 +1164,26 @@ public void CanBindTextboxNullableTimeOnlyWithFormat() var target = Browser.Exists(By.Id("textbox-nullable-timeonly-format")); var boundValue = Browser.Exists(By.Id("textbox-nullable-timeonly-format-value")); var mirrorValue = Browser.Exists(By.Id("textbox-nullable-timeonly-format-mirror")); - Assert.Equal(string.Empty, target.GetAttribute("value")); + Assert.Equal(string.Empty, target.GetDomProperty("value")); Assert.Equal(string.Empty, boundValue.Text); - Assert.Equal(string.Empty, mirrorValue.GetAttribute("value")); + Assert.Equal(string.Empty, mirrorValue.GetDomProperty("value")); // Modify target; verify value is updated and that textboxes linked to the same data are updated target.Clear(); Browser.Equal("", () => boundValue.Text); - Assert.Equal("", mirrorValue.GetAttribute("value")); + Assert.Equal("", mirrorValue.GetDomProperty("value")); // Modify target; verify value is updated and that textboxes linked to the same data are updated target.SendKeys("08:05:00\t"); var expected = new TimeOnly(8, 5); Browser.Equal(expected, () => TimeOnly.Parse(boundValue.Text, CultureInfo.InvariantCulture)); - Assert.Equal(expected, TimeOnly.Parse(mirrorValue.GetAttribute("value"), CultureInfo.InvariantCulture)); + Assert.Equal(expected, TimeOnly.Parse(mirrorValue.GetDomProperty("value"), CultureInfo.InvariantCulture)); // Modify target; verify value is updated and that textboxes linked to the same data are updated target.Clear(); target.SendKeys("\t"); Browser.Equal(string.Empty, () => boundValue.Text); - Assert.Equal(string.Empty, mirrorValue.GetAttribute("value")); + Assert.Equal(string.Empty, mirrorValue.GetDomProperty("value")); } // For date comparisons, we parse (non-formatted) values to compare them. Client-side and server-side @@ -1194,32 +1194,32 @@ public void CanBindTextboxNullableDateTime_InvalidValue() var target = Browser.Exists(By.Id("textbox-nullable-datetime-invalid")); var boundValue = Browser.Exists(By.Id("textbox-nullable-datetime-invalid-value")); var mirrorValue = Browser.Exists(By.Id("textbox-nullable-datetime-invalid-mirror")); - Assert.Equal(string.Empty, target.GetAttribute("value")); + Assert.Equal(string.Empty, target.GetDomProperty("value")); Assert.Equal(string.Empty, boundValue.Text); - Assert.Equal(string.Empty, mirrorValue.GetAttribute("value")); + Assert.Equal(string.Empty, mirrorValue.GetDomProperty("value")); // Modify target; verify value is updated and that textboxes linked to the same data are updated var expected = new DateTime(2000, 1, 2); target.SendKeys("01/02/2000 00:00:00\t"); Browser.Equal(expected, () => DateTime.Parse(boundValue.Text, CultureInfo.InvariantCulture)); - Assert.Equal(expected, DateTime.Parse(mirrorValue.GetAttribute("value"), CultureInfo.InvariantCulture)); + Assert.Equal(expected, DateTime.Parse(mirrorValue.GetDomProperty("value"), CultureInfo.InvariantCulture)); // Modify target to something invalid - the invalid change is reverted // back to the last valid value target.SendKeys(Keys.Control + "a"); // select all target.SendKeys("05/06X"); - Browser.Equal("05/06X", () => target.GetAttribute("value")); + Browser.Equal("05/06X", () => target.GetDomProperty("value")); target.SendKeys("\t"); - Browser.Equal(expected, () => DateTime.Parse(target.GetAttribute("value"), CultureInfo.InvariantCulture)); + Browser.Equal(expected, () => DateTime.Parse(target.GetDomProperty("value"), CultureInfo.InvariantCulture)); Assert.Equal(expected, DateTime.Parse(boundValue.Text, CultureInfo.InvariantCulture)); - Assert.Equal(expected, DateTime.Parse(mirrorValue.GetAttribute("value"), CultureInfo.InvariantCulture)); + Assert.Equal(expected, DateTime.Parse(mirrorValue.GetDomProperty("value"), CultureInfo.InvariantCulture)); // Now change it to something valid target.SendKeys(Keys.Control + "a"); // select all target.SendKeys("05/06\t"); expected = new DateTime(DateTime.Now.Year, 5, 6); Browser.Equal(expected, () => DateTime.Parse(boundValue.Text, CultureInfo.InvariantCulture)); - Assert.Equal(expected, DateTime.Parse(mirrorValue.GetAttribute("value"), CultureInfo.InvariantCulture)); + Assert.Equal(expected, DateTime.Parse(mirrorValue.GetDomProperty("value"), CultureInfo.InvariantCulture)); } // For date comparisons, we parse (non-formatted) values to compare them. Client-side and server-side @@ -1231,33 +1231,33 @@ public void CanBindTextboxDateTimeOffset_InvalidValue() var boundValue = Browser.Exists(By.Id("textbox-datetimeoffset-invalid-value")); var mirrorValue = Browser.Exists(By.Id("textbox-datetimeoffset-invalid-mirror")); var expected = new DateTimeOffset(new DateTime(1985, 3, 4), TimeSpan.FromHours(8)); - Assert.Equal(expected, DateTimeOffset.Parse(target.GetAttribute("value"), CultureInfo.InvariantCulture)); + Assert.Equal(expected, DateTimeOffset.Parse(target.GetDomProperty("value"), CultureInfo.InvariantCulture)); Assert.Equal(expected, DateTimeOffset.Parse(boundValue.Text, CultureInfo.InvariantCulture)); - Assert.Equal(expected, DateTimeOffset.Parse(mirrorValue.GetAttribute("value"), CultureInfo.InvariantCulture)); + Assert.Equal(expected, DateTimeOffset.Parse(mirrorValue.GetDomProperty("value"), CultureInfo.InvariantCulture)); // Modify target; verify value is updated and that textboxes linked to the same data are updated expected = new DateTime(2000, 1, 2); target.SendKeys(Keys.Control + "a"); // select all target.SendKeys("01/02/2000 00:00:00\t"); Browser.Equal(expected.DateTime, () => DateTimeOffset.Parse(boundValue.Text, CultureInfo.InvariantCulture).DateTime); - Assert.Equal(expected.DateTime, DateTimeOffset.Parse(mirrorValue.GetAttribute("value"), CultureInfo.InvariantCulture).DateTime); + Assert.Equal(expected.DateTime, DateTimeOffset.Parse(mirrorValue.GetDomProperty("value"), CultureInfo.InvariantCulture).DateTime); // Modify target to something invalid - the invalid change is reverted // back to the last valid value target.SendKeys(Keys.Control + "a"); // select all target.SendKeys("05/06X"); - Browser.Equal("05/06X", () => target.GetAttribute("value")); + Browser.Equal("05/06X", () => target.GetDomProperty("value")); target.SendKeys("\t"); - Browser.Equal(expected.DateTime, () => DateTimeOffset.Parse(target.GetAttribute("value"), CultureInfo.InvariantCulture).DateTime); + Browser.Equal(expected.DateTime, () => DateTimeOffset.Parse(target.GetDomProperty("value"), CultureInfo.InvariantCulture).DateTime); Assert.Equal(expected.DateTime, DateTimeOffset.Parse(boundValue.Text, CultureInfo.InvariantCulture).DateTime); - Assert.Equal(expected.DateTime, DateTimeOffset.Parse(mirrorValue.GetAttribute("value"), CultureInfo.InvariantCulture).DateTime); + Assert.Equal(expected.DateTime, DateTimeOffset.Parse(mirrorValue.GetDomProperty("value"), CultureInfo.InvariantCulture).DateTime); // Now change it to something valid target.SendKeys(Keys.Control + "a"); // select all target.SendKeys("05/06\t"); expected = new DateTime(DateTime.Now.Year, 5, 6); Browser.Equal(expected.DateTime, () => DateTimeOffset.Parse(boundValue.Text, CultureInfo.InvariantCulture).DateTime); - Assert.Equal(expected.DateTime, DateTimeOffset.Parse(mirrorValue.GetAttribute("value"), CultureInfo.InvariantCulture).DateTime); + Assert.Equal(expected.DateTime, DateTimeOffset.Parse(mirrorValue.GetDomProperty("value"), CultureInfo.InvariantCulture).DateTime); } // For date comparisons, we parse (non-formatted) values to compare them. Client-side and server-side @@ -1269,26 +1269,26 @@ public void CanBindTextboxDateTimeWithFormat_InvalidValue() var boundValue = Browser.Exists(By.Id("textbox-datetime-format-invalid-value")); var mirrorValue = Browser.Exists(By.Id("textbox-datetime-format-invalid-mirror")); var expected = new DateTime(1985, 3, 4); - Assert.Equal("03-04", target.GetAttribute("value")); + Assert.Equal("03-04", target.GetDomProperty("value")); Assert.Equal(expected, DateTime.Parse(boundValue.Text, CultureInfo.InvariantCulture)); - Assert.Equal(expected, DateTime.Parse(mirrorValue.GetAttribute("value"), CultureInfo.InvariantCulture)); + Assert.Equal(expected, DateTime.Parse(mirrorValue.GetDomProperty("value"), CultureInfo.InvariantCulture)); // Modify target to something invalid - the invalid change is reverted // back to the last valid value target.SendKeys(Keys.Control + "a"); // select all target.SendKeys("05/06"); - Browser.Equal("05/06", () => target.GetAttribute("value")); + Browser.Equal("05/06", () => target.GetDomProperty("value")); target.SendKeys("\t"); - Browser.Equal("03-04", () => target.GetAttribute("value")); + Browser.Equal("03-04", () => target.GetDomProperty("value")); Assert.Equal(expected, DateTime.Parse(boundValue.Text, CultureInfo.InvariantCulture)); - Assert.Equal(expected, DateTime.Parse(mirrorValue.GetAttribute("value"), CultureInfo.InvariantCulture)); + Assert.Equal(expected, DateTime.Parse(mirrorValue.GetDomProperty("value"), CultureInfo.InvariantCulture)); // Now change it to something valid target.SendKeys(Keys.Control + "a"); // select all target.SendKeys("05-06\t"); expected = new DateTime(DateTime.Now.Year, 5, 6); Browser.Equal(expected, () => DateTime.Parse(boundValue.Text, CultureInfo.InvariantCulture)); - Assert.Equal(expected, DateTime.Parse(mirrorValue.GetAttribute("value"), CultureInfo.InvariantCulture)); + Assert.Equal(expected, DateTime.Parse(mirrorValue.GetDomProperty("value"), CultureInfo.InvariantCulture)); } // For date comparisons, we parse (non-formatted) values to compare them. Client-side and server-side @@ -1299,33 +1299,33 @@ public void CanBindTextboxNullableDateTimeOffsetWithFormat_InvalidValue() var target = Browser.Exists(By.Id("textbox-nullable-datetimeoffset-format-invalid")); var boundValue = Browser.Exists(By.Id("textbox-nullable-datetimeoffset-format-invalid-value")); var mirrorValue = Browser.Exists(By.Id("textbox-nullable-datetimeoffset-format-invalid-mirror")); - Assert.Equal(string.Empty, target.GetAttribute("value")); + Assert.Equal(string.Empty, target.GetDomProperty("value")); Assert.Equal(string.Empty, boundValue.Text); - Assert.Equal(string.Empty, mirrorValue.GetAttribute("value")); + Assert.Equal(string.Empty, mirrorValue.GetDomProperty("value")); // Modify target; verify value is updated and that textboxes linked to the same data are updated var expected = new DateTimeOffset(new DateTime(DateTime.Now.Year, 1, 2)); target.SendKeys(Keys.Control + "a"); // select all target.SendKeys("01-02\t"); Browser.Equal(expected.DateTime, () => DateTimeOffset.Parse(boundValue.Text, CultureInfo.InvariantCulture).DateTime); - Assert.Equal(expected.DateTime, DateTimeOffset.Parse(mirrorValue.GetAttribute("value"), CultureInfo.InvariantCulture).DateTime); + Assert.Equal(expected.DateTime, DateTimeOffset.Parse(mirrorValue.GetDomProperty("value"), CultureInfo.InvariantCulture).DateTime); // Modify target to something invalid - the invalid change is reverted // back to the last valid value target.SendKeys(Keys.Control + "a"); // select all target.SendKeys("05/06"); - Browser.Equal("05/06", () => target.GetAttribute("value")); + Browser.Equal("05/06", () => target.GetDomProperty("value")); target.SendKeys("\t"); - Browser.Equal(expected.DateTime, () => DateTimeOffset.Parse(target.GetAttribute("value"), CultureInfo.InvariantCulture).DateTime); + Browser.Equal(expected.DateTime, () => DateTimeOffset.Parse(target.GetDomProperty("value"), CultureInfo.InvariantCulture).DateTime); Assert.Equal(expected.DateTime, DateTimeOffset.Parse(boundValue.Text, CultureInfo.InvariantCulture).DateTime); - Assert.Equal(expected.DateTime, DateTimeOffset.Parse(mirrorValue.GetAttribute("value"), CultureInfo.InvariantCulture).DateTime); + Assert.Equal(expected.DateTime, DateTimeOffset.Parse(mirrorValue.GetDomProperty("value"), CultureInfo.InvariantCulture).DateTime); // Now change it to something valid target.SendKeys(Keys.Control + "a"); // select all target.SendKeys("05-06\t"); expected = new DateTime(DateTime.Now.Year, 5, 6); Browser.Equal(expected.DateTime, () => DateTimeOffset.Parse(boundValue.Text, CultureInfo.InvariantCulture).DateTime); - Assert.Equal(expected.DateTime, DateTimeOffset.Parse(mirrorValue.GetAttribute("value"), CultureInfo.InvariantCulture).DateTime); + Assert.Equal(expected.DateTime, DateTimeOffset.Parse(mirrorValue.GetDomProperty("value"), CultureInfo.InvariantCulture).DateTime); } // For date comparisons, we parse (non-formatted) values to compare them. Client-side and server-side @@ -1336,32 +1336,32 @@ public void CanBindTextboxNullableDateOnly_InvalidValue() var target = Browser.Exists(By.Id("textbox-nullable-dateonly-invalid")); var boundValue = Browser.Exists(By.Id("textbox-nullable-dateonly-invalid-value")); var mirrorValue = Browser.Exists(By.Id("textbox-nullable-dateonly-invalid-mirror")); - Assert.Equal(string.Empty, target.GetAttribute("value")); + Assert.Equal(string.Empty, target.GetDomProperty("value")); Assert.Equal(string.Empty, boundValue.Text); - Assert.Equal(string.Empty, mirrorValue.GetAttribute("value")); + Assert.Equal(string.Empty, mirrorValue.GetDomProperty("value")); // Modify target; verify value is updated and that textboxes linked to the same data are updated var expected = new DateOnly(2000, 1, 2); target.SendKeys("01/02/2000\t"); Browser.Equal(expected, () => DateOnly.Parse(boundValue.Text, CultureInfo.InvariantCulture)); - Assert.Equal(expected, DateOnly.Parse(mirrorValue.GetAttribute("value"), CultureInfo.InvariantCulture)); + Assert.Equal(expected, DateOnly.Parse(mirrorValue.GetDomProperty("value"), CultureInfo.InvariantCulture)); // Modify target to something invalid - the invalid change is reverted // back to the last valid value target.SendKeys(Keys.Control + "a"); // select all target.SendKeys("05/06X"); - Browser.Equal("05/06X", () => target.GetAttribute("value")); + Browser.Equal("05/06X", () => target.GetDomProperty("value")); target.SendKeys("\t"); - Browser.Equal(expected, () => DateOnly.Parse(target.GetAttribute("value"), CultureInfo.InvariantCulture)); + Browser.Equal(expected, () => DateOnly.Parse(target.GetDomProperty("value"), CultureInfo.InvariantCulture)); Assert.Equal(expected, DateOnly.Parse(boundValue.Text, CultureInfo.InvariantCulture)); - Assert.Equal(expected, DateOnly.Parse(mirrorValue.GetAttribute("value"), CultureInfo.InvariantCulture)); + Assert.Equal(expected, DateOnly.Parse(mirrorValue.GetDomProperty("value"), CultureInfo.InvariantCulture)); // Now change it to something valid target.SendKeys(Keys.Control + "a"); // select all target.SendKeys("05/06\t"); expected = new DateOnly(DateTime.Now.Year, 5, 6); Browser.Equal(expected, () => DateOnly.Parse(boundValue.Text, CultureInfo.InvariantCulture)); - Assert.Equal(expected, DateOnly.Parse(mirrorValue.GetAttribute("value"), CultureInfo.InvariantCulture)); + Assert.Equal(expected, DateOnly.Parse(mirrorValue.GetDomProperty("value"), CultureInfo.InvariantCulture)); } // For date comparisons, we parse (non-formatted) values to compare them. Client-side and server-side @@ -1373,26 +1373,26 @@ public void CanBindTextboxDateOnlyWithFormat_InvalidValue() var boundValue = Browser.Exists(By.Id("textbox-dateonly-format-invalid-value")); var mirrorValue = Browser.Exists(By.Id("textbox-dateonly-format-invalid-mirror")); var expected = new DateOnly(1985, 3, 4); - Assert.Equal("03-04", target.GetAttribute("value")); + Assert.Equal("03-04", target.GetDomProperty("value")); Assert.Equal(expected, DateOnly.Parse(boundValue.Text, CultureInfo.InvariantCulture)); - Assert.Equal(expected, DateOnly.Parse(mirrorValue.GetAttribute("value"), CultureInfo.InvariantCulture)); + Assert.Equal(expected, DateOnly.Parse(mirrorValue.GetDomProperty("value"), CultureInfo.InvariantCulture)); // Modify target to something invalid - the invalid change is reverted // back to the last valid value target.SendKeys(Keys.Control + "a"); // select all target.SendKeys("05/06"); - Browser.Equal("05/06", () => target.GetAttribute("value")); + Browser.Equal("05/06", () => target.GetDomProperty("value")); target.SendKeys("\t"); - Browser.Equal("03-04", () => target.GetAttribute("value")); + Browser.Equal("03-04", () => target.GetDomProperty("value")); Assert.Equal(expected, DateOnly.Parse(boundValue.Text, CultureInfo.InvariantCulture)); - Assert.Equal(expected, DateOnly.Parse(mirrorValue.GetAttribute("value"), CultureInfo.InvariantCulture)); + Assert.Equal(expected, DateOnly.Parse(mirrorValue.GetDomProperty("value"), CultureInfo.InvariantCulture)); // Now change it to something valid target.SendKeys(Keys.Control + "a"); // select all target.SendKeys("05-06\t"); expected = new DateOnly(DateTime.Now.Year, 5, 6); Browser.Equal(expected, () => DateOnly.Parse(boundValue.Text, CultureInfo.InvariantCulture)); - Assert.Equal(expected, DateOnly.Parse(mirrorValue.GetAttribute("value"), CultureInfo.InvariantCulture)); + Assert.Equal(expected, DateOnly.Parse(mirrorValue.GetDomProperty("value"), CultureInfo.InvariantCulture)); } // For date comparisons, we parse (non-formatted) values to compare them. Client-side and server-side @@ -1403,32 +1403,32 @@ public void CanBindTextboxNullableTimeOnly_InvalidValue() var target = Browser.Exists(By.Id("textbox-nullable-timeonly-invalid")); var boundValue = Browser.Exists(By.Id("textbox-nullable-timeonly-invalid-value")); var mirrorValue = Browser.Exists(By.Id("textbox-nullable-timeonly-invalid-mirror")); - Assert.Equal(string.Empty, target.GetAttribute("value")); + Assert.Equal(string.Empty, target.GetDomProperty("value")); Assert.Equal(string.Empty, boundValue.Text); - Assert.Equal(string.Empty, mirrorValue.GetAttribute("value")); + Assert.Equal(string.Empty, mirrorValue.GetDomProperty("value")); // Modify target; verify value is updated and that textboxes linked to the same data are updated var expected = new TimeOnly(8, 5); target.SendKeys("08:05:00\t"); Browser.Equal(expected, () => TimeOnly.Parse(boundValue.Text, CultureInfo.InvariantCulture)); - Assert.Equal(expected, TimeOnly.Parse(mirrorValue.GetAttribute("value"), CultureInfo.InvariantCulture)); + Assert.Equal(expected, TimeOnly.Parse(mirrorValue.GetDomProperty("value"), CultureInfo.InvariantCulture)); // Modify target to something invalid - the invalid change is reverted // back to the last valid value target.SendKeys(Keys.Control + "a"); // select all target.SendKeys("10:42:00X"); - Browser.Equal("10:42:00X", () => target.GetAttribute("value")); + Browser.Equal("10:42:00X", () => target.GetDomProperty("value")); target.SendKeys("\t"); - Browser.Equal(expected, () => TimeOnly.Parse(target.GetAttribute("value"), CultureInfo.InvariantCulture)); + Browser.Equal(expected, () => TimeOnly.Parse(target.GetDomProperty("value"), CultureInfo.InvariantCulture)); Assert.Equal(expected, TimeOnly.Parse(boundValue.Text, CultureInfo.InvariantCulture)); - Assert.Equal(expected, TimeOnly.Parse(mirrorValue.GetAttribute("value"), CultureInfo.InvariantCulture)); + Assert.Equal(expected, TimeOnly.Parse(mirrorValue.GetDomProperty("value"), CultureInfo.InvariantCulture)); // Now change it to something valid target.SendKeys(Keys.Control + "a"); // select all target.SendKeys("10:42:00\t"); expected = new TimeOnly(10, 42); Browser.Equal(expected, () => TimeOnly.Parse(boundValue.Text, CultureInfo.InvariantCulture)); - Assert.Equal(expected, TimeOnly.Parse(mirrorValue.GetAttribute("value"), CultureInfo.InvariantCulture)); + Assert.Equal(expected, TimeOnly.Parse(mirrorValue.GetDomProperty("value"), CultureInfo.InvariantCulture)); } // For date comparisons, we parse (non-formatted) values to compare them. Client-side and server-side @@ -1440,26 +1440,26 @@ public void CanBindTextboxTimeOnlyWithFormat_InvalidValue() var boundValue = Browser.Exists(By.Id("textbox-timeonly-format-invalid-value")); var mirrorValue = Browser.Exists(By.Id("textbox-timeonly-format-invalid-mirror")); var expected = new TimeOnly(8, 5); - Assert.Equal("08:05:00", target.GetAttribute("value")); + Assert.Equal("08:05:00", target.GetDomProperty("value")); Assert.Equal(expected, TimeOnly.Parse(boundValue.Text, CultureInfo.InvariantCulture)); - Assert.Equal(expected, TimeOnly.Parse(mirrorValue.GetAttribute("value"), CultureInfo.InvariantCulture)); + Assert.Equal(expected, TimeOnly.Parse(mirrorValue.GetDomProperty("value"), CultureInfo.InvariantCulture)); // Modify target to something invalid - the invalid change is reverted // back to the last valid value target.SendKeys(Keys.Control + "a"); // select all target.SendKeys("10:42"); - Browser.Equal("10:42", () => target.GetAttribute("value")); + Browser.Equal("10:42", () => target.GetDomProperty("value")); target.SendKeys("\t"); - Browser.Equal("08:05:00", () => target.GetAttribute("value")); + Browser.Equal("08:05:00", () => target.GetDomProperty("value")); Assert.Equal(expected, TimeOnly.Parse(boundValue.Text, CultureInfo.InvariantCulture)); - Assert.Equal(expected, TimeOnly.Parse(mirrorValue.GetAttribute("value"), CultureInfo.InvariantCulture)); + Assert.Equal(expected, TimeOnly.Parse(mirrorValue.GetDomProperty("value"), CultureInfo.InvariantCulture)); // Now change it to something valid target.SendKeys(Keys.Control + "a"); // select all target.SendKeys("10:42:00\t"); expected = new TimeOnly(10, 42); Browser.Equal(expected, () => TimeOnly.Parse(boundValue.Text, CultureInfo.InvariantCulture)); - Assert.Equal(expected, TimeOnly.Parse(mirrorValue.GetAttribute("value"), CultureInfo.InvariantCulture)); + Assert.Equal(expected, TimeOnly.Parse(mirrorValue.GetDomProperty("value"), CultureInfo.InvariantCulture)); } // For date comparisons, we parse (non-formatted) values to compare them. Client-side and server-side @@ -1471,23 +1471,23 @@ public void CanBindDateTimeLocalTextboxDateTime() var boundValue = Browser.Exists(By.Id("datetime-local-textbox-datetime-value")); var mirrorValue = Browser.Exists(By.Id("datetime-local-textbox-datetime-mirror")); var expected = new DateTime(1985, 3, 4); - Assert.Equal(expected, DateTime.Parse(target.GetAttribute("value"), CultureInfo.InvariantCulture)); + Assert.Equal(expected, DateTime.Parse(target.GetDomProperty("value"), CultureInfo.InvariantCulture)); Assert.Equal(expected, DateTime.Parse(boundValue.Text, CultureInfo.InvariantCulture)); - Assert.Equal(expected, DateTime.Parse(mirrorValue.GetAttribute("value"), CultureInfo.InvariantCulture)); + Assert.Equal(expected, DateTime.Parse(mirrorValue.GetDomProperty("value"), CultureInfo.InvariantCulture)); // Clear textbox; value updates to 01/01/0001 because that's the default target.Clear(); expected = default; - Browser.Equal(expected, () => DateTime.Parse(target.GetAttribute("value"), CultureInfo.InvariantCulture)); + Browser.Equal(expected, () => DateTime.Parse(target.GetDomProperty("value"), CultureInfo.InvariantCulture)); Assert.Equal(expected, DateTime.Parse(boundValue.Text, CultureInfo.InvariantCulture)); - Assert.Equal(expected, DateTime.Parse(mirrorValue.GetAttribute("value"), CultureInfo.InvariantCulture)); + Assert.Equal(expected, DateTime.Parse(mirrorValue.GetDomProperty("value"), CultureInfo.InvariantCulture)); // We have to do it this way because the browser gets in the way when sending keys to the input // element directly. ApplyInputValue("#datetime-local-textbox-datetime", "2000-01-02T04:05:06"); expected = new DateTime(2000, 1, 2, 04, 05, 06); Browser.Equal(expected, () => DateTime.Parse(boundValue.Text, CultureInfo.InvariantCulture)); - Assert.Equal(expected, DateTime.Parse(mirrorValue.GetAttribute("value"), CultureInfo.InvariantCulture)); + Assert.Equal(expected, DateTime.Parse(mirrorValue.GetDomProperty("value"), CultureInfo.InvariantCulture)); } // For date comparisons, we parse (non-formatted) values to compare them. Client-side and server-side @@ -1498,14 +1498,14 @@ public void CanBindDateTimeLocalTextboxNullableDateTime() var target = Browser.Exists(By.Id("datetime-local-textbox-nullable-datetime")); var boundValue = Browser.Exists(By.Id("datetime-local-textbox-nullable-datetime-value")); var mirrorValue = Browser.Exists(By.Id("datetime-local-textbox-nullable-datetime-mirror")); - Assert.Equal(string.Empty, target.GetAttribute("value")); + Assert.Equal(string.Empty, target.GetDomProperty("value")); Assert.Equal(string.Empty, boundValue.Text); - Assert.Equal(string.Empty, mirrorValue.GetAttribute("value")); + Assert.Equal(string.Empty, mirrorValue.GetDomProperty("value")); // Modify target; verify value is updated and that textboxes linked to the same data are updated target.Clear(); Browser.Equal("", () => boundValue.Text); - Assert.Equal("", mirrorValue.GetAttribute("value")); + Assert.Equal("", mirrorValue.GetDomProperty("value")); // Modify target; verify value is updated and that textboxes linked to the same data are updated // We have to do it this way because the browser gets in the way when sending keys to the input @@ -1513,13 +1513,13 @@ public void CanBindDateTimeLocalTextboxNullableDateTime() ApplyInputValue("#datetime-local-textbox-nullable-datetime", "2000-01-02T04:05:06"); var expected = new DateTime(2000, 1, 2, 04, 05, 06); Browser.Equal(expected, () => DateTime.Parse(boundValue.Text, CultureInfo.InvariantCulture)); - Assert.Equal(expected, DateTime.Parse(mirrorValue.GetAttribute("value"), CultureInfo.InvariantCulture)); + Assert.Equal(expected, DateTime.Parse(mirrorValue.GetDomProperty("value"), CultureInfo.InvariantCulture)); // Modify target; verify value is updated and that textboxes linked to the same data are updated target.Clear(); target.SendKeys("\t"); Browser.Equal(string.Empty, () => boundValue.Text); - Assert.Equal(string.Empty, mirrorValue.GetAttribute("value")); + Assert.Equal(string.Empty, mirrorValue.GetDomProperty("value")); } // For date comparisons, we parse (non-formatted) values to compare them. Client-side and server-side @@ -1531,23 +1531,23 @@ public void CanBindDateTimeLocalTextboxDateOnly() var boundValue = Browser.Exists(By.Id("datetime-local-textbox-dateonly-value")); var mirrorValue = Browser.Exists(By.Id("datetime-local-textbox-dateonly-mirror")); var expected = new DateOnly(1985, 3, 4); - Assert.Equal(expected, DateOnly.Parse(target.GetAttribute("value"), CultureInfo.InvariantCulture)); + Assert.Equal(expected, DateOnly.Parse(target.GetDomProperty("value"), CultureInfo.InvariantCulture)); Assert.Equal(expected, DateOnly.Parse(boundValue.Text, CultureInfo.InvariantCulture)); - Assert.Equal(expected, DateOnly.Parse(mirrorValue.GetAttribute("value"), CultureInfo.InvariantCulture)); + Assert.Equal(expected, DateOnly.Parse(mirrorValue.GetDomProperty("value"), CultureInfo.InvariantCulture)); // Clear textbox; value updates to 01/01/0001 because that's the default target.Clear(); expected = default; - Browser.Equal(expected, () => DateOnly.Parse(target.GetAttribute("value"), CultureInfo.InvariantCulture)); + Browser.Equal(expected, () => DateOnly.Parse(target.GetDomProperty("value"), CultureInfo.InvariantCulture)); Assert.Equal(expected, DateOnly.Parse(boundValue.Text, CultureInfo.InvariantCulture)); - Assert.Equal(expected, DateOnly.Parse(mirrorValue.GetAttribute("value"), CultureInfo.InvariantCulture)); + Assert.Equal(expected, DateOnly.Parse(mirrorValue.GetDomProperty("value"), CultureInfo.InvariantCulture)); // We have to do it this way because the browser gets in the way when sending keys to the input // element directly. ApplyInputValue("#datetime-local-textbox-dateonly", "2000-01-02T04:05:06"); expected = new DateOnly(2000, 1, 2); Browser.Equal(expected, () => DateOnly.Parse(boundValue.Text, CultureInfo.InvariantCulture)); - Assert.Equal(expected, DateOnly.Parse(mirrorValue.GetAttribute("value"), CultureInfo.InvariantCulture)); + Assert.Equal(expected, DateOnly.Parse(mirrorValue.GetDomProperty("value"), CultureInfo.InvariantCulture)); } // For date comparisons, we parse (non-formatted) values to compare them. Client-side and server-side @@ -1558,14 +1558,14 @@ public void CanBindDateTimeLocalTextboxNullableDateOnly() var target = Browser.Exists(By.Id("datetime-local-textbox-nullable-dateonly")); var boundValue = Browser.Exists(By.Id("datetime-local-textbox-nullable-dateonly-value")); var mirrorValue = Browser.Exists(By.Id("datetime-local-textbox-nullable-dateonly-mirror")); - Assert.Equal(string.Empty, target.GetAttribute("value")); + Assert.Equal(string.Empty, target.GetDomProperty("value")); Assert.Equal(string.Empty, boundValue.Text); - Assert.Equal(string.Empty, mirrorValue.GetAttribute("value")); + Assert.Equal(string.Empty, mirrorValue.GetDomProperty("value")); // Modify target; verify value is updated and that textboxes linked to the same data are updated target.Clear(); Browser.Equal("", () => boundValue.Text); - Assert.Equal("", mirrorValue.GetAttribute("value")); + Assert.Equal("", mirrorValue.GetDomProperty("value")); // Modify target; verify value is updated and that textboxes linked to the same data are updated // We have to do it this way because the browser gets in the way when sending keys to the input @@ -1573,13 +1573,13 @@ public void CanBindDateTimeLocalTextboxNullableDateOnly() ApplyInputValue("#datetime-local-textbox-nullable-dateonly", "2000-01-02T04:05:06"); var expected = new DateOnly(2000, 1, 2); Browser.Equal(expected, () => DateOnly.Parse(boundValue.Text, CultureInfo.InvariantCulture)); - Assert.Equal(expected, DateOnly.Parse(mirrorValue.GetAttribute("value"), CultureInfo.InvariantCulture)); + Assert.Equal(expected, DateOnly.Parse(mirrorValue.GetDomProperty("value"), CultureInfo.InvariantCulture)); // Modify target; verify value is updated and that textboxes linked to the same data are updated target.Clear(); target.SendKeys("\t"); Browser.Equal(string.Empty, () => boundValue.Text); - Assert.Equal(string.Empty, mirrorValue.GetAttribute("value")); + Assert.Equal(string.Empty, mirrorValue.GetDomProperty("value")); } // For date comparisons, we parse (non-formatted) values to compare them. Client-side and server-side @@ -1591,23 +1591,23 @@ public void CanBindDateTimeLocalTextboxTimeOnly() var boundValue = Browser.Exists(By.Id("datetime-local-textbox-timeonly-value")); var mirrorValue = Browser.Exists(By.Id("datetime-local-textbox-timeonly-mirror")); var expected = new TimeOnly(8, 5); - Assert.Equal(expected, TimeOnly.Parse(target.GetAttribute("value"), CultureInfo.InvariantCulture)); + Assert.Equal(expected, TimeOnly.Parse(target.GetDomProperty("value"), CultureInfo.InvariantCulture)); Assert.Equal(expected, TimeOnly.Parse(boundValue.Text, CultureInfo.InvariantCulture)); - Assert.Equal(expected, TimeOnly.Parse(mirrorValue.GetAttribute("value"), CultureInfo.InvariantCulture)); + Assert.Equal(expected, TimeOnly.Parse(mirrorValue.GetDomProperty("value"), CultureInfo.InvariantCulture)); // Clear textbox; value updates to 00:00 because that's the default target.Clear(); expected = default; - Browser.Equal(expected, () => TimeOnly.Parse(target.GetAttribute("value"), CultureInfo.InvariantCulture)); + Browser.Equal(expected, () => TimeOnly.Parse(target.GetDomProperty("value"), CultureInfo.InvariantCulture)); Assert.Equal(expected, TimeOnly.Parse(boundValue.Text, CultureInfo.InvariantCulture)); - Assert.Equal(expected, TimeOnly.Parse(mirrorValue.GetAttribute("value"), CultureInfo.InvariantCulture)); + Assert.Equal(expected, TimeOnly.Parse(mirrorValue.GetDomProperty("value"), CultureInfo.InvariantCulture)); // We have to do it this way because the browser gets in the way when sending keys to the input // element directly. ApplyInputValue("#datetime-local-textbox-timeonly", "2000-01-02T04:05:00"); expected = new TimeOnly(4, 5); Browser.Equal(expected, () => TimeOnly.Parse(boundValue.Text, CultureInfo.InvariantCulture)); - Assert.Equal(expected, TimeOnly.Parse(mirrorValue.GetAttribute("value"), CultureInfo.InvariantCulture)); + Assert.Equal(expected, TimeOnly.Parse(mirrorValue.GetDomProperty("value"), CultureInfo.InvariantCulture)); } // For date comparisons, we parse (non-formatted) values to compare them. Client-side and server-side @@ -1618,14 +1618,14 @@ public void CanBindDateTimeLocalTextboxNullableTimeOnly() var target = Browser.Exists(By.Id("datetime-local-textbox-nullable-timeonly")); var boundValue = Browser.Exists(By.Id("datetime-local-textbox-nullable-timeonly-value")); var mirrorValue = Browser.Exists(By.Id("datetime-local-textbox-nullable-timeonly-mirror")); - Assert.Equal(string.Empty, target.GetAttribute("value")); + Assert.Equal(string.Empty, target.GetDomProperty("value")); Assert.Equal(string.Empty, boundValue.Text); - Assert.Equal(string.Empty, mirrorValue.GetAttribute("value")); + Assert.Equal(string.Empty, mirrorValue.GetDomProperty("value")); // Modify target; verify value is updated and that textboxes linked to the same data are updated target.Clear(); Browser.Equal("", () => boundValue.Text); - Assert.Equal("", mirrorValue.GetAttribute("value")); + Assert.Equal("", mirrorValue.GetDomProperty("value")); // Modify target; verify value is updated and that textboxes linked to the same data are updated // We have to do it this way because the browser gets in the way when sending keys to the input @@ -1633,13 +1633,13 @@ public void CanBindDateTimeLocalTextboxNullableTimeOnly() ApplyInputValue("#datetime-local-textbox-nullable-timeonly", "2000-01-02T04:05:00"); var expected = new TimeOnly(4, 5); Browser.Equal(expected, () => TimeOnly.Parse(boundValue.Text, CultureInfo.InvariantCulture)); - Assert.Equal(expected, TimeOnly.Parse(mirrorValue.GetAttribute("value"), CultureInfo.InvariantCulture)); + Assert.Equal(expected, TimeOnly.Parse(mirrorValue.GetDomProperty("value"), CultureInfo.InvariantCulture)); // Modify target; verify value is updated and that textboxes linked to the same data are updated target.Clear(); target.SendKeys("\t"); Browser.Equal(string.Empty, () => boundValue.Text); - Assert.Equal(string.Empty, mirrorValue.GetAttribute("value")); + Assert.Equal(string.Empty, mirrorValue.GetDomProperty("value")); } // For date comparisons, we parse (non-formatted) values to compare them. Client-side and server-side @@ -1651,25 +1651,25 @@ public void CanBindMonthTextboxDateTime() var boundValue = Browser.Exists(By.Id("month-textbox-datetime-value")); var mirrorValue = Browser.Exists(By.Id("month-textbox-datetime-mirror")); var expected = new DateTime(1985, 3, 1); - Assert.Equal(expected, DateTime.Parse(target.GetAttribute("value"), CultureInfo.InvariantCulture)); + Assert.Equal(expected, DateTime.Parse(target.GetDomProperty("value"), CultureInfo.InvariantCulture)); // When the value gets displayed the first time it gets truncated to the 1st day, // until there is no change the bound value doesn't get updated. Assert.Equal(expected.AddDays(3), DateTime.Parse(boundValue.Text, CultureInfo.InvariantCulture)); - Assert.Equal(expected.AddDays(3), DateTime.Parse(mirrorValue.GetAttribute("value"), CultureInfo.InvariantCulture)); + Assert.Equal(expected.AddDays(3), DateTime.Parse(mirrorValue.GetDomProperty("value"), CultureInfo.InvariantCulture)); // Clear textbox; value updates to 01/01/0001 because that's the default target.Clear(); expected = default; - Browser.Equal(expected, () => DateTime.Parse(target.GetAttribute("value"), CultureInfo.InvariantCulture)); + Browser.Equal(expected, () => DateTime.Parse(target.GetDomProperty("value"), CultureInfo.InvariantCulture)); Assert.Equal(expected, DateTime.Parse(boundValue.Text, CultureInfo.InvariantCulture)); - Assert.Equal(expected, DateTime.Parse(mirrorValue.GetAttribute("value"), CultureInfo.InvariantCulture)); + Assert.Equal(expected, DateTime.Parse(mirrorValue.GetDomProperty("value"), CultureInfo.InvariantCulture)); // We have to do it this way because the browser gets in the way when sending keys to the input // element directly. ApplyInputValue("#month-textbox-datetime", "2000-02"); expected = new DateTime(2000, 2, 1); Browser.Equal(expected, () => DateTime.Parse(boundValue.Text, CultureInfo.InvariantCulture)); - Assert.Equal(expected, DateTime.Parse(mirrorValue.GetAttribute("value"), CultureInfo.InvariantCulture)); + Assert.Equal(expected, DateTime.Parse(mirrorValue.GetDomProperty("value"), CultureInfo.InvariantCulture)); } // For date comparisons, we parse (non-formatted) values to compare them. Client-side and server-side @@ -1680,14 +1680,14 @@ public void CanBindMonthTextboxNullableDateTime() var target = Browser.Exists(By.Id("month-textbox-nullable-datetime")); var boundValue = Browser.Exists(By.Id("month-textbox-nullable-datetime-value")); var mirrorValue = Browser.Exists(By.Id("month-textbox-nullable-datetime-mirror")); - Assert.Equal(string.Empty, target.GetAttribute("value")); + Assert.Equal(string.Empty, target.GetDomProperty("value")); Assert.Equal(string.Empty, boundValue.Text); - Assert.Equal(string.Empty, mirrorValue.GetAttribute("value")); + Assert.Equal(string.Empty, mirrorValue.GetDomProperty("value")); // Modify target; verify value is updated and that textboxes linked to the same data are updated target.Clear(); Browser.Equal("", () => boundValue.Text); - Assert.Equal("", mirrorValue.GetAttribute("value")); + Assert.Equal("", mirrorValue.GetDomProperty("value")); // Modify target; verify value is updated and that textboxes linked to the same data are updated // We have to do it this way because the browser gets in the way when sending keys to the input @@ -1695,13 +1695,13 @@ public void CanBindMonthTextboxNullableDateTime() ApplyInputValue("#month-textbox-nullable-datetime", "2000-02"); var expected = new DateTime(2000, 2, 1); Browser.Equal(expected, () => DateTime.Parse(boundValue.Text, CultureInfo.InvariantCulture)); - Assert.Equal(expected, DateTime.Parse(mirrorValue.GetAttribute("value"), CultureInfo.InvariantCulture)); + Assert.Equal(expected, DateTime.Parse(mirrorValue.GetDomProperty("value"), CultureInfo.InvariantCulture)); // Modify target; verify value is updated and that textboxes linked to the same data are updated target.Clear(); target.SendKeys("\t"); Browser.Equal(string.Empty, () => boundValue.Text); - Assert.Equal(string.Empty, mirrorValue.GetAttribute("value")); + Assert.Equal(string.Empty, mirrorValue.GetDomProperty("value")); } // For date comparisons, we parse (non-formatted) values to compare them. Client-side and server-side @@ -1713,25 +1713,25 @@ public void CanBindMonthTextboxDateOnly() var boundValue = Browser.Exists(By.Id("month-textbox-dateonly-value")); var mirrorValue = Browser.Exists(By.Id("month-textbox-dateonly-mirror")); var expected = new DateOnly(1985, 3, 1); - Assert.Equal(expected, DateOnly.Parse(target.GetAttribute("value"), CultureInfo.InvariantCulture)); + Assert.Equal(expected, DateOnly.Parse(target.GetDomProperty("value"), CultureInfo.InvariantCulture)); // When the value gets displayed the first time it gets truncated to the 1st day, // until there is no change the bound value doesn't get updated. Assert.Equal(expected.AddDays(3), DateOnly.Parse(boundValue.Text, CultureInfo.InvariantCulture)); - Assert.Equal(expected.AddDays(3), DateOnly.Parse(mirrorValue.GetAttribute("value"), CultureInfo.InvariantCulture)); + Assert.Equal(expected.AddDays(3), DateOnly.Parse(mirrorValue.GetDomProperty("value"), CultureInfo.InvariantCulture)); // Clear textbox; value updates to 01/01/0001 because that's the default target.Clear(); expected = default; - Browser.Equal(expected, () => DateOnly.Parse(target.GetAttribute("value"), CultureInfo.InvariantCulture)); + Browser.Equal(expected, () => DateOnly.Parse(target.GetDomProperty("value"), CultureInfo.InvariantCulture)); Assert.Equal(expected, DateOnly.Parse(boundValue.Text, CultureInfo.InvariantCulture)); - Assert.Equal(expected, DateOnly.Parse(mirrorValue.GetAttribute("value"), CultureInfo.InvariantCulture)); + Assert.Equal(expected, DateOnly.Parse(mirrorValue.GetDomProperty("value"), CultureInfo.InvariantCulture)); // We have to do it this way because the browser gets in the way when sending keys to the input // element directly. ApplyInputValue("#month-textbox-dateonly", "2000-02"); expected = new DateOnly(2000, 2, 1); Browser.Equal(expected, () => DateOnly.Parse(boundValue.Text, CultureInfo.InvariantCulture)); - Assert.Equal(expected, DateOnly.Parse(mirrorValue.GetAttribute("value"), CultureInfo.InvariantCulture)); + Assert.Equal(expected, DateOnly.Parse(mirrorValue.GetDomProperty("value"), CultureInfo.InvariantCulture)); } // For date comparisons, we parse (non-formatted) values to compare them. Client-side and server-side @@ -1742,14 +1742,14 @@ public void CanBindMonthTextboxNullableDateOnly() var target = Browser.Exists(By.Id("month-textbox-nullable-dateonly")); var boundValue = Browser.Exists(By.Id("month-textbox-nullable-dateonly-value")); var mirrorValue = Browser.Exists(By.Id("month-textbox-nullable-dateonly-mirror")); - Assert.Equal(string.Empty, target.GetAttribute("value")); + Assert.Equal(string.Empty, target.GetDomProperty("value")); Assert.Equal(string.Empty, boundValue.Text); - Assert.Equal(string.Empty, mirrorValue.GetAttribute("value")); + Assert.Equal(string.Empty, mirrorValue.GetDomProperty("value")); // Modify target; verify value is updated and that textboxes linked to the same data are updated target.Clear(); Browser.Equal("", () => boundValue.Text); - Assert.Equal("", mirrorValue.GetAttribute("value")); + Assert.Equal("", mirrorValue.GetDomProperty("value")); // Modify target; verify value is updated and that textboxes linked to the same data are updated // We have to do it this way because the browser gets in the way when sending keys to the input @@ -1757,13 +1757,13 @@ public void CanBindMonthTextboxNullableDateOnly() ApplyInputValue("#month-textbox-nullable-dateonly", "2000-02"); var expected = new DateOnly(2000, 2, 1); Browser.Equal(expected, () => DateOnly.Parse(boundValue.Text, CultureInfo.InvariantCulture)); - Assert.Equal(expected, DateOnly.Parse(mirrorValue.GetAttribute("value"), CultureInfo.InvariantCulture)); + Assert.Equal(expected, DateOnly.Parse(mirrorValue.GetDomProperty("value"), CultureInfo.InvariantCulture)); // Modify target; verify value is updated and that textboxes linked to the same data are updated target.Clear(); target.SendKeys("\t"); Browser.Equal(string.Empty, () => boundValue.Text); - Assert.Equal(string.Empty, mirrorValue.GetAttribute("value")); + Assert.Equal(string.Empty, mirrorValue.GetDomProperty("value")); } // For date comparisons, we parse (non-formatted) values to compare them. Client-side and server-side @@ -1775,23 +1775,23 @@ public void CanBindTimeTextboxDateTime() var boundValue = Browser.Exists(By.Id("time-textbox-datetime-value")); var mirrorValue = Browser.Exists(By.Id("time-textbox-datetime-mirror")); var expected = DateTime.Now.Date.AddHours(8).AddMinutes(5); - Assert.Equal(expected, DateTime.Parse(target.GetAttribute("value"), CultureInfo.InvariantCulture)); + Assert.Equal(expected, DateTime.Parse(target.GetDomProperty("value"), CultureInfo.InvariantCulture)); Assert.Equal(expected, DateTime.Parse(boundValue.Text, CultureInfo.InvariantCulture)); - Assert.Equal(expected, DateTime.Parse(mirrorValue.GetAttribute("value"), CultureInfo.InvariantCulture)); + Assert.Equal(expected, DateTime.Parse(mirrorValue.GetDomProperty("value"), CultureInfo.InvariantCulture)); // Clear textbox; value updates to 00:00 because that's the default target.Clear(); expected = default; - Browser.Equal(DateTime.Now.Date, () => DateTime.Parse(target.GetAttribute("value"), CultureInfo.InvariantCulture)); + Browser.Equal(DateTime.Now.Date, () => DateTime.Parse(target.GetDomProperty("value"), CultureInfo.InvariantCulture)); Assert.Equal(default, DateTime.Parse(boundValue.Text, CultureInfo.InvariantCulture)); - Assert.Equal(default, DateTime.Parse(mirrorValue.GetAttribute("value"), CultureInfo.InvariantCulture)); + Assert.Equal(default, DateTime.Parse(mirrorValue.GetDomProperty("value"), CultureInfo.InvariantCulture)); // We have to do it this way because the browser gets in the way when sending keys to the input // element directly. ApplyInputValue("#time-textbox-datetime", "04:05"); expected = DateTime.Now.Date.Add(new TimeSpan(4, 5, 0)); Browser.Equal(expected, () => DateTime.Parse(boundValue.Text, CultureInfo.InvariantCulture)); - Assert.Equal(expected, DateTime.Parse(mirrorValue.GetAttribute("value"), CultureInfo.InvariantCulture)); + Assert.Equal(expected, DateTime.Parse(mirrorValue.GetDomProperty("value"), CultureInfo.InvariantCulture)); } // For date comparisons, we parse (non-formatted) values to compare them. Client-side and server-side @@ -1802,14 +1802,14 @@ public void CanBindTimeTextboxNullableDateTime() var target = Browser.Exists(By.Id("time-textbox-nullable-datetime")); var boundValue = Browser.Exists(By.Id("time-textbox-nullable-datetime-value")); var mirrorValue = Browser.Exists(By.Id("time-textbox-nullable-datetime-mirror")); - Assert.Equal(string.Empty, target.GetAttribute("value")); + Assert.Equal(string.Empty, target.GetDomProperty("value")); Assert.Equal(string.Empty, boundValue.Text); - Assert.Equal(string.Empty, mirrorValue.GetAttribute("value")); + Assert.Equal(string.Empty, mirrorValue.GetDomProperty("value")); // Modify target; verify value is updated and that textboxes linked to the same data are updated target.Clear(); Browser.Equal("", () => boundValue.Text); - Assert.Equal("", mirrorValue.GetAttribute("value")); + Assert.Equal("", mirrorValue.GetDomProperty("value")); // Modify target; verify value is updated and that textboxes linked to the same data are updated // We have to do it this way because the browser gets in the way when sending keys to the input @@ -1817,13 +1817,13 @@ public void CanBindTimeTextboxNullableDateTime() ApplyInputValue("#time-textbox-nullable-datetime", "05:06"); var expected = DateTime.Now.Date.Add(new TimeSpan(05, 06, 0)); Browser.Equal(expected, () => DateTime.Parse(boundValue.Text, CultureInfo.InvariantCulture)); - Assert.Equal(expected, DateTime.Parse(mirrorValue.GetAttribute("value"), CultureInfo.InvariantCulture)); + Assert.Equal(expected, DateTime.Parse(mirrorValue.GetDomProperty("value"), CultureInfo.InvariantCulture)); // Modify target; verify value is updated and that textboxes linked to the same data are updated target.Clear(); target.SendKeys("\t"); Browser.Equal(string.Empty, () => boundValue.Text); - Assert.Equal(string.Empty, mirrorValue.GetAttribute("value")); + Assert.Equal(string.Empty, mirrorValue.GetDomProperty("value")); } // For date comparisons, we parse (non-formatted) values to compare them. Client-side and server-side @@ -1835,23 +1835,23 @@ public void CanBindTimeTextboxTimeOnly() var boundValue = Browser.Exists(By.Id("time-textbox-timeonly-value")); var mirrorValue = Browser.Exists(By.Id("time-textbox-timeonly-mirror")); var expected = new TimeOnly(8, 5); - Assert.Equal(expected, TimeOnly.Parse(target.GetAttribute("value"), CultureInfo.InvariantCulture)); + Assert.Equal(expected, TimeOnly.Parse(target.GetDomProperty("value"), CultureInfo.InvariantCulture)); Assert.Equal(expected, TimeOnly.Parse(boundValue.Text, CultureInfo.InvariantCulture)); - Assert.Equal(expected, TimeOnly.Parse(mirrorValue.GetAttribute("value"), CultureInfo.InvariantCulture)); + Assert.Equal(expected, TimeOnly.Parse(mirrorValue.GetDomProperty("value"), CultureInfo.InvariantCulture)); // Clear textbox; value updates to 00:00 because that's the default target.Clear(); expected = default; - Browser.Equal(TimeOnly.MinValue, () => TimeOnly.Parse(target.GetAttribute("value"), CultureInfo.InvariantCulture)); + Browser.Equal(TimeOnly.MinValue, () => TimeOnly.Parse(target.GetDomProperty("value"), CultureInfo.InvariantCulture)); Assert.Equal(default, TimeOnly.Parse(boundValue.Text, CultureInfo.InvariantCulture)); - Assert.Equal(default, TimeOnly.Parse(mirrorValue.GetAttribute("value"), CultureInfo.InvariantCulture)); + Assert.Equal(default, TimeOnly.Parse(mirrorValue.GetDomProperty("value"), CultureInfo.InvariantCulture)); // We have to do it this way because the browser gets in the way when sending keys to the input // element directly. ApplyInputValue("#time-textbox-timeonly", "04:05"); expected = new TimeOnly(4, 5); Browser.Equal(expected, () => TimeOnly.Parse(boundValue.Text, CultureInfo.InvariantCulture)); - Assert.Equal(expected, TimeOnly.Parse(mirrorValue.GetAttribute("value"), CultureInfo.InvariantCulture)); + Assert.Equal(expected, TimeOnly.Parse(mirrorValue.GetDomProperty("value"), CultureInfo.InvariantCulture)); } // For date comparisons, we parse (non-formatted) values to compare them. Client-side and server-side @@ -1862,14 +1862,14 @@ public void CanBindTimeTextboxNullableTimeOnly() var target = Browser.Exists(By.Id("time-textbox-nullable-timeonly")); var boundValue = Browser.Exists(By.Id("time-textbox-nullable-timeonly-value")); var mirrorValue = Browser.Exists(By.Id("time-textbox-nullable-timeonly-mirror")); - Assert.Equal(string.Empty, target.GetAttribute("value")); + Assert.Equal(string.Empty, target.GetDomProperty("value")); Assert.Equal(string.Empty, boundValue.Text); - Assert.Equal(string.Empty, mirrorValue.GetAttribute("value")); + Assert.Equal(string.Empty, mirrorValue.GetDomProperty("value")); // Modify target; verify value is updated and that textboxes linked to the same data are updated target.Clear(); Browser.Equal("", () => boundValue.Text); - Assert.Equal("", mirrorValue.GetAttribute("value")); + Assert.Equal("", mirrorValue.GetDomProperty("value")); // Modify target; verify value is updated and that textboxes linked to the same data are updated // We have to do it this way because the browser gets in the way when sending keys to the input @@ -1877,13 +1877,13 @@ public void CanBindTimeTextboxNullableTimeOnly() ApplyInputValue("#time-textbox-nullable-timeonly", "05:06"); var expected = new TimeOnly(5, 6); Browser.Equal(expected, () => TimeOnly.Parse(boundValue.Text, CultureInfo.InvariantCulture)); - Assert.Equal(expected, TimeOnly.Parse(mirrorValue.GetAttribute("value"), CultureInfo.InvariantCulture)); + Assert.Equal(expected, TimeOnly.Parse(mirrorValue.GetDomProperty("value"), CultureInfo.InvariantCulture)); // Modify target; verify value is updated and that textboxes linked to the same data are updated target.Clear(); target.SendKeys("\t"); Browser.Equal(string.Empty, () => boundValue.Text); - Assert.Equal(string.Empty, mirrorValue.GetAttribute("value")); + Assert.Equal(string.Empty, mirrorValue.GetDomProperty("value")); } // For date comparisons, we parse (non-formatted) values to compare them. Client-side and server-side @@ -1895,23 +1895,23 @@ public void CanBindTimeStepTextboxDateTime() var boundValue = Browser.Exists(By.Id("time-step-textbox-datetime-value")); var mirrorValue = Browser.Exists(By.Id("time-step-textbox-datetime-mirror")); var expected = DateTime.Now.Date.Add(new TimeSpan(8, 5, 30)); - Assert.Equal(expected, DateTime.Parse(target.GetAttribute("value"), CultureInfo.InvariantCulture)); + Assert.Equal(expected, DateTime.Parse(target.GetDomProperty("value"), CultureInfo.InvariantCulture)); Assert.Equal(expected, DateTime.Parse(boundValue.Text, CultureInfo.InvariantCulture)); - Assert.Equal(expected, DateTime.Parse(mirrorValue.GetAttribute("value"), CultureInfo.InvariantCulture)); + Assert.Equal(expected, DateTime.Parse(mirrorValue.GetDomProperty("value"), CultureInfo.InvariantCulture)); // Clear textbox; value updates to 00:00 because that's the default target.Clear(); expected = default; - Browser.Equal(DateTime.Now.Date, () => DateTime.Parse(target.GetAttribute("value"), CultureInfo.InvariantCulture)); + Browser.Equal(DateTime.Now.Date, () => DateTime.Parse(target.GetDomProperty("value"), CultureInfo.InvariantCulture)); Assert.Equal(default, DateTime.Parse(boundValue.Text, CultureInfo.InvariantCulture)); - Assert.Equal(default, DateTime.Parse(mirrorValue.GetAttribute("value"), CultureInfo.InvariantCulture)); + Assert.Equal(default, DateTime.Parse(mirrorValue.GetDomProperty("value"), CultureInfo.InvariantCulture)); // We have to do it this way because the browser gets in the way when sending keys to the input // element directly. ApplyInputValue("#time-step-textbox-datetime", "04:05:06"); expected = DateTime.Now.Date.Add(new TimeSpan(4, 5, 6)); Browser.Equal(expected, () => DateTime.Parse(boundValue.Text, CultureInfo.InvariantCulture)); - Assert.Equal(expected, DateTime.Parse(mirrorValue.GetAttribute("value"), CultureInfo.InvariantCulture)); + Assert.Equal(expected, DateTime.Parse(mirrorValue.GetDomProperty("value"), CultureInfo.InvariantCulture)); } // For date comparisons, we parse (non-formatted) values to compare them. Client-side and server-side @@ -1922,14 +1922,14 @@ public void CanBindTimeStepTextboxNullableDateTime() var target = Browser.Exists(By.Id("time-step-textbox-nullable-datetime")); var boundValue = Browser.Exists(By.Id("time-step-textbox-nullable-datetime-value")); var mirrorValue = Browser.Exists(By.Id("time-step-textbox-nullable-datetime-mirror")); - Assert.Equal(string.Empty, target.GetAttribute("value")); + Assert.Equal(string.Empty, target.GetDomProperty("value")); Assert.Equal(string.Empty, boundValue.Text); - Assert.Equal(string.Empty, mirrorValue.GetAttribute("value")); + Assert.Equal(string.Empty, mirrorValue.GetDomProperty("value")); // Modify target; verify value is updated and that textboxes linked to the same data are updated target.Clear(); Browser.Equal("", () => boundValue.Text); - Assert.Equal("", mirrorValue.GetAttribute("value")); + Assert.Equal("", mirrorValue.GetDomProperty("value")); // Modify target; verify value is updated and that textboxes linked to the same data are updated // We have to do it this way because the browser gets in the way when sending keys to the input @@ -1937,13 +1937,13 @@ public void CanBindTimeStepTextboxNullableDateTime() ApplyInputValue("#time-step-textbox-nullable-datetime", "05:06"); var expected = DateTime.Now.Date.Add(new TimeSpan(05, 06, 0)); Browser.Equal(expected, () => DateTime.Parse(boundValue.Text, CultureInfo.InvariantCulture)); - Assert.Equal(expected, DateTime.Parse(mirrorValue.GetAttribute("value"), CultureInfo.InvariantCulture)); + Assert.Equal(expected, DateTime.Parse(mirrorValue.GetDomProperty("value"), CultureInfo.InvariantCulture)); // Modify target; verify value is updated and that textboxes linked to the same data are updated target.Clear(); target.SendKeys("\t"); Browser.Equal(string.Empty, () => boundValue.Text); - Assert.Equal(string.Empty, mirrorValue.GetAttribute("value")); + Assert.Equal(string.Empty, mirrorValue.GetDomProperty("value")); } // For date comparisons, we parse (non-formatted) values to compare them. Client-side and server-side @@ -1955,23 +1955,23 @@ public void CanBindTimeStepTextboxTimeOnly() var boundValue = Browser.Exists(By.Id("time-step-textbox-timeonly-value")); var mirrorValue = Browser.Exists(By.Id("time-step-textbox-timeonly-mirror")); var expected = new TimeOnly(8, 5, 30); - Assert.Equal(expected, TimeOnly.Parse(target.GetAttribute("value"), CultureInfo.InvariantCulture)); + Assert.Equal(expected, TimeOnly.Parse(target.GetDomProperty("value"), CultureInfo.InvariantCulture)); Assert.Equal(expected, TimeOnly.Parse(boundValue.Text, CultureInfo.InvariantCulture)); - Assert.Equal(expected, TimeOnly.Parse(mirrorValue.GetAttribute("value"), CultureInfo.InvariantCulture)); + Assert.Equal(expected, TimeOnly.Parse(mirrorValue.GetDomProperty("value"), CultureInfo.InvariantCulture)); // Clear textbox; value updates to 00:00 because that's the default target.Clear(); expected = default; - Browser.Equal(TimeOnly.MinValue, () => TimeOnly.Parse(target.GetAttribute("value"), CultureInfo.InvariantCulture)); + Browser.Equal(TimeOnly.MinValue, () => TimeOnly.Parse(target.GetDomProperty("value"), CultureInfo.InvariantCulture)); Assert.Equal(default, TimeOnly.Parse(boundValue.Text, CultureInfo.InvariantCulture)); - Assert.Equal(default, TimeOnly.Parse(mirrorValue.GetAttribute("value"), CultureInfo.InvariantCulture)); + Assert.Equal(default, TimeOnly.Parse(mirrorValue.GetDomProperty("value"), CultureInfo.InvariantCulture)); // We have to do it this way because the browser gets in the way when sending keys to the input // element directly. ApplyInputValue("#time-step-textbox-timeonly", "04:05:06"); expected = new TimeOnly(4, 5, 6); Browser.Equal(expected, () => TimeOnly.Parse(boundValue.Text, CultureInfo.InvariantCulture)); - Assert.Equal(expected, TimeOnly.Parse(mirrorValue.GetAttribute("value"), CultureInfo.InvariantCulture)); + Assert.Equal(expected, TimeOnly.Parse(mirrorValue.GetDomProperty("value"), CultureInfo.InvariantCulture)); } // For date comparisons, we parse (non-formatted) values to compare them. Client-side and server-side @@ -1982,14 +1982,14 @@ public void CanBindTimeStepTextboxNullableTimeOnly() var target = Browser.Exists(By.Id("time-step-textbox-nullable-timeonly")); var boundValue = Browser.Exists(By.Id("time-step-textbox-nullable-timeonly-value")); var mirrorValue = Browser.Exists(By.Id("time-step-textbox-nullable-timeonly-mirror")); - Assert.Equal(string.Empty, target.GetAttribute("value")); + Assert.Equal(string.Empty, target.GetDomProperty("value")); Assert.Equal(string.Empty, boundValue.Text); - Assert.Equal(string.Empty, mirrorValue.GetAttribute("value")); + Assert.Equal(string.Empty, mirrorValue.GetDomProperty("value")); // Modify target; verify value is updated and that textboxes linked to the same data are updated target.Clear(); Browser.Equal("", () => boundValue.Text); - Assert.Equal("", mirrorValue.GetAttribute("value")); + Assert.Equal("", mirrorValue.GetDomProperty("value")); // Modify target; verify value is updated and that textboxes linked to the same data are updated // We have to do it this way because the browser gets in the way when sending keys to the input @@ -1997,13 +1997,13 @@ public void CanBindTimeStepTextboxNullableTimeOnly() ApplyInputValue("#time-step-textbox-nullable-timeonly", "05:06"); var expected = new TimeOnly(5, 6); Browser.Equal(expected, () => TimeOnly.Parse(boundValue.Text, CultureInfo.InvariantCulture)); - Assert.Equal(expected, TimeOnly.Parse(mirrorValue.GetAttribute("value"), CultureInfo.InvariantCulture)); + Assert.Equal(expected, TimeOnly.Parse(mirrorValue.GetDomProperty("value"), CultureInfo.InvariantCulture)); // Modify target; verify value is updated and that textboxes linked to the same data are updated target.Clear(); target.SendKeys("\t"); Browser.Equal(string.Empty, () => boundValue.Text); - Assert.Equal(string.Empty, mirrorValue.GetAttribute("value")); + Assert.Equal(string.Empty, mirrorValue.GetDomProperty("value")); } [Fact] @@ -2016,12 +2016,12 @@ public void CanBindDateTimeLocalDefaultStepTextboxDateTime() var target = Browser.Exists(By.Id("datetime-local-default-step-textbox-datetime")); var boundValue = Browser.Exists(By.Id("datetime-local-default-step-textbox-datetime-value")); var expected = DateTime.Now.Date.Add(new TimeSpan(8, 5, 0)); // Notice the "seconds" part is zero here, even though the original data has seconds=30 - Assert.Equal(expected, DateTime.Parse(target.GetAttribute("value"), CultureInfo.InvariantCulture)); + Assert.Equal(expected, DateTime.Parse(target.GetDomProperty("value"), CultureInfo.InvariantCulture)); // Clear textbox; value updates to 00:00 because that's the default target.Clear(); expected = default; - Browser.Equal(default, () => DateTime.Parse(target.GetAttribute("value"), CultureInfo.InvariantCulture)); + Browser.Equal(default, () => DateTime.Parse(target.GetDomProperty("value"), CultureInfo.InvariantCulture)); Assert.Equal(default, DateTime.Parse(boundValue.Text, CultureInfo.InvariantCulture)); // We have to do it this way because the browser gets in the way when sending keys to the input element directly. @@ -2040,12 +2040,12 @@ public void CanBindTimeDefaultStepTextboxDateTime() var target = Browser.Exists(By.Id("time-default-step-textbox-datetime")); var boundValue = Browser.Exists(By.Id("time-default-step-textbox-datetime-value")); var expected = DateTime.Now.Date.Add(new TimeSpan(8, 5, 0)); // Notice the "seconds" part is zero here, even though the original data has seconds=30 - Assert.Equal(expected, DateTime.Parse(target.GetAttribute("value"), CultureInfo.InvariantCulture)); + Assert.Equal(expected, DateTime.Parse(target.GetDomProperty("value"), CultureInfo.InvariantCulture)); // Clear textbox; value updates to 00:00 because that's the default target.Clear(); expected = default; - Browser.Equal(DateTime.Now.Date, () => DateTime.Parse(target.GetAttribute("value"), CultureInfo.InvariantCulture)); + Browser.Equal(DateTime.Now.Date, () => DateTime.Parse(target.GetDomProperty("value"), CultureInfo.InvariantCulture)); Assert.Equal(default, DateTime.Parse(boundValue.Text, CultureInfo.InvariantCulture)); // We have to do it this way because the browser gets in the way when sending keys to the input element directly. @@ -2064,12 +2064,12 @@ public void CanBindTimeDefaultStepTextboxTimeOnly() var target = Browser.Exists(By.Id("time-default-step-textbox-timeonly")); var boundValue = Browser.Exists(By.Id("time-default-step-textbox-timeonly-value")); var expected = new TimeOnly(8, 5, 0); // Notice the "seconds" part is zero here, even though the original data has seconds=30 - Assert.Equal(expected, TimeOnly.Parse(target.GetAttribute("value"), CultureInfo.InvariantCulture)); + Assert.Equal(expected, TimeOnly.Parse(target.GetDomProperty("value"), CultureInfo.InvariantCulture)); // Clear textbox; value updates to 00:00 because that's the default target.Clear(); expected = default; - Browser.Equal(default, () => TimeOnly.Parse(target.GetAttribute("value"), CultureInfo.InvariantCulture)); + Browser.Equal(default, () => TimeOnly.Parse(target.GetDomProperty("value"), CultureInfo.InvariantCulture)); Assert.Equal(default, TimeOnly.Parse(boundValue.Text, CultureInfo.InvariantCulture)); // We have to do it this way because the browser gets in the way when sending keys to the input element directly. diff --git a/src/Components/test/E2ETest/Tests/ClientRenderingMultpleComponentsTest.cs b/src/Components/test/E2ETest/Tests/ClientRenderingMultpleComponentsTest.cs index 73033fc25459..5492d8bb8cdc 100644 --- a/src/Components/test/E2ETest/Tests/ClientRenderingMultpleComponentsTest.cs +++ b/src/Components/test/E2ETest/Tests/ClientRenderingMultpleComponentsTest.cs @@ -51,7 +51,7 @@ public void CanRenderMultipleRootComponents() Assert.Single(greets, "Hello Abraham"); Assert.Equal(2, greets.Where(g => g == "Hello Blue fish").Count()); Assert.Equal(3, greets.Where(g => string.Equals("Hello", g)).Count()); // 3 server prerendered without parameters - var content = Browser.Exists(By.Id("test-container")).GetAttribute("innerHTML"); + var content = Browser.Exists(By.Id("test-container")).GetDomProperty("innerHTML"); var markers = ReadMarkers(content); var componentSequence = markers.Select(m => m.Item1.PrerenderId != null).ToArray(); Assert.Equal(13, componentSequence.Length); diff --git a/src/Components/test/E2ETest/Tests/ComponentRenderingTestBase.cs b/src/Components/test/E2ETest/Tests/ComponentRenderingTestBase.cs index c27d04d06ec2..92552b7ddc42 100644 --- a/src/Components/test/E2ETest/Tests/ComponentRenderingTestBase.cs +++ b/src/Components/test/E2ETest/Tests/ComponentRenderingTestBase.cs @@ -51,7 +51,7 @@ public void CanRenderComponentWithDataDash() { var appElement = Browser.MountTestComponent(); var element = appElement.FindElement(By.Id("cool_beans")); - Assert.Equal("17", element.GetAttribute("data-tab")); + Assert.Equal("17", element.GetDomAttribute("data-tab")); Assert.Equal("17", element.Text); } @@ -61,8 +61,8 @@ public void CanRenderComponentWithAttributes() var appElement = Browser.MountTestComponent(); var styledElement = appElement.FindElement(By.TagName("h1")); Assert.Equal("Hello, world!", styledElement.Text); - Assert.Equal("color: red;", styledElement.GetAttribute("style")); - Assert.Equal("somevalue", styledElement.GetAttribute("customattribute")); + Assert.Equal("color: red;", styledElement.GetDomAttribute("style")); + Assert.Equal("somevalue", styledElement.GetDomAttribute("customattribute")); } [Fact] @@ -117,7 +117,7 @@ public void CanTriggerKeyPressEvents() li => Assert.Equal("b", li.Text)); // Textbox contains typed text - Assert.Equal("ab", inputElement.GetAttribute("value")); + Assert.Equal("ab", inputElement.GetDomProperty("value")); } [Fact] @@ -155,8 +155,8 @@ public void CanRenderChildComponents() var styledElement = appElement.FindElement(By.CssSelector("fieldset > h1")); Assert.Equal("Hello, world!", styledElement.Text); - Assert.Equal("color: red;", styledElement.GetAttribute("style")); - Assert.Equal("somevalue", styledElement.GetAttribute("customattribute")); + Assert.Equal("color: red;", styledElement.GetDomAttribute("style")); + Assert.Equal("somevalue", styledElement.GetDomAttribute("customattribute")); } // Verifies we can render HTML content as a single block @@ -165,7 +165,7 @@ public void CanRenderChildContent_StaticHtmlBlock() { var appElement = Browser.MountTestComponent(); Assert.Equal("

Some-Static-Text

", - appElement.FindElement(By.Id("foo")).GetAttribute("innerHTML")); + appElement.FindElement(By.Id("foo")).GetDomProperty("innerHTML")); } // Verifies we can rewite more complex HTML content into blocks @@ -175,16 +175,16 @@ public void CanRenderChildContent_MixedHtmlBlock() var appElement = Browser.MountTestComponent(); var one = appElement.FindElement(By.Id("one")); - Assert.Equal("

Some-Static-Text

", one.GetAttribute("innerHTML")); + Assert.Equal("

Some-Static-Text

", one.GetDomProperty("innerHTML")); var two = appElement.FindElement(By.Id("two")); - Assert.Equal("More-Static-Text", two.GetAttribute("innerHTML")); + Assert.Equal("More-Static-Text", two.GetDomProperty("innerHTML")); var three = appElement.FindElement(By.Id("three")); - Assert.Equal("Some-Dynamic-Text", three.GetAttribute("innerHTML")); + Assert.Equal("Some-Dynamic-Text", three.GetDomProperty("innerHTML")); var four = appElement.FindElement(By.Id("four")); - Assert.Equal("But this is static", four.GetAttribute("innerHTML")); + Assert.Equal("But this is static", four.GetDomProperty("innerHTML")); } // Verifies we can rewrite HTML blocks with encoded HTML @@ -194,16 +194,16 @@ public void CanRenderChildContent_EncodedHtmlInBlock() var appElement = Browser.MountTestComponent(); var one = appElement.FindElement(By.Id("one")); - Assert.Equal("

Some-Static-Text

", one.GetAttribute("innerHTML")); + Assert.Equal("

Some-Static-Text

", one.GetDomProperty("innerHTML")); var two = appElement.FindElement(By.Id("two")); - Assert.Equal("<span>More-Static-Text</span>", two.GetAttribute("innerHTML")); + Assert.Equal("<span>More-Static-Text</span>", two.GetDomProperty("innerHTML")); var three = appElement.FindElement(By.Id("three")); - Assert.Equal("Some-Dynamic-Text", three.GetAttribute("innerHTML")); + Assert.Equal("Some-Dynamic-Text", three.GetDomProperty("innerHTML")); var four = appElement.FindElement(By.Id("four")); - Assert.Equal("But this is static", four.GetAttribute("innerHTML")); + Assert.Equal("But this is static", four.GetDomProperty("innerHTML")); } [Fact] @@ -363,12 +363,12 @@ public void CanUseJsInteropToReferenceElements() var inputElement = appElement.FindElement(By.Id("capturedElement")); var buttonElement = appElement.FindElement(By.TagName("button")); - Assert.Equal(string.Empty, inputElement.GetAttribute("value")); + Assert.Equal(string.Empty, inputElement.GetDomProperty("value")); buttonElement.Click(); - Browser.Equal("Clicks: 1", () => inputElement.GetAttribute("value")); + Browser.Equal("Clicks: 1", () => inputElement.GetDomProperty("value")); buttonElement.Click(); - Browser.Equal("Clicks: 2", () => inputElement.GetAttribute("value")); + Browser.Equal("Clicks: 2", () => inputElement.GetDomProperty("value")); } [Fact] @@ -399,7 +399,7 @@ public void CanUseFocusExtensionToFocusElement() Assert.True(pageYOffsetAfter > pageYOffsetBefore); // A local helper that gets the ID of the focused element. - string getFocusedElementId() => Browser.SwitchTo().ActiveElement().GetAttribute("id"); + string getFocusedElementId() => Browser.SwitchTo().ActiveElement().GetDomAttribute("id"); // A local helper that gets window.PageYOffset int getPageYOffset() => Convert.ToInt32(((IJavaScriptExecutor)Browser).ExecuteScript("return window.pageYOffset"), CultureInfo.InvariantCulture); @@ -424,7 +424,7 @@ public void CanUseFocusExtensionToFocusSvgElement() Browser.Equal("focus-circle", getFocusedElementId); // A local helper that gets the ID of the focused element. - string getFocusedElementId() => Browser.SwitchTo().ActiveElement().GetAttribute("id"); + string getFocusedElementId() => Browser.SwitchTo().ActiveElement().GetDomAttribute("id"); } [Fact] @@ -453,7 +453,7 @@ public void CanUseFocusExtensionToFocusElementPreventScroll() Assert.Equal(pageYOffsetBefore, pageYOffsetAfter); // A local helper that gets the ID of the focused element. - string getFocusedElementId() => Browser.SwitchTo().ActiveElement().GetAttribute("id"); + string getFocusedElementId() => Browser.SwitchTo().ActiveElement().GetDomAttribute("id"); // A local helper that gets window.PageYOffset int getPageYOffset() => Convert.ToInt32(((IJavaScriptExecutor)Browser).ExecuteScript("return window.pageYOffset"), CultureInfo.InvariantCulture); @@ -474,7 +474,7 @@ public void CanFocusDuringOnAfterRenderAsyncWithFocusInEvent(string triggerButto appElement.FindElement(By.Id(triggerButton)).Click(); Browser.Equal("True", () => didReceiveFocusLabel.Text); - Browser.Equal("focus-input-onafterrender", () => Browser.SwitchTo().ActiveElement().GetAttribute("id")); + Browser.Equal("focus-input-onafterrender", () => Browser.SwitchTo().ActiveElement().GetDomAttribute("id")); // As well as actually focusing and triggering the onfocusin event, we should not be seeing any errors var log = Browser.Manage().Logs.GetLog(LogType.Browser).ToArray(); @@ -499,11 +499,11 @@ public void CanCaptureReferencesToDynamicallyAddedElements() // Re-add it; observe it starts empty again checkbox.Click(); var inputElement = appElement.FindElement(By.Id("capturedElement")); - Assert.Equal(string.Empty, inputElement.GetAttribute("value")); + Assert.Equal(string.Empty, inputElement.GetDomProperty("value")); // See that the capture variable was automatically updated to reference the new instance buttonElement.Click(); - Browser.Equal("Clicks: 1", () => inputElement.GetAttribute("value")); + Browser.Equal("Clicks: 1", () => inputElement.GetDomProperty("value")); } [Fact] @@ -541,7 +541,7 @@ public void CanCaptureReferencesToDynamicallyAddedComponents() public void CanUseJsInteropForRefElementsDuringOnAfterRender() { var appElement = Browser.MountTestComponent(); - Browser.Equal("Value set after render", () => Browser.Exists(By.TagName("input")).GetAttribute("value")); + Browser.Equal("Value set after render", () => Browser.Exists(By.TagName("input")).GetDomProperty("value")); } [Fact] @@ -665,7 +665,7 @@ public void CanPerformInteropImmediatelyOnComponentInsertion() { var appElement = Browser.MountTestComponent(); Browser.Equal("Hello from interop call", () => appElement.FindElement(By.Id("val-get-by-interop")).Text); - Browser.Equal("Hello from interop call", () => appElement.FindElement(By.Id("val-set-by-interop")).GetAttribute("value")); + Browser.Equal("Hello from interop call", () => appElement.FindElement(By.Id("val-set-by-interop")).GetDomProperty("value")); } [Fact] @@ -677,15 +677,15 @@ public void CanUseAddMultipleAttributes() Browser.Exists(selector); var element = appElement.FindElement(selector); - Assert.Equal(string.Empty, element.GetAttribute("bool")); // attribute is present - Assert.Equal("middle-value", element.GetAttribute("string")); - Assert.Equal("unmatched-value", element.GetAttribute("unmatched")); + Assert.Equal(string.Empty, element.GetDomAttribute("bool")); // attribute is present + Assert.Equal("middle-value", element.GetDomAttribute("string")); + Assert.Equal("unmatched-value", element.GetDomAttribute("unmatched")); selector = By.CssSelector("#duplicate-on-element-override > div"); element = appElement.FindElement(selector); - Assert.Null(element.GetAttribute("bool")); // attribute is not present - Assert.Equal("other-text", element.GetAttribute("string")); - Assert.Equal("unmatched-value", element.GetAttribute("unmatched")); + Assert.Null(element.GetDomAttribute("bool")); // attribute is not present + Assert.Equal("other-text", element.GetDomAttribute("string")); + Assert.Equal("unmatched-value", element.GetDomAttribute("unmatched")); } [Fact] diff --git a/src/Components/test/E2ETest/Tests/ErrorBoundaryTest.cs b/src/Components/test/E2ETest/Tests/ErrorBoundaryTest.cs index a31ef73a9f62..50e6fd06deef 100644 --- a/src/Components/test/E2ETest/Tests/ErrorBoundaryTest.cs +++ b/src/Components/test/E2ETest/Tests/ErrorBoundaryTest.cs @@ -46,7 +46,7 @@ public void CanHandleExceptions(string triggerId) Browser.Collection(() => container.FindElements(By.CssSelector("*")), elem => { - Assert.Equal("blazor-error-boundary", elem.GetAttribute("class")); + Assert.Equal("blazor-error-boundary", elem.GetDomAttribute("class")); Assert.Empty(elem.FindElements(By.CssSelector("*"))); }); diff --git a/src/Components/test/E2ETest/Tests/EventBubblingTest.cs b/src/Components/test/E2ETest/Tests/EventBubblingTest.cs index 3d19ba508728..c20f873a9914 100644 --- a/src/Components/test/E2ETest/Tests/EventBubblingTest.cs +++ b/src/Components/test/E2ETest/Tests/EventBubblingTest.cs @@ -166,7 +166,7 @@ public void PreventDefaultCanBlockKeystrokes() var textbox = Browser.Exists(By.Id($"textbox-that-can-block-keystrokes")); textbox.SendKeys("a"); Browser.Equal(new[] { "Received keydown" }, GetLogLines); - Browser.Equal("a", () => textbox.GetAttribute("value")); + Browser.Equal("a", () => textbox.GetDomProperty("value")); // We can turn on preventDefault to stop keystrokes // There will still be a keydown event, but we're preventing it from actually changing the textbox value @@ -174,19 +174,19 @@ public void PreventDefaultCanBlockKeystrokes() Browser.Exists(By.Id($"prevent-keydown")).Click(); textbox.SendKeys("b"); Browser.Equal(new[] { "Received keydown" }, GetLogLines); - Browser.Equal("a", () => textbox.GetAttribute("value")); + Browser.Equal("a", () => textbox.GetDomProperty("value")); // We can turn it back off ClearLog(); Browser.Exists(By.Id($"prevent-keydown")).Click(); textbox.SendKeys("c"); Browser.Equal(new[] { "Received keydown" }, GetLogLines); - Browser.Equal("ac", () => textbox.GetAttribute("value")); + Browser.Equal("ac", () => textbox.GetDomProperty("value")); } private string[] GetLogLines() => Browser.Exists(By.TagName("textarea")) - .GetAttribute("value") + .GetDomProperty("value") .Replace("\r\n", "\n") .Split('\n', StringSplitOptions.RemoveEmptyEntries); diff --git a/src/Components/test/E2ETest/Tests/EventCustomArgsTest.cs b/src/Components/test/E2ETest/Tests/EventCustomArgsTest.cs index 55f22d9cc4d0..a5a236a67585 100644 --- a/src/Components/test/E2ETest/Tests/EventCustomArgsTest.cs +++ b/src/Components/test/E2ETest/Tests/EventCustomArgsTest.cs @@ -77,7 +77,7 @@ public void CanAliasBrowserEvent_WithCreateEventArgsReturningData() "You pressed: b", }, GetLogLines); - Assert.Equal("ab", input.GetAttribute("value")); + Assert.Equal("ab", input.GetDomProperty("value")); } [Fact] @@ -97,7 +97,7 @@ public void CanAliasBrowserEvent_PreventDefaultOnNativeEvent() }, GetLogLines); // Check it was actually preventDefault-ed - Assert.Equal("", input.GetAttribute("value")); + Assert.Equal("", input.GetDomProperty("value")); } [Fact] @@ -120,7 +120,7 @@ public void CanAliasBrowserEvent_StopPropagationIndependentOfNativeEvent() "Yet another aliased event received: b", }, GetLogLines); - Assert.Equal("ab", input.GetAttribute("value")); + Assert.Equal("ab", input.GetDomProperty("value")); } [Fact] @@ -141,7 +141,7 @@ public void CanHaveMultipleAliasesForASingleBrowserEvent() "Yet another aliased event received: b", }, GetLogLines); - Assert.Equal("ab", input.GetAttribute("value")); + Assert.Equal("ab", input.GetDomProperty("value")); } [Fact] @@ -180,7 +180,7 @@ void SendKeysSequentially(IWebElement target, string text) private string[] GetLogLines() => Browser.Exists(By.Id("test-log")) - .GetAttribute("value") + .GetDomProperty("value") .Replace("\r\n", "\n") .Split('\n', StringSplitOptions.RemoveEmptyEntries); } diff --git a/src/Components/test/E2ETest/Tests/EventTest.cs b/src/Components/test/E2ETest/Tests/EventTest.cs index f7b550613b86..d07259952b2f 100644 --- a/src/Components/test/E2ETest/Tests/EventTest.cs +++ b/src/Components/test/E2ETest/Tests/EventTest.cs @@ -332,9 +332,9 @@ public void NonInteractiveElementWithDisabledAttributeDoesRespondToMouseEvents() var element = Browser.Exists(By.Id("disabled-div")); var eventLog = Browser.Exists(By.Id("event-log")); - Browser.Equal(string.Empty, () => eventLog.GetAttribute("value")); + Browser.Equal(string.Empty, () => eventLog.GetDomProperty("value")); element.Click(); - Browser.Equal("Got event on div", () => eventLog.GetAttribute("value")); + Browser.Equal("Got event on div", () => eventLog.GetDomProperty("value")); } [Theory] @@ -347,13 +347,13 @@ public void InteractiveElementWithDisabledAttributeDoesNotRespondToMouseEvents(s var element = Browser.Exists(By.CssSelector(elementSelector)); var eventLog = Browser.Exists(By.Id("event-log")); - Browser.Equal(string.Empty, () => eventLog.GetAttribute("value")); + Browser.Equal(string.Empty, () => eventLog.GetDomProperty("value")); element.Click(); // It's no use observing that the log is still empty, since maybe the UI just hasn't updated yet // To be sure that the preceding action has no effect, we need to trigger a different action that does have an effect Browser.Exists(By.Id("enabled-button")).Click(); - Browser.Equal("Got event on enabled button", () => eventLog.GetAttribute("value")); + Browser.Equal("Got event on enabled button", () => eventLog.GetDomProperty("value")); } [Fact] @@ -365,7 +365,7 @@ public virtual void EventDuringBatchRendering_CanTriggerDOMEvents() var eventLog = Browser.Exists(By.Id("event-log")); SendKeysSequentially(input, "abc"); - Browser.Equal("abc", () => input.GetAttribute("value")); + Browser.Equal("abc", () => input.GetDomProperty("value")); Browser.Equal( "Change event on item First with value a\n" + "Change event on item First with value ab\n" + diff --git a/src/Components/test/E2ETest/Tests/FormsInputDateTest.cs b/src/Components/test/E2ETest/Tests/FormsInputDateTest.cs index 0e034d019e6f..1308d87b9ed9 100644 --- a/src/Components/test/E2ETest/Tests/FormsInputDateTest.cs +++ b/src/Components/test/E2ETest/Tests/FormsInputDateTest.cs @@ -41,27 +41,27 @@ public void InputDateInteractsWithEditContext_NonNullableDateTime() var messagesAccessor = CreateValidationMessagesAccessor(appElement); // InputDate emits unmatched attributes - Browser.Equal("Enter the date", () => renewalDateInput.GetAttribute("placeholder")); + Browser.Equal("Enter the date", () => renewalDateInput.GetDomAttribute("placeholder")); // Validates on edit - Browser.Equal("valid", () => renewalDateInput.GetAttribute("class")); + Browser.Equal("valid", () => renewalDateInput.GetDomAttribute("class")); renewalDateInput.SendKeys($"{Keys.Backspace}\t{Keys.Backspace}\t{Keys.Backspace}\t"); renewalDateInput.SendKeys("01/01/2000\t"); - Browser.Equal("modified valid", () => renewalDateInput.GetAttribute("class")); + Browser.Equal("modified valid", () => renewalDateInput.GetDomAttribute("class")); // Can become invalid renewalDateInput.SendKeys("11-11-11111\t"); - Browser.Equal("modified invalid", () => renewalDateInput.GetAttribute("class")); + Browser.Equal("modified invalid", () => renewalDateInput.GetDomAttribute("class")); Browser.Equal(new[] { "The RenewalDate field must be a date." }, messagesAccessor); // Empty is invalid, because it's not nullable renewalDateInput.SendKeys($"{Keys.Backspace}\t{Keys.Backspace}\t{Keys.Backspace}\t"); - Browser.Equal("modified invalid", () => renewalDateInput.GetAttribute("class")); + Browser.Equal("modified invalid", () => renewalDateInput.GetDomAttribute("class")); Browser.Equal(new[] { "The RenewalDate field must be a date." }, messagesAccessor); // Can become valid renewalDateInput.SendKeys("01/01/01\t"); - Browser.Equal("modified valid", () => renewalDateInput.GetAttribute("class")); + Browser.Equal("modified valid", () => renewalDateInput.GetDomAttribute("class")); Browser.Empty(messagesAccessor); } @@ -73,18 +73,18 @@ public void InputDateInteractsWithEditContext_NullableDateTimeOffset() var messagesAccessor = CreateValidationMessagesAccessor(appElement); // Validates on edit - Browser.Equal("valid", () => expiryDateInput.GetAttribute("class")); + Browser.Equal("valid", () => expiryDateInput.GetDomAttribute("class")); expiryDateInput.SendKeys("01-01-2000\t"); - Browser.Equal("modified valid", () => expiryDateInput.GetAttribute("class")); + Browser.Equal("modified valid", () => expiryDateInput.GetDomAttribute("class")); // Can become invalid expiryDateInput.SendKeys("11-11-11111\t"); - Browser.Equal("modified invalid", () => expiryDateInput.GetAttribute("class")); + Browser.Equal("modified invalid", () => expiryDateInput.GetDomAttribute("class")); Browser.Equal(new[] { "The OptionalExpiryDate field must be a date." }, messagesAccessor); // Empty is valid, because it's nullable expiryDateInput.SendKeys($"{Keys.Backspace}\t{Keys.Backspace}\t{Keys.Backspace}\t"); - Browser.Equal("modified valid", () => expiryDateInput.GetAttribute("class")); + Browser.Equal("modified valid", () => expiryDateInput.GetDomAttribute("class")); Browser.Empty(messagesAccessor); } @@ -103,15 +103,15 @@ public void InputDateInteractsWithEditContext_TimeInput() } // Validates on edit - Browser.Equal("valid", () => departureTimeInput.GetAttribute("class")); + Browser.Equal("valid", () => departureTimeInput.GetDomAttribute("class")); departureTimeInput.SendKeys("06:43\t"); - Browser.Equal("modified valid", () => departureTimeInput.GetAttribute("class")); + Browser.Equal("modified valid", () => departureTimeInput.GetDomAttribute("class")); // Can become invalid // Stricly speaking the following is equivalent to the empty state, because that's how incomplete input is represented // We don't know of any way to produce a different (non-empty-equivalent) state using UI gestures, so there's nothing else to test departureTimeInput.SendKeys($"20{Keys.Backspace}\t"); - Browser.Equal("modified invalid", () => departureTimeInput.GetAttribute("class")); + Browser.Equal("modified invalid", () => departureTimeInput.GetDomAttribute("class")); Browser.Equal(new[] { "The DepartureTime field must be a time." }, messagesAccessor); } @@ -130,16 +130,16 @@ public void InputDateInteractsWithEditContext_TimeInput_Step() } // Input works with seconds value of zero and has the expected final value - Browser.Equal("valid", () => departureTimeInput.GetAttribute("class")); + Browser.Equal("valid", () => departureTimeInput.GetDomAttribute("class")); departureTimeInput.SendKeys("111111"); - Browser.Equal("modified valid", () => departureTimeInput.GetAttribute("class")); - Browser.Equal("11:11:11", () => departureTimeInput.GetAttribute("value")); + Browser.Equal("modified valid", () => departureTimeInput.GetDomAttribute("class")); + Browser.Equal("11:11:11", () => departureTimeInput.GetDomProperty("value")); // Input works with non-zero seconds value // Move to the beginning of the input and put the new time departureTimeInput.SendKeys(string.Concat(Enumerable.Repeat(Keys.ArrowLeft, 3)) + "101010"); - Browser.Equal("modified valid", () => departureTimeInput.GetAttribute("class")); - Browser.Equal("10:10:10", () => departureTimeInput.GetAttribute("value")); + Browser.Equal("modified valid", () => departureTimeInput.GetDomAttribute("class")); + Browser.Equal("10:10:10", () => departureTimeInput.GetDomProperty("value")); } [Fact] @@ -150,24 +150,24 @@ public void InputDateInteractsWithEditContext_MonthInput() var messagesAccessor = CreateValidationMessagesAccessor(appElement); // Validates on edit - Browser.Equal("valid", () => visitMonthInput.GetAttribute("class")); + Browser.Equal("valid", () => visitMonthInput.GetDomAttribute("class")); visitMonthInput.SendKeys($"03{Keys.ArrowRight}2005\t"); - Browser.Equal("modified valid", () => visitMonthInput.GetAttribute("class")); + Browser.Equal("modified valid", () => visitMonthInput.GetDomAttribute("class")); // Empty is invalid because it's not nullable visitMonthInput.Clear(); - Browser.Equal("modified invalid", () => visitMonthInput.GetAttribute("class")); + Browser.Equal("modified invalid", () => visitMonthInput.GetDomAttribute("class")); Browser.Equal(new[] { "The VisitMonth field must be a year and month." }, messagesAccessor); // Invalid year (11111) visitMonthInput.SendKeys($"11{Keys.ArrowRight}11111\t"); - Browser.Equal("modified invalid", () => visitMonthInput.GetAttribute("class")); + Browser.Equal("modified invalid", () => visitMonthInput.GetDomAttribute("class")); Browser.Equal(new[] { "The VisitMonth field must be a year and month." }, messagesAccessor); // Can become valid again visitMonthInput.Clear(); visitMonthInput.SendKeys($"11{Keys.ArrowRight}1111\t"); - Browser.Equal("modified valid", () => visitMonthInput.GetAttribute("class")); + Browser.Equal("modified valid", () => visitMonthInput.GetDomAttribute("class")); Browser.Empty(messagesAccessor); } @@ -186,24 +186,24 @@ public void InputDateInteractsWithEditContext_DateTimeLocalInput() } // Validates on edit and has the expected value - Browser.Equal("valid", () => appointmentInput.GetAttribute("class")); + Browser.Equal("valid", () => appointmentInput.GetDomAttribute("class")); appointmentInput.SendKeys($"01011970{Keys.ArrowRight}05421"); - Browser.Equal("modified valid", () => appointmentInput.GetAttribute("class")); + Browser.Equal("modified valid", () => appointmentInput.GetDomAttribute("class")); // Empty is invalid because it's not nullable appointmentInput.Clear(); - Browser.Equal("modified invalid", () => appointmentInput.GetAttribute("class")); + Browser.Equal("modified invalid", () => appointmentInput.GetDomAttribute("class")); Browser.Equal(new[] { "The AppointmentDateAndTime field must be a date and time." }, messagesAccessor); // Invalid year (11111) appointmentInput.SendKeys($"111111111{Keys.ArrowRight}11111"); - Browser.Equal("modified invalid", () => appointmentInput.GetAttribute("class")); + Browser.Equal("modified invalid", () => appointmentInput.GetDomAttribute("class")); Browser.Equal(new[] { "The AppointmentDateAndTime field must be a date and time." }, messagesAccessor); // Can become valid again appointmentInput.Clear(); appointmentInput.SendKeys($"11111111{Keys.ArrowRight}11111"); - Browser.Equal("modified valid", () => appointmentInput.GetAttribute("class")); + Browser.Equal("modified valid", () => appointmentInput.GetDomAttribute("class")); Browser.Empty(messagesAccessor); } @@ -222,16 +222,16 @@ public void InputDateInteractsWithEditContext_DateTimeLocalInput_Step() } // Input works with seconds value of zero (as in, starting from a zero value, which is the default) and has the expected final value - Browser.Equal("valid", () => appointmentInput.GetAttribute("class")); + Browser.Equal("valid", () => appointmentInput.GetDomAttribute("class")); appointmentInput.SendKeys($"11111970{Keys.ArrowRight}114216"); - Browser.Equal("modified valid", () => appointmentInput.GetAttribute("class")); - Browser.Equal("1970-11-11T11:42:16", () => appointmentInput.GetAttribute("value")); + Browser.Equal("modified valid", () => appointmentInput.GetDomAttribute("class")); + Browser.Equal("1970-11-11T11:42:16", () => appointmentInput.GetDomProperty("value")); // Input works when starting with a non-zero seconds value // Move to the beginning of the input and put the new value appointmentInput.SendKeys(string.Concat(Enumerable.Repeat(Keys.ArrowLeft, 6)) + $"10101970{Keys.ArrowRight}105321"); - Browser.Equal("modified valid", () => appointmentInput.GetAttribute("class")); - Browser.Equal("1970-10-10T10:53:21", () => appointmentInput.GetAttribute("value")); + Browser.Equal("modified valid", () => appointmentInput.GetDomAttribute("class")); + Browser.Equal("1970-10-10T10:53:21", () => appointmentInput.GetDomProperty("value")); } private Func CreateValidationMessagesAccessor(IWebElement appElement) diff --git a/src/Components/test/E2ETest/Tests/FormsTest.cs b/src/Components/test/E2ETest/Tests/FormsTest.cs index c82706d04e50..b58dee62cf0b 100644 --- a/src/Components/test/E2ETest/Tests/FormsTest.cs +++ b/src/Components/test/E2ETest/Tests/FormsTest.cs @@ -45,7 +45,7 @@ public async Task EditFormWorksWithDataAnnotationsValidator() var messagesAccessor = CreateValidationMessagesAccessor(appElement); // The form emits unmatched attributes - Browser.Equal("off", () => form.GetAttribute("autocomplete")); + Browser.Equal("off", () => form.GetDomAttribute("autocomplete")); // Editing a field doesn't trigger validation on its own userNameInput.SendKeys("Bert\t"); @@ -105,17 +105,17 @@ public void InputTextInteractsWithEditContext() ".validation-errors > .validation-message"); // Shows that the default class name for ValidationSummary is validation-errors // InputText emits unmatched attributes - Browser.Equal("Enter your name", () => nameInput.GetAttribute("placeholder")); + Browser.Equal("Enter your name", () => nameInput.GetDomAttribute("placeholder")); // Validates on edit - Browser.Equal("valid", () => nameInput.GetAttribute("class")); + Browser.Equal("valid", () => nameInput.GetDomAttribute("class")); nameInput.SendKeys("Bert\t"); - Browser.Equal("modified valid", () => nameInput.GetAttribute("class")); + Browser.Equal("modified valid", () => nameInput.GetDomAttribute("class")); EnsureAttributeNotRendered(nameInput, "aria-invalid"); // Can become invalid nameInput.SendKeys("01234567890123456789\t"); - Browser.Equal("modified invalid", () => nameInput.GetAttribute("class")); + Browser.Equal("modified invalid", () => nameInput.GetDomAttribute("class")); EnsureAttributeValue(nameInput, "aria-invalid", "true"); Browser.Equal(new[] { "That name is too long" }, messagesAccessor); Browser.True(() => summaryMessagesAccessor().Contains("That name is too long")); @@ -123,7 +123,7 @@ public void InputTextInteractsWithEditContext() // Can become valid nameInput.Clear(); nameInput.SendKeys("Bert\t"); - Browser.Equal("modified valid", () => nameInput.GetAttribute("class")); + Browser.Equal("modified valid", () => nameInput.GetDomAttribute("class")); EnsureAttributeNotRendered(nameInput, "aria-invalid"); Browser.Empty(messagesAccessor); Browser.False(() => summaryMessagesAccessor().Contains("That name is too long")); @@ -137,28 +137,28 @@ public void InputNumberInteractsWithEditContext_NonNullableInt() var messagesAccessor = CreateValidationMessagesAccessor(appElement); // InputNumber emits unmatched attributes - Browser.Equal("Enter your age", () => ageInput.GetAttribute("placeholder")); + Browser.Equal("Enter your age", () => ageInput.GetDomAttribute("placeholder")); // Validates on edit - Browser.Equal("valid", () => ageInput.GetAttribute("class")); + Browser.Equal("valid", () => ageInput.GetDomAttribute("class")); ageInput.SendKeys("123\t"); - Browser.Equal("modified valid", () => ageInput.GetAttribute("class")); + Browser.Equal("modified valid", () => ageInput.GetDomAttribute("class")); // Can become invalid ageInput.SendKeys("e100\t"); - Browser.Equal("modified invalid", () => ageInput.GetAttribute("class")); + Browser.Equal("modified invalid", () => ageInput.GetDomAttribute("class")); Browser.Equal(new[] { "The AgeInYears field must be a number." }, messagesAccessor); // Empty is invalid, because it's not a nullable int ageInput.Clear(); ageInput.SendKeys("\t"); - Browser.Equal("modified invalid", () => ageInput.GetAttribute("class")); + Browser.Equal("modified invalid", () => ageInput.GetDomAttribute("class")); Browser.Equal(new[] { "The AgeInYears field must be a number." }, messagesAccessor); Browser.Equal("", () => ageInput.GetDomProperty("value")); // We can display 'empty' even though it's not representable within the bound property // Zero is within the allowed range ageInput.SendKeys("0\t"); - Browser.Equal("modified valid", () => ageInput.GetAttribute("class")); + Browser.Equal("modified valid", () => ageInput.GetDomAttribute("class")); Browser.Empty(messagesAccessor); } @@ -170,19 +170,19 @@ public void InputNumberInteractsWithEditContext_NullableFloat() var messagesAccessor = CreateValidationMessagesAccessor(appElement); // Validates on edit - Browser.Equal("valid", () => heightInput.GetAttribute("class")); + Browser.Equal("valid", () => heightInput.GetDomAttribute("class")); heightInput.SendKeys("123.456\t"); - Browser.Equal("modified valid", () => heightInput.GetAttribute("class")); + Browser.Equal("modified valid", () => heightInput.GetDomAttribute("class")); // Can become invalid heightInput.SendKeys("e100\t"); - Browser.Equal("modified invalid", () => heightInput.GetAttribute("class")); + Browser.Equal("modified invalid", () => heightInput.GetDomAttribute("class")); Browser.Equal(new[] { "The OptionalHeight field must be a number." }, messagesAccessor); // Empty is valid, because it's a nullable float heightInput.Clear(); heightInput.SendKeys("\t"); - Browser.Equal("modified valid", () => heightInput.GetAttribute("class")); + Browser.Equal("modified valid", () => heightInput.GetDomAttribute("class")); Browser.Empty(messagesAccessor); } @@ -194,22 +194,22 @@ public void InputTextAreaInteractsWithEditContext() var messagesAccessor = CreateValidationMessagesAccessor(appElement); // InputTextArea emits unmatched attributes - Browser.Equal("Tell us about yourself", () => descriptionInput.GetAttribute("placeholder")); + Browser.Equal("Tell us about yourself", () => descriptionInput.GetDomAttribute("placeholder")); // Validates on edit - Browser.Equal("valid", () => descriptionInput.GetAttribute("class")); + Browser.Equal("valid", () => descriptionInput.GetDomAttribute("class")); descriptionInput.SendKeys("Hello\t"); - Browser.Equal("modified valid", () => descriptionInput.GetAttribute("class")); + Browser.Equal("modified valid", () => descriptionInput.GetDomAttribute("class")); // Can become invalid descriptionInput.SendKeys("too long too long too long too long too long\t"); - Browser.Equal("modified invalid", () => descriptionInput.GetAttribute("class")); + Browser.Equal("modified invalid", () => descriptionInput.GetDomAttribute("class")); Browser.Equal(new[] { "Description is max 20 chars" }, messagesAccessor); // Can become valid descriptionInput.Clear(); descriptionInput.SendKeys("Hello\t"); - Browser.Equal("modified valid", () => descriptionInput.GetAttribute("class")); + Browser.Equal("modified valid", () => descriptionInput.GetDomAttribute("class")); Browser.Empty(messagesAccessor); } @@ -222,16 +222,16 @@ public void InputSelectInteractsWithEditContext() var messagesAccessor = CreateValidationMessagesAccessor(appElement); // InputSelect emits unmatched attributes - Browser.Equal("4", () => select.GetAttribute("size")); + Browser.Equal("4", () => select.GetDomAttribute("size")); // Validates on edit - Browser.Equal("valid", () => select.GetAttribute("class")); + Browser.Equal("valid", () => select.GetDomAttribute("class")); ticketClassInput.SelectByText("First class"); - Browser.Equal("modified valid", () => select.GetAttribute("class")); + Browser.Equal("modified valid", () => select.GetDomAttribute("class")); // Can become invalid ticketClassInput.SelectByText("(select)"); - Browser.Equal("modified invalid", () => select.GetAttribute("class")); + Browser.Equal("modified invalid", () => select.GetDomAttribute("class")); Browser.Equal(new[] { "The TicketClass field is not valid." }, messagesAccessor); } @@ -244,14 +244,14 @@ public void InputSelectInteractsWithEditContext_BoolValues() var messagesAccessor = CreateValidationMessagesAccessor(appElement); // Invalidates on edit - Browser.Equal("valid", () => select.GetAttribute("class")); + Browser.Equal("valid", () => select.GetDomAttribute("class")); ticketClassInput.SelectByText("true"); - Browser.Equal("modified invalid", () => select.GetAttribute("class")); + Browser.Equal("modified invalid", () => select.GetDomAttribute("class")); Browser.Equal(new[] { "77 + 33 = 100 is a false statement, unfortunately." }, messagesAccessor); // Nullable conversion can fail ticketClassInput.SelectByText("(select)"); - Browser.Equal("modified invalid", () => select.GetAttribute("class")); + Browser.Equal("modified invalid", () => select.GetDomAttribute("class")); Browser.Equal(new[] { "77 + 33 = 100 is a false statement, unfortunately.", @@ -260,7 +260,7 @@ public void InputSelectInteractsWithEditContext_BoolValues() // Can become valid ticketClassInput.SelectByText("false"); - Browser.Equal("modified valid", () => select.GetAttribute("class")); + Browser.Equal("modified valid", () => select.GetDomAttribute("class")); } [Fact] @@ -272,17 +272,17 @@ public void InputSelectInteractsWithEditContext_MultipleAttribute() var messagesAccesor = CreateValidationMessagesAccessor(appElement); // Binding applies to option selection - Browser.Equal(new[] { "SanFrancisco" }, () => citiesInput.AllSelectedOptions.Select(option => option.GetAttribute("value"))); + Browser.Equal(new[] { "SanFrancisco" }, () => citiesInput.AllSelectedOptions.Select(option => option.GetDomProperty("value"))); // Validates on edit - Browser.Equal("valid", () => select.GetAttribute("class")); + Browser.Equal("valid", () => select.GetDomAttribute("class")); citiesInput.SelectByIndex(2); - Browser.Equal("modified valid", () => select.GetAttribute("class")); + Browser.Equal("modified valid", () => select.GetDomAttribute("class")); // Can become invalid citiesInput.SelectByIndex(1); citiesInput.SelectByIndex(3); - Browser.Equal("modified invalid", () => select.GetAttribute("class")); + Browser.Equal("modified invalid", () => select.GetDomAttribute("class")); Browser.Equal(new[] { "The field SelectedCities must be a string or array type with a maximum length of '3'." }, messagesAccesor); } @@ -333,25 +333,25 @@ public void InputCheckboxInteractsWithEditContext() var messagesAccessor = CreateValidationMessagesAccessor(appElement); // InputCheckbox emits unmatched attributes - Browser.Equal("You have to check this", () => acceptsTermsInput.GetAttribute("title")); + Browser.Equal("You have to check this", () => acceptsTermsInput.GetDomAttribute("title")); // Correct initial checkedness Assert.False(acceptsTermsInput.Selected); Assert.True(isEvilInput.Selected); // Validates on edit - Browser.Equal("valid", () => acceptsTermsInput.GetAttribute("class")); - Browser.Equal("valid", () => isEvilInput.GetAttribute("class")); + Browser.Equal("valid", () => acceptsTermsInput.GetDomAttribute("class")); + Browser.Equal("valid", () => isEvilInput.GetDomAttribute("class")); acceptsTermsInput.Click(); isEvilInput.Click(); - Browser.Equal("modified valid", () => acceptsTermsInput.GetAttribute("class")); - Browser.Equal("modified valid", () => isEvilInput.GetAttribute("class")); + Browser.Equal("modified valid", () => acceptsTermsInput.GetDomAttribute("class")); + Browser.Equal("modified valid", () => isEvilInput.GetDomAttribute("class")); // Can become invalid acceptsTermsInput.Click(); isEvilInput.Click(); - Browser.Equal("modified invalid", () => acceptsTermsInput.GetAttribute("class")); - Browser.Equal("modified invalid", () => isEvilInput.GetAttribute("class")); + Browser.Equal("modified invalid", () => acceptsTermsInput.GetDomAttribute("class")); + Browser.Equal("modified invalid", () => isEvilInput.GetDomAttribute("class")); Browser.Equal(new[] { "Must accept terms", "Must not be evil" }, messagesAccessor); } @@ -363,30 +363,30 @@ public void InputRadioGroupWithoutNameInteractsWithEditContext() // By capturing the inputradio elements just once up front, we're implicitly showing // that they are retained as their values change - var unknownAirlineInput = FindAirlineInputs().First(i => string.Equals("Unknown", i.GetAttribute("value"))); - var bestAirlineInput = FindAirlineInputs().First(i => string.Equals("BestAirline", i.GetAttribute("value"))); + var unknownAirlineInput = FindAirlineInputs().First(i => string.Equals("Unknown", i.GetDomProperty("value"))); + var bestAirlineInput = FindAirlineInputs().First(i => string.Equals("BestAirline", i.GetDomProperty("value"))); // Validate selected inputs Browser.True(() => unknownAirlineInput.Selected); Browser.False(() => bestAirlineInput.Selected); // InputRadio emits additional attributes - Browser.True(() => unknownAirlineInput.GetAttribute("extra").Equals("additional")); + Browser.True(() => unknownAirlineInput.GetDomAttribute("extra").Equals("additional")); // Validates on edit - Browser.Equal("valid", () => unknownAirlineInput.GetAttribute("class")); - Browser.Equal("valid", () => bestAirlineInput.GetAttribute("class")); + Browser.Equal("valid", () => unknownAirlineInput.GetDomAttribute("class")); + Browser.Equal("valid", () => bestAirlineInput.GetDomAttribute("class")); bestAirlineInput.Click(); - Browser.Equal("modified valid", () => unknownAirlineInput.GetAttribute("class")); - Browser.Equal("modified valid", () => bestAirlineInput.GetAttribute("class")); + Browser.Equal("modified valid", () => unknownAirlineInput.GetDomAttribute("class")); + Browser.Equal("modified valid", () => bestAirlineInput.GetDomAttribute("class")); // Can become invalid unknownAirlineInput.Click(); - Browser.Equal("modified invalid", () => unknownAirlineInput.GetAttribute("class")); - Browser.Equal("modified invalid", () => bestAirlineInput.GetAttribute("class")); + Browser.Equal("modified invalid", () => unknownAirlineInput.GetDomAttribute("class")); + Browser.Equal("modified invalid", () => bestAirlineInput.GetDomAttribute("class")); Browser.Equal(new[] { "Pick a valid airline." }, messagesAccessor); IReadOnlyCollection FindAirlineInputs() @@ -405,23 +405,23 @@ public void InputRadioGroupsWithNamesNestedInteractWithEditContext() Browser.True(() => FindColorInputs().All(i => !i.Selected)); // Invalidates on submit - Browser.True(() => FindCountryInputs().All(i => string.Equals("valid", i.GetAttribute("class")))); - Browser.True(() => FindColorInputs().All(i => string.Equals("valid", i.GetAttribute("class")))); + Browser.True(() => FindCountryInputs().All(i => string.Equals("valid", i.GetDomAttribute("class")))); + Browser.True(() => FindColorInputs().All(i => string.Equals("valid", i.GetDomAttribute("class")))); submitButton.Click(); - Browser.True(() => FindCountryInputs().All(i => string.Equals("invalid", i.GetAttribute("class")))); - Browser.True(() => FindColorInputs().All(i => string.Equals("invalid", i.GetAttribute("class")))); + Browser.True(() => FindCountryInputs().All(i => string.Equals("invalid", i.GetDomAttribute("class")))); + Browser.True(() => FindColorInputs().All(i => string.Equals("invalid", i.GetDomAttribute("class")))); // Validates on edit FindCountryInputs().First().Click(); - Browser.True(() => FindCountryInputs().All(i => string.Equals("modified valid", i.GetAttribute("class")))); - Browser.True(() => FindColorInputs().All(i => string.Equals("invalid", i.GetAttribute("class")))); + Browser.True(() => FindCountryInputs().All(i => string.Equals("modified valid", i.GetDomAttribute("class")))); + Browser.True(() => FindColorInputs().All(i => string.Equals("invalid", i.GetDomAttribute("class")))); FindColorInputs().First().Click(); - Browser.True(() => FindColorInputs().All(i => string.Equals("modified valid", i.GetAttribute("class")))); + Browser.True(() => FindColorInputs().All(i => string.Equals("modified valid", i.GetDomAttribute("class")))); IReadOnlyCollection FindCountryInputs() => group.FindElements(By.Name("country")); @@ -439,29 +439,29 @@ public void InputRadioGroupWithBoolValuesInteractsWithEditContext() Browser.True(() => FindFalseInput().Selected); // Validates on edit - Browser.Equal("valid", () => FindTrueInput().GetAttribute("class")); - Browser.Equal("valid", () => FindFalseInput().GetAttribute("class")); + Browser.Equal("valid", () => FindTrueInput().GetDomAttribute("class")); + Browser.Equal("valid", () => FindFalseInput().GetDomAttribute("class")); FindTrueInput().Click(); - Browser.Equal("modified valid", () => FindTrueInput().GetAttribute("class")); - Browser.Equal("modified valid", () => FindFalseInput().GetAttribute("class")); + Browser.Equal("modified valid", () => FindTrueInput().GetDomAttribute("class")); + Browser.Equal("modified valid", () => FindFalseInput().GetDomAttribute("class")); // Can become invalid FindFalseInput().Click(); - Browser.Equal("modified invalid", () => FindTrueInput().GetAttribute("class")); - Browser.Equal("modified invalid", () => FindFalseInput().GetAttribute("class")); + Browser.Equal("modified invalid", () => FindTrueInput().GetDomAttribute("class")); + Browser.Equal("modified invalid", () => FindFalseInput().GetDomAttribute("class")); Browser.Equal(new[] { "7 * 3 = 21 is a true statement." }, messagesAccessor); IReadOnlyCollection FindInputs() => appElement.FindElement(By.ClassName("radio-group-bool-values")).FindElements(By.TagName("input")); IWebElement FindTrueInput() - => FindInputs().First(i => string.Equals("True", i.GetAttribute("value"))); + => FindInputs().First(i => string.Equals("True", i.GetDomProperty("value"))); IWebElement FindFalseInput() - => FindInputs().First(i => string.Equals("False", i.GetAttribute("value"))); + => FindInputs().First(i => string.Equals("False", i.GetDomProperty("value"))); } [Fact] @@ -475,30 +475,30 @@ public void CanWireUpINotifyPropertyChangedToEditContext() var submissionStatus = appElement.FindElement(By.Id("submission-status")); // Editing a field triggers validation immediately - Browser.Equal("valid", () => userNameInput.GetAttribute("class")); + Browser.Equal("valid", () => userNameInput.GetDomAttribute("class")); userNameInput.SendKeys("Too long too long\t"); - Browser.Equal("modified invalid", () => userNameInput.GetAttribute("class")); + Browser.Equal("modified invalid", () => userNameInput.GetDomAttribute("class")); Browser.Equal(new[] { "That name is too long" }, messagesAccessor); // Submitting the form validates remaining fields submitButton.Click(); Browser.Equal(new[] { "That name is too long", "You must accept the terms" }, messagesAccessor); - Browser.Equal("modified invalid", () => userNameInput.GetAttribute("class")); - Browser.Equal("invalid", () => acceptsTermsInput.GetAttribute("class")); + Browser.Equal("modified invalid", () => userNameInput.GetDomAttribute("class")); + Browser.Equal("invalid", () => acceptsTermsInput.GetDomAttribute("class")); // Can make fields valid userNameInput.Clear(); userNameInput.SendKeys("Bert\t"); - Browser.Equal("modified valid", () => userNameInput.GetAttribute("class")); + Browser.Equal("modified valid", () => userNameInput.GetDomAttribute("class")); acceptsTermsInput.Click(); - Browser.Equal("modified valid", () => acceptsTermsInput.GetAttribute("class")); + Browser.Equal("modified valid", () => acceptsTermsInput.GetDomAttribute("class")); Browser.Equal(string.Empty, () => submissionStatus.Text); submitButton.Click(); Browser.True(() => submissionStatus.Text.StartsWith("Submitted", StringComparison.Ordinal)); // Fields can revert to unmodified - Browser.Equal("valid", () => userNameInput.GetAttribute("class")); - Browser.Equal("valid", () => acceptsTermsInput.GetAttribute("class")); + Browser.Equal("valid", () => userNameInput.GetDomAttribute("class")); + Browser.Equal("valid", () => acceptsTermsInput.GetDomAttribute("class")); } [Fact] @@ -586,12 +586,12 @@ public void InputComponentsRespondToAsynchronouslyAddedMessages() // Initially shows no error Browser.Empty(() => messagesAccessor()); - Browser.Equal("valid", () => input.GetAttribute("class")); + Browser.Equal("valid", () => input.GetDomAttribute("class")); // Can trigger async error triggerAsyncErrorButton.Click(); Browser.Equal(new[] { "This is invalid, asynchronously" }, messagesAccessor); - Browser.Equal("invalid", () => input.GetAttribute("class")); + Browser.Equal("invalid", () => input.GetDomAttribute("class")); } [Fact] @@ -605,29 +605,29 @@ public void SelectComponentSupportsOptionsComponent() // Select with custom options component and HTML component behave the // same when the selectElement.value is provided - Browser.Equal("B", () => selectWithoutComponent.GetAttribute("value")); - Browser.Equal("B", () => selectWithComponent.GetAttribute("value")); + Browser.Equal("B", () => selectWithoutComponent.GetDomProperty("value")); + Browser.Equal("B", () => selectWithComponent.GetDomProperty("value")); // Reset to a value that doesn't exist input.Clear(); input.SendKeys("D\t"); // Confirm that both values are cleared - Browser.Equal("", () => selectWithComponent.GetAttribute("value")); - Browser.Equal("", () => selectWithoutComponent.GetAttribute("value")); + Browser.Equal("", () => selectWithComponent.GetDomProperty("value")); + Browser.Equal("", () => selectWithoutComponent.GetDomProperty("value")); // Dynamically showing the fourth option updates the selected value showAdditionalOptionButton.Click(); - Browser.Equal("D", () => selectWithComponent.GetAttribute("value")); - Browser.Equal("D", () => selectWithoutComponent.GetAttribute("value")); + Browser.Equal("D", () => selectWithComponent.GetDomProperty("value")); + Browser.Equal("D", () => selectWithoutComponent.GetDomProperty("value")); // Change the value to one that does really doesn't exist input.Clear(); input.SendKeys("F\t"); - Browser.Equal("", () => selectWithComponent.GetAttribute("value")); - Browser.Equal("", () => selectWithoutComponent.GetAttribute("value")); + Browser.Equal("", () => selectWithComponent.GetDomProperty("value")); + Browser.Equal("", () => selectWithoutComponent.GetDomProperty("value")); } [Fact] @@ -637,7 +637,7 @@ public void SelectWithMultipleAttributeCanBindValue() var select = new SelectElement(appElement.FindElement(By.Id("select-cities"))); // Assert that the binding works in the .NET -> JS direction - Browser.Equal(new[] { "\"sf\"", "\"sea\"" }, () => select.AllSelectedOptions.Select(option => option.GetAttribute("value"))); + Browser.Equal(new[] { "\"sf\"", "\"sea\"" }, () => select.AllSelectedOptions.Select(option => option.GetDomProperty("value"))); select.DeselectByIndex(0); select.SelectByIndex(1); @@ -672,13 +672,13 @@ public void RespectsCustomFieldCssClassProvider() var messagesAccessor = CreateValidationMessagesAccessor(appElement); // Validates on edit - Browser.Equal("valid-socks", () => socksInput.GetAttribute("class")); + Browser.Equal("valid-socks", () => socksInput.GetDomAttribute("class")); socksInput.SendKeys("Purple\t"); - Browser.Equal("modified valid-socks", () => socksInput.GetAttribute("class")); + Browser.Equal("modified valid-socks", () => socksInput.GetDomAttribute("class")); // Can become invalid socksInput.SendKeys(" with yellow spots\t"); - Browser.Equal("modified invalid-socks", () => socksInput.GetAttribute("class")); + Browser.Equal("modified invalid-socks", () => socksInput.GetDomAttribute("class")); } [Fact] @@ -701,20 +701,20 @@ public void CanRemoveAndReAddDataAnnotationsSupport() Func lastLogEntryAccessor = () => appElement.FindElement(By.CssSelector(".submission-log-entry:last-of-type")).Text; nameInput.SendKeys("01234567890123456789\t"); - Browser.Equal("modified invalid", () => nameInput.GetAttribute("class")); + Browser.Equal("modified invalid", () => nameInput.GetDomAttribute("class")); Browser.Equal(new[] { "That name is too long" }, messagesAccessor); // Remove DataAnnotations support appElement.FindElement(By.Id("toggle-dataannotations")).Click(); Browser.Equal("DataAnnotations support is now disabled", lastLogEntryAccessor); - Browser.Equal("modified valid", () => nameInput.GetAttribute("class")); + Browser.Equal("modified valid", () => nameInput.GetDomAttribute("class")); Browser.Empty(messagesAccessor); // Re-add DataAnnotations support appElement.FindElement(By.Id("toggle-dataannotations")).Click(); nameInput.SendKeys("0\t"); Browser.Equal("DataAnnotations support is now enabled", lastLogEntryAccessor); - Browser.Equal("modified invalid", () => nameInput.GetAttribute("class")); + Browser.Equal("modified invalid", () => nameInput.GetDomAttribute("class")); Browser.Equal(new[] { "That name is too long" }, messagesAccessor); } @@ -915,7 +915,7 @@ public void InputWithCustomParserPreservesInvalidValueWhenParsingFails() // should not replace the input contents with last known component value (null) input.SendKeys("INVALID\t"); Browser.Equal("INVALID", () => input.GetDomProperty("value")); - Browser.Equal("modified invalid", () => input.GetAttribute("class")); + Browser.Equal("modified invalid", () => input.GetDomAttribute("class")); } [Fact] @@ -963,14 +963,14 @@ public void InputRadioGroupWorksWithoutEditContext() // The bound value is expected and no inputs have a class attribute Browser.True(() => FindRadioInputs().All(input => !ElementHasAttribute(input, "class"))); - Browser.True(() => FindRadioInputs().First(input => input.GetAttribute("value") == "Unknown").Selected); + Browser.True(() => FindRadioInputs().First(input => input.GetDomProperty("value") == "Unknown").Selected); Browser.Equal("Unknown", () => selectedInputText.Text); FindRadioInputs().First().Click(); // Value binding continues to work without an edit context and class attributes are unchanged Browser.True(() => FindRadioInputs().All(input => !ElementHasAttribute(input, "class"))); - Browser.True(() => FindRadioInputs().First(input => input.GetAttribute("value") == "BestAirline").Selected); + Browser.True(() => FindRadioInputs().First(input => input.GetDomProperty("value") == "BestAirline").Selected); Browser.Equal("BestAirline", () => selectedInputText.Text); IReadOnlyCollection FindRadioInputs() @@ -1057,12 +1057,12 @@ private Func CreateValidationMessagesAccessor(IWebElement appElement, private void EnsureAttributeValue(IWebElement element, string attributeName, string value) { - Browser.Equal(value, () => element.GetAttribute(attributeName)); + Browser.Equal(value, () => element.GetDomAttribute(attributeName)); } private void EnsureAttributeNotRendered(IWebElement element, string attributeName) { - Browser.True(() => element.GetAttribute(attributeName) == null); + Browser.True(() => element.GetDomAttribute(attributeName) == null); } private bool ElementHasAttribute(IWebElement webElement, string attribute) diff --git a/src/Components/test/E2ETest/Tests/GlobalizationTest.cs b/src/Components/test/E2ETest/Tests/GlobalizationTest.cs index ccbbcfa04f1a..b6ddf05aeec8 100644 --- a/src/Components/test/E2ETest/Tests/GlobalizationTest.cs +++ b/src/Components/test/E2ETest/Tests/GlobalizationTest.cs @@ -104,49 +104,49 @@ public void CanSetCultureAndParseCultureInvariantNumbersAndDatesWithInputFields( var input = Browser.Exists(By.Id("input_type_number_int")); var display = Browser.Exists(By.Id("input_type_number_int_value")); Browser.Equal(42.ToString(cultureInfo), () => display.Text); - Browser.Equal(42.ToString(CultureInfo.InvariantCulture), () => input.GetAttribute("value")); + Browser.Equal(42.ToString(CultureInfo.InvariantCulture), () => input.GetDomProperty("value")); input.Clear(); input.SendKeys(9000.ToString(CultureInfo.InvariantCulture)); input.SendKeys("\t"); Browser.Equal(9000.ToString(cultureInfo), () => display.Text); - Browser.Equal(9000.ToString(CultureInfo.InvariantCulture), () => input.GetAttribute("value")); + Browser.Equal(9000.ToString(CultureInfo.InvariantCulture), () => input.GetDomProperty("value")); // decimal input = Browser.Exists(By.Id("input_type_number_decimal")); display = Browser.Exists(By.Id("input_type_number_decimal_value")); Browser.Equal(4.2m.ToString(cultureInfo), () => display.Text); - Browser.Equal(4.2m.ToString(CultureInfo.InvariantCulture), () => input.GetAttribute("value")); + Browser.Equal(4.2m.ToString(CultureInfo.InvariantCulture), () => input.GetDomProperty("value")); input.Clear(); input.SendKeys(9000.42m.ToString(CultureInfo.InvariantCulture)); input.SendKeys("\t"); Browser.Equal(9000.42m.ToString(cultureInfo), () => display.Text); - Browser.Equal(9000.42m.ToString(CultureInfo.InvariantCulture), () => input.GetAttribute("value")); + Browser.Equal(9000.42m.ToString(CultureInfo.InvariantCulture), () => input.GetDomProperty("value")); // datetime input = Browser.Exists(By.Id("input_type_date_datetime")); display = Browser.Exists(By.Id("input_type_date_datetime_value")); var extraInput = Browser.Exists(By.Id("input_type_date_datetime_extrainput")); Browser.Equal(new DateTime(1985, 3, 4).ToString(cultureInfo), () => display.Text); - Browser.Equal(new DateTime(1985, 3, 4).ToString("yyyy-MM-dd", CultureInfo.InvariantCulture), () => input.GetAttribute("value")); + Browser.Equal(new DateTime(1985, 3, 4).ToString("yyyy-MM-dd", CultureInfo.InvariantCulture), () => input.GetDomProperty("value")); extraInput.ReplaceText(new DateTime(2000, 1, 2).ToString(cultureInfo)); extraInput.SendKeys("\t"); Browser.Equal(new DateTime(2000, 1, 2).ToString(cultureInfo), () => display.Text); - Browser.Equal(new DateTime(2000, 1, 2).ToString("yyyy-MM-dd", CultureInfo.InvariantCulture), () => input.GetAttribute("value")); + Browser.Equal(new DateTime(2000, 1, 2).ToString("yyyy-MM-dd", CultureInfo.InvariantCulture), () => input.GetDomProperty("value")); // datetimeoffset input = Browser.Exists(By.Id("input_type_date_datetimeoffset")); display = Browser.Exists(By.Id("input_type_date_datetimeoffset_value")); extraInput = Browser.Exists(By.Id("input_type_date_datetimeoffset_extrainput")); Browser.Equal(new DateTimeOffset(new DateTime(1985, 3, 4)).ToString(cultureInfo), () => display.Text); - Browser.Equal(new DateTimeOffset(new DateTime(1985, 3, 4)).ToString("yyyy-MM-dd", CultureInfo.InvariantCulture), () => input.GetAttribute("value")); + Browser.Equal(new DateTimeOffset(new DateTime(1985, 3, 4)).ToString("yyyy-MM-dd", CultureInfo.InvariantCulture), () => input.GetDomProperty("value")); extraInput.ReplaceText(new DateTimeOffset(new DateTime(2000, 1, 2)).ToString(cultureInfo)); extraInput.SendKeys("\t"); Browser.Equal(new DateTimeOffset(new DateTime(2000, 1, 2)).ToString(cultureInfo), () => display.Text); - Browser.Equal(new DateTimeOffset(new DateTime(2000, 1, 2)).ToString("yyyy-MM-dd", CultureInfo.InvariantCulture), () => input.GetAttribute("value")); + Browser.Equal(new DateTimeOffset(new DateTime(2000, 1, 2)).ToString("yyyy-MM-dd", CultureInfo.InvariantCulture), () => input.GetDomProperty("value")); } [Theory] @@ -161,72 +161,72 @@ public void CanSetCultureAndParseCultureInvariantNumbersAndDatesWithFormComponen var input = Browser.Exists(By.Id("inputnumber_int")); var display = Browser.Exists(By.Id("inputnumber_int_value")); Browser.Equal(42.ToString(cultureInfo), () => display.Text); - Browser.Equal(42.ToString(CultureInfo.InvariantCulture), () => input.GetAttribute("value")); + Browser.Equal(42.ToString(CultureInfo.InvariantCulture), () => input.GetDomProperty("value")); input.Clear(); input.SendKeys(9000.ToString(CultureInfo.InvariantCulture)); input.SendKeys("\t"); Browser.Equal(9000.ToString(cultureInfo), () => display.Text); - Browser.Equal(9000.ToString(CultureInfo.InvariantCulture), () => input.GetAttribute("value")); + Browser.Equal(9000.ToString(CultureInfo.InvariantCulture), () => input.GetDomProperty("value")); // long input = Browser.Exists(By.Id("inputnumber_long")); display = Browser.Exists(By.Id("inputnumber_long_value")); Browser.Equal(4200.ToString(cultureInfo), () => display.Text); - Browser.Equal(4200.ToString(CultureInfo.InvariantCulture), () => input.GetAttribute("value")); + Browser.Equal(4200.ToString(CultureInfo.InvariantCulture), () => input.GetDomProperty("value")); input.Clear(); input.SendKeys(90000000000.ToString(CultureInfo.InvariantCulture)); input.SendKeys("\t"); Browser.Equal(90000000000.ToString(cultureInfo), () => display.Text); - Browser.Equal(90000000000.ToString(CultureInfo.InvariantCulture), () => input.GetAttribute("value")); + Browser.Equal(90000000000.ToString(CultureInfo.InvariantCulture), () => input.GetDomProperty("value")); // short input = Browser.Exists(By.Id("inputnumber_short")); display = Browser.Exists(By.Id("inputnumber_short_value")); Browser.Equal(42.ToString(cultureInfo), () => display.Text); - Browser.Equal(42.ToString(CultureInfo.InvariantCulture), () => input.GetAttribute("value")); + Browser.Equal(42.ToString(CultureInfo.InvariantCulture), () => input.GetDomProperty("value")); input.Clear(); input.SendKeys(127.ToString(CultureInfo.InvariantCulture)); input.SendKeys("\t"); Browser.Equal(127.ToString(cultureInfo), () => display.Text); - Browser.Equal(127.ToString(CultureInfo.InvariantCulture), () => input.GetAttribute("value")); + Browser.Equal(127.ToString(CultureInfo.InvariantCulture), () => input.GetDomProperty("value")); // decimal input = Browser.Exists(By.Id("inputnumber_decimal")); display = Browser.Exists(By.Id("inputnumber_decimal_value")); Browser.Equal(4.2m.ToString(cultureInfo), () => display.Text); - Browser.Equal(4.2m.ToString(CultureInfo.InvariantCulture), () => input.GetAttribute("value")); + Browser.Equal(4.2m.ToString(CultureInfo.InvariantCulture), () => input.GetDomProperty("value")); input.Clear(); input.SendKeys(9000.42m.ToString(CultureInfo.InvariantCulture)); input.SendKeys("\t"); Browser.Equal(9000.42m.ToString(cultureInfo), () => display.Text); - Browser.Equal(9000.42m.ToString(CultureInfo.InvariantCulture), () => input.GetAttribute("value")); + Browser.Equal(9000.42m.ToString(CultureInfo.InvariantCulture), () => input.GetDomProperty("value")); // datetime input = Browser.Exists(By.Id("inputdate_datetime")); display = Browser.Exists(By.Id("inputdate_datetime_value")); var extraInput = Browser.Exists(By.Id("inputdate_datetime_extrainput")); Browser.Equal(new DateTime(1985, 3, 4).ToString(cultureInfo), () => display.Text); - Browser.Equal(new DateTime(1985, 3, 4).ToString("yyyy-MM-dd", CultureInfo.InvariantCulture), () => input.GetAttribute("value")); + Browser.Equal(new DateTime(1985, 3, 4).ToString("yyyy-MM-dd", CultureInfo.InvariantCulture), () => input.GetDomProperty("value")); extraInput.ReplaceText(new DateTime(2000, 1, 2).ToString(cultureInfo)); extraInput.SendKeys("\t"); Browser.Equal(new DateTime(2000, 1, 2).ToString(cultureInfo), () => display.Text); - Browser.Equal(new DateTime(2000, 1, 2).ToString("yyyy-MM-dd", CultureInfo.InvariantCulture), () => input.GetAttribute("value")); + Browser.Equal(new DateTime(2000, 1, 2).ToString("yyyy-MM-dd", CultureInfo.InvariantCulture), () => input.GetDomProperty("value")); // datetimeoffset input = Browser.Exists(By.Id("inputdate_datetimeoffset")); display = Browser.Exists(By.Id("inputdate_datetimeoffset_value")); extraInput = Browser.Exists(By.Id("inputdate_datetimeoffset_extrainput")); Browser.Equal(new DateTimeOffset(new DateTime(1985, 3, 4)).ToString(cultureInfo), () => display.Text); - Browser.Equal(new DateTimeOffset(new DateTime(1985, 3, 4)).ToString("yyyy-MM-dd", CultureInfo.InvariantCulture), () => input.GetAttribute("value")); + Browser.Equal(new DateTimeOffset(new DateTime(1985, 3, 4)).ToString("yyyy-MM-dd", CultureInfo.InvariantCulture), () => input.GetDomProperty("value")); extraInput.ReplaceText(new DateTimeOffset(new DateTime(2000, 1, 2)).ToString(cultureInfo)); extraInput.SendKeys("\t"); Browser.Equal(new DateTimeOffset(new DateTime(2000, 1, 2)).ToString(cultureInfo), () => display.Text); - Browser.Equal(new DateTimeOffset(new DateTime(2000, 1, 2)).ToString("yyyy-MM-dd", CultureInfo.InvariantCulture), () => input.GetAttribute("value")); + Browser.Equal(new DateTimeOffset(new DateTime(2000, 1, 2)).ToString("yyyy-MM-dd", CultureInfo.InvariantCulture), () => input.GetDomProperty("value")); } } diff --git a/src/Components/test/E2ETest/Tests/HeadModificationTest.cs b/src/Components/test/E2ETest/Tests/HeadModificationTest.cs index 5ecc3d377e52..c8ec9cf041a6 100644 --- a/src/Components/test/E2ETest/Tests/HeadModificationTest.cs +++ b/src/Components/test/E2ETest/Tests/HeadModificationTest.cs @@ -92,7 +92,7 @@ public void MostRecentlyAttachedHeadContentTakesPriority() void AssertDescriptionEquals(string description) { - Browser.Equal(description, () => Browser.FindElement(By.Id("meta-description")).GetAttribute("content")); + Browser.Equal(description, () => Browser.FindElement(By.Id("meta-description")).GetDomAttribute("content")); } } diff --git a/src/Components/test/E2ETest/Tests/KeyTest.cs b/src/Components/test/E2ETest/Tests/KeyTest.cs index a67ac3aae5b4..d736d3845b85 100644 --- a/src/Components/test/E2ETest/Tests/KeyTest.cs +++ b/src/Components/test/E2ETest/Tests/KeyTest.cs @@ -222,7 +222,7 @@ public async Task CanRetainFocusWhileMovingTextBox() // Send keys to whatever has focus new Actions(Browser).SendKeys(nextChar).Perform(); - Browser.Equal(expectedTextTyped, () => textboxFinder().GetAttribute("value")); + Browser.Equal(expectedTextTyped, () => textboxFinder().GetDomProperty("value")); // We delay between typings to ensure the events aren't all collapsed into one. await Task.Delay(50); @@ -235,7 +235,7 @@ public async Task CanRetainFocusWhileMovingTextBox() By.CssSelector(".incomplete-items .item-1 input[type=checkbox]")).Click(); Browser.Equal(expectedTextTyped, () => appElem .FindElement(By.CssSelector(".complete-items .item-1 input[type=text]")) - .GetAttribute("value")); + .GetDomProperty("value")); } [Fact] @@ -324,7 +324,7 @@ private void SetTextAreaValueFast(IWebElement textAreaElementWithId, string valu { var javascript = (IJavaScriptExecutor)Browser; javascript.ExecuteScript( - $"document.getElementById('{textAreaElementWithId.GetAttribute("id")}').value = {JsonSerializer.Serialize(value, TestJsonSerializerOptionsProvider.Options)}"); + $"document.getElementById('{textAreaElementWithId.GetDomAttribute("id")}').value = {JsonSerializer.Serialize(value, TestJsonSerializerOptionsProvider.Options)}"); textAreaElementWithId.SendKeys(" "); // So it fires the change event } diff --git a/src/Components/test/E2ETest/Tests/QuickGridTest.cs b/src/Components/test/E2ETest/Tests/QuickGridTest.cs index a151e900e7c5..71a7d452648d 100644 --- a/src/Components/test/E2ETest/Tests/QuickGridTest.cs +++ b/src/Components/test/E2ETest/Tests/QuickGridTest.cs @@ -118,7 +118,7 @@ public void PaginatorDisplaysCorrectItemCount() public void AdditionalAttributesApplied() { var grid = app.FindElement(By.CssSelector("#grid > table")); - Assert.Equal("somevalue", grid.GetAttribute("custom-attrib")); - Assert.Contains("custom-class-attrib", grid.GetAttribute("class")?.Split(" ")); + Assert.Equal("somevalue", grid.GetDomAttribute("custom-attrib")); + Assert.Contains("custom-class-attrib", grid.GetDomAttribute("class")?.Split(" ")); } } diff --git a/src/Components/test/E2ETest/Tests/RoutingTest.cs b/src/Components/test/E2ETest/Tests/RoutingTest.cs index 188e7c71f3bf..6c430d24395c 100644 --- a/src/Components/test/E2ETest/Tests/RoutingTest.cs +++ b/src/Components/test/E2ETest/Tests/RoutingTest.cs @@ -421,7 +421,7 @@ public void CanNavigateProgrammatically() AssertHighlightedLinks("Other", "Other with base-relative URL (matches all)"); // Because this was client-side navigation, we didn't lose the state in the test selector - Assert.Equal(typeof(TestRouter).FullName, testSelector.SelectedOption.GetAttribute("value")); + Assert.Equal(typeof(TestRouter).FullName, testSelector.SelectedOption.GetDomProperty("value")); } [Fact] @@ -438,7 +438,7 @@ public void CanNavigateProgrammaticallyWithForceLoad() // Because this was a full-page load, our element references should no longer be valid Assert.Throws(() => { - testSelector.SelectedOption.GetAttribute("value"); + testSelector.SelectedOption.GetDomProperty("value"); }); } @@ -474,7 +474,7 @@ public void CanNavigateProgrammaticallyWithStateValidateNoReplaceHistoryEntry() // We check if we had a force load Assert.Throws(() => - testSelector.SelectedOption.GetAttribute("value")); + testSelector.SelectedOption.GetDomProperty("value")); // But still we should be able to navigate back, and end up at the "/ProgrammaticNavigationCases" page Browser.Navigate().Back(); @@ -507,7 +507,7 @@ public void CanNavigateProgrammaticallyWithStateReplaceHistoryEntry() AssertHighlightedLinks("Default (matches all)", "Default with base-relative URL (matches all)"); // Because this was all with client-side navigation, we didn't lose the state in the test selector - Assert.Equal(typeof(TestRouter).FullName, testSelector.SelectedOption.GetAttribute("value")); + Assert.Equal(typeof(TestRouter).FullName, testSelector.SelectedOption.GetDomProperty("value")); } [Fact] @@ -546,14 +546,14 @@ public void CanNavigateProgrammaticallyValidateNoReplaceHistoryEntry() AssertHighlightedLinks("Programmatic navigation cases"); // Because this was client-side navigation, we didn't lose the state in the test selector - Assert.Equal(typeof(TestRouter).FullName, testSelector.SelectedOption.GetAttribute("value")); + Assert.Equal(typeof(TestRouter).FullName, testSelector.SelectedOption.GetDomProperty("value")); app.FindElement(By.Id("do-other-navigation-forced")).Click(); Browser.True(() => Browser.Url.EndsWith("/Other", StringComparison.Ordinal)); // We check if we had a force load Assert.Throws(() => - testSelector.SelectedOption.GetAttribute("value")); + testSelector.SelectedOption.GetDomProperty("value")); // But still we should be able to navigate back, and end up at the "/ProgrammaticNavigationCases" page Browser.Navigate().Back(); @@ -585,7 +585,7 @@ public void CanNavigateProgrammaticallyWithReplaceHistoryEntry() AssertHighlightedLinks("Default (matches all)", "Default with base-relative URL (matches all)"); // Because this was all with client-side navigation, we didn't lose the state in the test selector - Assert.Equal(typeof(TestRouter).FullName, testSelector.SelectedOption.GetAttribute("value")); + Assert.Equal(typeof(TestRouter).FullName, testSelector.SelectedOption.GetDomProperty("value")); } [Fact] @@ -606,7 +606,7 @@ public void CanNavigateProgrammaticallyWithForceLoadAndReplaceHistoryEntry() // We check if we had a force load Assert.Throws(() => - testSelector.SelectedOption.GetAttribute("value")); + testSelector.SelectedOption.GetDomProperty("value")); // After we press back, we should end up at the "/" page so we know browser history has been replaced Browser.Navigate().Back(); diff --git a/src/Components/test/E2ETest/Tests/SvgTest.cs b/src/Components/test/E2ETest/Tests/SvgTest.cs index 5a429784a573..145d63424883 100644 --- a/src/Components/test/E2ETest/Tests/SvgTest.cs +++ b/src/Components/test/E2ETest/Tests/SvgTest.cs @@ -36,10 +36,10 @@ public void CanRenderSvgWithCorrectNamespace() var svgCircleElement = svgElement.FindElement(By.XPath("//*[local-name()='circle' and namespace-uri()='http://www.w3.org/2000/svg']")); Assert.NotNull(svgCircleElement); - Assert.Equal("10", svgCircleElement.GetAttribute("r")); + Assert.Equal("10", svgCircleElement.GetDomAttribute("r")); appElement.FindElement(By.TagName("button")).Click(); - Browser.Equal("20", () => svgCircleElement.GetAttribute("r")); + Browser.Equal("20", () => svgCircleElement.GetDomAttribute("r")); } [Fact] @@ -52,10 +52,10 @@ public void CanRenderSvgWithAttributeRemoval() var svgCircleElement = svgElement.FindElement(By.XPath("//*[local-name()='circle' and namespace-uri()='http://www.w3.org/2000/svg']")); Assert.NotNull(svgCircleElement); - Assert.Equal("stroke: red;", svgCircleElement.GetAttribute("style")); + Assert.Equal("stroke: red;", svgCircleElement.GetDomAttribute("style")); appElement.FindElement(By.TagName("button")).Click(); - Browser.Equal("", () => svgCircleElement.GetAttribute("style")); + Browser.Equal(null, () => svgCircleElement.GetDomAttribute("style")); } [Fact] diff --git a/src/Components/test/E2ETest/Tests/VirtualizationTest.cs b/src/Components/test/E2ETest/Tests/VirtualizationTest.cs index f7256289a388..cb1b221c117d 100644 --- a/src/Components/test/E2ETest/Tests/VirtualizationTest.cs +++ b/src/Components/test/E2ETest/Tests/VirtualizationTest.cs @@ -39,21 +39,21 @@ public void AlwaysFillsVisibleCapacity_Sync() // Wait until items have been rendered. Browser.True(() => (initialItemCount = GetItemCount()) > 0); - Browser.Equal(expectedInitialSpacerStyle, () => topSpacer.GetAttribute("style")); + Browser.Equal(expectedInitialSpacerStyle, () => topSpacer.GetDomAttribute("style")); // Scroll halfway. Browser.ExecuteJavaScript("const container = document.getElementById('sync-container');container.scrollTop = container.scrollHeight * 0.5;"); // Validate that we get the same item count after scrolling halfway. Browser.Equal(initialItemCount, GetItemCount); - Browser.NotEqual(expectedInitialSpacerStyle, () => topSpacer.GetAttribute("style")); + Browser.NotEqual(expectedInitialSpacerStyle, () => topSpacer.GetDomAttribute("style")); // Scroll to the bottom. Browser.ExecuteJavaScript("const container = document.getElementById('sync-container');container.scrollTop = container.scrollHeight;"); // Validate that we get the same item count after scrolling to the bottom. Browser.Equal(initialItemCount, GetItemCount); - Browser.NotEqual(expectedInitialSpacerStyle, () => topSpacer.GetAttribute("style")); + Browser.NotEqual(expectedInitialSpacerStyle, () => topSpacer.GetDomAttribute("style")); int GetItemCount() => Browser.FindElements(By.Id("sync-item")).Count; } @@ -199,7 +199,7 @@ public void CanUseViewportAsContainer() Browser.ExecuteJavaScript("const element = document.getElementById('viewport-as-root'); element.scrollIntoView();"); // Validate that the top spacer has a height of zero. - Browser.Equal(expectedInitialSpacerStyle, () => topSpacer.GetAttribute("style")); + Browser.Equal(expectedInitialSpacerStyle, () => topSpacer.GetDomAttribute("style")); Browser.ExecuteJavaScript("window.scrollTo(0, document.body.scrollHeight);"); @@ -208,7 +208,7 @@ public void CanUseViewportAsContainer() Browser.True(() => lastElement.Displayed); // Validate that the top spacer has expanded. - Browser.NotEqual(expectedInitialSpacerStyle, () => topSpacer.GetAttribute("style")); + Browser.NotEqual(expectedInitialSpacerStyle, () => topSpacer.GetDomAttribute("style")); } [Fact] @@ -220,7 +220,7 @@ public async Task ToleratesIncorrectItemSize() // Wait until items have been rendered. Browser.True(() => GetItemCount() > 0); - Browser.Equal(expectedInitialSpacerStyle, () => topSpacer.GetAttribute("style")); + Browser.Equal(expectedInitialSpacerStyle, () => topSpacer.GetDomAttribute("style")); // Scroll slowly, in increments of 50px at a time. At one point this would trigger a bug // due to the incorrect item size, whereby it would not realise it's necessary to show more @@ -233,7 +233,7 @@ public async Task ToleratesIncorrectItemSize() } // Validate that the top spacer did change - Browser.NotEqual(expectedInitialSpacerStyle, () => topSpacer.GetAttribute("style")); + Browser.NotEqual(expectedInitialSpacerStyle, () => topSpacer.GetDomAttribute("style")); int GetItemCount() => Browser.FindElements(By.ClassName("incorrect-size-item")).Count; } @@ -249,7 +249,7 @@ public void CanRenderHtmlTable() // We can override the tag name of the spacer Assert.Equal("tr", topSpacer.TagName.ToLowerInvariant()); Assert.Equal("tr", bottomSpacer.TagName.ToLowerInvariant()); - Assert.Contains(expectedInitialSpacerStyle, topSpacer.GetAttribute("style")); + Assert.Contains(expectedInitialSpacerStyle, topSpacer.GetDomAttribute("style")); // Check scrolling document element works Browser.DoesNotExist(By.Id("row-999")); @@ -258,8 +258,8 @@ public void CanRenderHtmlTable() Browser.True(() => lastElement.Displayed); // Validate that the top spacer has expanded, and bottom one has collapsed - Browser.False(() => topSpacer.GetAttribute("style").Contains(expectedInitialSpacerStyle)); - Assert.Contains(expectedInitialSpacerStyle, bottomSpacer.GetAttribute("style")); + Browser.False(() => topSpacer.GetDomAttribute("style").Contains(expectedInitialSpacerStyle)); + Assert.Contains(expectedInitialSpacerStyle, bottomSpacer.GetDomAttribute("style")); } [Theory] diff --git a/src/Components/test/E2ETest/Tests/WebAssemblyLazyLoadTest.cs b/src/Components/test/E2ETest/Tests/WebAssemblyLazyLoadTest.cs index 9d3a67d48eba..c5d3c64db2df 100644 --- a/src/Components/test/E2ETest/Tests/WebAssemblyLazyLoadTest.cs +++ b/src/Components/test/E2ETest/Tests/WebAssemblyLazyLoadTest.cs @@ -114,7 +114,7 @@ public void CanLazyLoadAssemblyWithRoutes() Assert.True(renderedElement.Displayed); // FocusOnNavigate runs after the lazily-loaded page and focuses the correct element - Browser.Equal("lazy-page", () => Browser.SwitchTo().ActiveElement().GetAttribute("id")); + Browser.Equal("lazy-page", () => Browser.SwitchTo().ActiveElement().GetDomAttribute("id")); } [Fact] diff --git a/src/ProjectTemplates/TestInfrastructure/Directory.Build.props.in b/src/ProjectTemplates/TestInfrastructure/Directory.Build.props.in index 7e4697db332b..31b2ee9d6124 100644 --- a/src/ProjectTemplates/TestInfrastructure/Directory.Build.props.in +++ b/src/ProjectTemplates/TestInfrastructure/Directory.Build.props.in @@ -19,19 +19,6 @@ true - - - - - diff --git a/src/Servers/Connections.Abstractions/src/Features/ITlsHandshakeFeature.cs b/src/Servers/Connections.Abstractions/src/Features/ITlsHandshakeFeature.cs index 99f82881643c..2ae3411d79c6 100644 --- a/src/Servers/Connections.Abstractions/src/Features/ITlsHandshakeFeature.cs +++ b/src/Servers/Connections.Abstractions/src/Features/ITlsHandshakeFeature.cs @@ -2,6 +2,9 @@ // The .NET Foundation licenses this file to you under the MIT license. using System.Security.Authentication; +using System.Security.Cryptography; +using System; +using Microsoft.AspNetCore.Shared; #if NETCOREAPP using System.Net.Security; @@ -35,30 +38,48 @@ public interface ITlsHandshakeFeature /// /// Gets the . /// +#if NETCOREAPP + [Obsolete(Obsoletions.RuntimeTlsCipherAlgorithmEnumsMessage, DiagnosticId = Obsoletions.RuntimeTlsCipherAlgorithmEnumsDiagId, UrlFormat = Obsoletions.RuntimeSharedUrlFormat)] +#endif CipherAlgorithmType CipherAlgorithm { get; } /// /// Gets the cipher strength. /// +#if NETCOREAPP + [Obsolete(Obsoletions.RuntimeTlsCipherAlgorithmEnumsMessage, DiagnosticId = Obsoletions.RuntimeTlsCipherAlgorithmEnumsDiagId, UrlFormat = Obsoletions.RuntimeSharedUrlFormat)] +#endif int CipherStrength { get; } /// /// Gets the . /// +#if NETCOREAPP + [Obsolete(Obsoletions.RuntimeTlsCipherAlgorithmEnumsMessage, DiagnosticId = Obsoletions.RuntimeTlsCipherAlgorithmEnumsDiagId, UrlFormat = Obsoletions.RuntimeSharedUrlFormat)] +#endif HashAlgorithmType HashAlgorithm { get; } /// /// Gets the hash strength. /// +#if NETCOREAPP + [Obsolete(Obsoletions.RuntimeTlsCipherAlgorithmEnumsMessage, DiagnosticId = Obsoletions.RuntimeTlsCipherAlgorithmEnumsDiagId, UrlFormat = Obsoletions.RuntimeSharedUrlFormat)] +#endif int HashStrength { get; } /// - /// Gets the . + /// Gets the . /// +#if NETCOREAPP + [Obsolete(Obsoletions.RuntimeTlsCipherAlgorithmEnumsMessage, DiagnosticId = Obsoletions.RuntimeTlsCipherAlgorithmEnumsDiagId, UrlFormat = Obsoletions.RuntimeSharedUrlFormat)] +#endif ExchangeAlgorithmType KeyExchangeAlgorithm { get; } /// /// Gets the key exchange algorithm strength. /// +#if NETCOREAPP + [Obsolete(Obsoletions.RuntimeTlsCipherAlgorithmEnumsMessage, DiagnosticId = Obsoletions.RuntimeTlsCipherAlgorithmEnumsDiagId, UrlFormat = Obsoletions.RuntimeSharedUrlFormat)] +#endif int KeyExchangeStrength { get; } } diff --git a/src/Servers/Connections.Abstractions/src/Microsoft.AspNetCore.Connections.Abstractions.csproj b/src/Servers/Connections.Abstractions/src/Microsoft.AspNetCore.Connections.Abstractions.csproj index 2eb2bd082e50..2871430790f6 100644 --- a/src/Servers/Connections.Abstractions/src/Microsoft.AspNetCore.Connections.Abstractions.csproj +++ b/src/Servers/Connections.Abstractions/src/Microsoft.AspNetCore.Connections.Abstractions.csproj @@ -22,6 +22,7 @@ + diff --git a/src/Servers/HttpSys/src/Microsoft.AspNetCore.Server.HttpSys.csproj b/src/Servers/HttpSys/src/Microsoft.AspNetCore.Server.HttpSys.csproj index 50ed94c1a45d..868990b89816 100644 --- a/src/Servers/HttpSys/src/Microsoft.AspNetCore.Server.HttpSys.csproj +++ b/src/Servers/HttpSys/src/Microsoft.AspNetCore.Server.HttpSys.csproj @@ -28,6 +28,7 @@ + diff --git a/src/Servers/HttpSys/src/RequestProcessing/Request.cs b/src/Servers/HttpSys/src/RequestProcessing/Request.cs index f02507251cab..b32a973a5fb5 100644 --- a/src/Servers/HttpSys/src/RequestProcessing/Request.cs +++ b/src/Servers/HttpSys/src/RequestProcessing/Request.cs @@ -10,6 +10,7 @@ using System.Security.Principal; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.HttpSys.Internal; +using Microsoft.AspNetCore.Shared; using Microsoft.Extensions.Logging; using Microsoft.Extensions.Primitives; using Microsoft.Net.Http.Headers; @@ -336,28 +337,36 @@ private AspNetCore.HttpSys.Internal.SocketAddress LocalEndPoint public SslProtocols Protocol { get; private set; } + [Obsolete(Obsoletions.RuntimeTlsCipherAlgorithmEnumsMessage, DiagnosticId = Obsoletions.RuntimeTlsCipherAlgorithmEnumsDiagId, UrlFormat = Obsoletions.RuntimeSharedUrlFormat)] public CipherAlgorithmType CipherAlgorithm { get; private set; } + [Obsolete(Obsoletions.RuntimeTlsCipherAlgorithmEnumsMessage, DiagnosticId = Obsoletions.RuntimeTlsCipherAlgorithmEnumsDiagId, UrlFormat = Obsoletions.RuntimeSharedUrlFormat)] public int CipherStrength { get; private set; } + [Obsolete(Obsoletions.RuntimeTlsCipherAlgorithmEnumsMessage, DiagnosticId = Obsoletions.RuntimeTlsCipherAlgorithmEnumsDiagId, UrlFormat = Obsoletions.RuntimeSharedUrlFormat)] public HashAlgorithmType HashAlgorithm { get; private set; } + [Obsolete(Obsoletions.RuntimeTlsCipherAlgorithmEnumsMessage, DiagnosticId = Obsoletions.RuntimeTlsCipherAlgorithmEnumsDiagId, UrlFormat = Obsoletions.RuntimeSharedUrlFormat)] public int HashStrength { get; private set; } + [Obsolete(Obsoletions.RuntimeTlsCipherAlgorithmEnumsMessage, DiagnosticId = Obsoletions.RuntimeTlsCipherAlgorithmEnumsDiagId, UrlFormat = Obsoletions.RuntimeSharedUrlFormat)] public ExchangeAlgorithmType KeyExchangeAlgorithm { get; private set; } + [Obsolete(Obsoletions.RuntimeTlsCipherAlgorithmEnumsMessage, DiagnosticId = Obsoletions.RuntimeTlsCipherAlgorithmEnumsDiagId, UrlFormat = Obsoletions.RuntimeSharedUrlFormat)] public int KeyExchangeStrength { get; private set; } private void GetTlsHandshakeResults() { var handshake = RequestContext.GetTlsHandshake(); Protocol = (SslProtocols)handshake.Protocol; +#pragma warning disable SYSLIB0058 // Type or member is obsolete CipherAlgorithm = (CipherAlgorithmType)handshake.CipherType; CipherStrength = (int)handshake.CipherStrength; HashAlgorithm = (HashAlgorithmType)handshake.HashType; HashStrength = (int)handshake.HashStrength; KeyExchangeAlgorithm = (ExchangeAlgorithmType)handshake.KeyExchangeType; KeyExchangeStrength = (int)handshake.KeyExchangeStrength; +#pragma warning restore SYSLIB0058 // Type or member is obsolete var sni = RequestContext.GetClientSni(); SniHostName = sni.Hostname.ToString(); diff --git a/src/Servers/HttpSys/src/RequestProcessing/RequestContext.FeatureCollection.cs b/src/Servers/HttpSys/src/RequestProcessing/RequestContext.FeatureCollection.cs index e1931dc0fc6b..2751a1025a89 100644 --- a/src/Servers/HttpSys/src/RequestProcessing/RequestContext.FeatureCollection.cs +++ b/src/Servers/HttpSys/src/RequestProcessing/RequestContext.FeatureCollection.cs @@ -592,6 +592,7 @@ bool IHttpBodyControlFeature.AllowSynchronousIO SslProtocols ITlsHandshakeFeature.Protocol => Request.Protocol; +#pragma warning disable SYSLIB0058 // Type or member is obsolete CipherAlgorithmType ITlsHandshakeFeature.CipherAlgorithm => Request.CipherAlgorithm; int ITlsHandshakeFeature.CipherStrength => Request.CipherStrength; @@ -603,6 +604,7 @@ bool IHttpBodyControlFeature.AllowSynchronousIO ExchangeAlgorithmType ITlsHandshakeFeature.KeyExchangeAlgorithm => Request.KeyExchangeAlgorithm; int ITlsHandshakeFeature.KeyExchangeStrength => Request.KeyExchangeStrength; +#pragma warning restore SYSLIB0058 // Type or member is obsolete string ITlsHandshakeFeature.HostName => Request.SniHostName; diff --git a/src/Servers/HttpSys/test/FunctionalTests/HttpsTests.cs b/src/Servers/HttpSys/test/FunctionalTests/HttpsTests.cs index ec3be7a25f6e..0d3610cc4cfb 100644 --- a/src/Servers/HttpSys/test/FunctionalTests/HttpsTests.cs +++ b/src/Servers/HttpSys/test/FunctionalTests/HttpsTests.cs @@ -165,20 +165,26 @@ public async Task Https_SetsITlsHandshakeFeature() Assert.True(protocol > SslProtocols.None, "Protocol: " + protocol); Assert.True(Enum.IsDefined(typeof(SslProtocols), protocol), "Defined: " + protocol); // Mapping is required, make sure it's current +#pragma warning disable SYSLIB0058 // Type or member is obsolete var cipherAlgorithm = (CipherAlgorithmType)result.GetProperty("cipherAlgorithm").GetInt32(); Assert.True(cipherAlgorithm > CipherAlgorithmType.Null, "Cipher: " + cipherAlgorithm); +#pragma warning restore SYSLIB0058 // Type or member is obsolete var cipherStrength = result.GetProperty("cipherStrength").GetInt32(); Assert.True(cipherStrength > 0, "CipherStrength: " + cipherStrength); +#pragma warning disable SYSLIB0058 // Type or member is obsolete var hashAlgorithm = (HashAlgorithmType)result.GetProperty("hashAlgorithm").GetInt32(); Assert.True(hashAlgorithm >= HashAlgorithmType.None, "HashAlgorithm: " + hashAlgorithm); +#pragma warning restore SYSLIB0058 // Type or member is obsolete var hashStrength = result.GetProperty("hashStrength").GetInt32(); Assert.True(hashStrength >= 0, "HashStrength: " + hashStrength); // May be 0 for some algorithms +#pragma warning disable SYSLIB0058 // Type or member is obsolete var keyExchangeAlgorithm = (ExchangeAlgorithmType)result.GetProperty("keyExchangeAlgorithm").GetInt32(); Assert.True(keyExchangeAlgorithm >= ExchangeAlgorithmType.None, "KeyExchangeAlgorithm: " + keyExchangeAlgorithm); +#pragma warning restore SYSLIB0058 // Type or member is obsolete var keyExchangeStrength = result.GetProperty("keyExchangeStrength").GetInt32(); Assert.True(keyExchangeStrength >= 0, "KeyExchangeStrength: " + keyExchangeStrength); @@ -213,12 +219,14 @@ public async Task Https_ITlsHandshakeFeature_MatchesIHttpSysExtensionInfoFeature } // Assert.Equal(tlsFeature.Protocol, tlsCopy.Protocol); // These don't directly match because the native and managed enums use different values. +#pragma warning disable SYSLIB0058 // Type or member is obsolete Assert.Equal((uint)tlsFeature.CipherAlgorithm, tlsCopy.CipherType); Assert.Equal(tlsFeature.CipherStrength, (int)tlsCopy.CipherStrength); Assert.Equal((uint)tlsFeature.HashAlgorithm, tlsCopy.HashType); Assert.Equal(tlsFeature.HashStrength, (int)tlsCopy.HashStrength); Assert.Equal((uint)tlsFeature.KeyExchangeAlgorithm, tlsCopy.KeyExchangeType); Assert.Equal(tlsFeature.KeyExchangeStrength, (int)tlsCopy.KeyExchangeStrength); +#pragma warning restore SYSLIB0058 // Type or member is obsolete } catch (Exception ex) { diff --git a/src/Servers/IIS/IIS/src/Core/IISHttpContext.FeatureCollection.cs b/src/Servers/IIS/IIS/src/Core/IISHttpContext.FeatureCollection.cs index 427709d4b774..6e3475a5f1b8 100644 --- a/src/Servers/IIS/IIS/src/Core/IISHttpContext.FeatureCollection.cs +++ b/src/Servers/IIS/IIS/src/Core/IISHttpContext.FeatureCollection.cs @@ -15,6 +15,7 @@ using Microsoft.AspNetCore.Http.Features.Authentication; using Microsoft.AspNetCore.Server.HttpSys; using Microsoft.AspNetCore.Server.IIS.Core.IO; +using Microsoft.AspNetCore.Shared; using Microsoft.AspNetCore.WebUtilities; using Microsoft.Extensions.Logging; @@ -409,16 +410,22 @@ unsafe X509Certificate2? ITlsConnectionFeature.ClientCertificate string ITlsHandshakeFeature.HostName => SniHostName; + [Obsolete(Obsoletions.RuntimeTlsCipherAlgorithmEnumsMessage, DiagnosticId = Obsoletions.RuntimeTlsCipherAlgorithmEnumsDiagId, UrlFormat = Obsoletions.RuntimeSharedUrlFormat)] CipherAlgorithmType ITlsHandshakeFeature.CipherAlgorithm => CipherAlgorithm; + [Obsolete(Obsoletions.RuntimeTlsCipherAlgorithmEnumsMessage, DiagnosticId = Obsoletions.RuntimeTlsCipherAlgorithmEnumsDiagId, UrlFormat = Obsoletions.RuntimeSharedUrlFormat)] int ITlsHandshakeFeature.CipherStrength => CipherStrength; + [Obsolete(Obsoletions.RuntimeTlsCipherAlgorithmEnumsMessage, DiagnosticId = Obsoletions.RuntimeTlsCipherAlgorithmEnumsDiagId, UrlFormat = Obsoletions.RuntimeSharedUrlFormat)] HashAlgorithmType ITlsHandshakeFeature.HashAlgorithm => HashAlgorithm; + [Obsolete(Obsoletions.RuntimeTlsCipherAlgorithmEnumsMessage, DiagnosticId = Obsoletions.RuntimeTlsCipherAlgorithmEnumsDiagId, UrlFormat = Obsoletions.RuntimeSharedUrlFormat)] int ITlsHandshakeFeature.HashStrength => HashStrength; + [Obsolete(Obsoletions.RuntimeTlsCipherAlgorithmEnumsMessage, DiagnosticId = Obsoletions.RuntimeTlsCipherAlgorithmEnumsDiagId, UrlFormat = Obsoletions.RuntimeSharedUrlFormat)] ExchangeAlgorithmType ITlsHandshakeFeature.KeyExchangeAlgorithm => KeyExchangeAlgorithm; + [Obsolete(Obsoletions.RuntimeTlsCipherAlgorithmEnumsMessage, DiagnosticId = Obsoletions.RuntimeTlsCipherAlgorithmEnumsDiagId, UrlFormat = Obsoletions.RuntimeSharedUrlFormat)] int ITlsHandshakeFeature.KeyExchangeStrength => KeyExchangeStrength; IEnumerator> IEnumerable>.GetEnumerator() => FastEnumerable().GetEnumerator(); diff --git a/src/Servers/IIS/IIS/src/Core/IISHttpContext.cs b/src/Servers/IIS/IIS/src/Core/IISHttpContext.cs index f0e04f3b2a95..3ddc9315cf66 100644 --- a/src/Servers/IIS/IIS/src/Core/IISHttpContext.cs +++ b/src/Servers/IIS/IIS/src/Core/IISHttpContext.cs @@ -18,6 +18,7 @@ using Microsoft.AspNetCore.Http.Features; using Microsoft.AspNetCore.HttpSys.Internal; using Microsoft.AspNetCore.Server.IIS.Core.IO; +using Microsoft.AspNetCore.Shared; using Microsoft.AspNetCore.WebUtilities; using Microsoft.Extensions.Logging; using Microsoft.Net.Http.Headers; @@ -118,11 +119,17 @@ internal unsafe IISHttpContext( public SslProtocols Protocol { get; private set; } public TlsCipherSuite? NegotiatedCipherSuite { get; private set; } public string SniHostName { get; private set; } = default!; + [Obsolete(Obsoletions.RuntimeTlsCipherAlgorithmEnumsMessage, DiagnosticId = Obsoletions.RuntimeTlsCipherAlgorithmEnumsDiagId, UrlFormat = Obsoletions.RuntimeSharedUrlFormat)] public CipherAlgorithmType CipherAlgorithm { get; private set; } + [Obsolete(Obsoletions.RuntimeTlsCipherAlgorithmEnumsMessage, DiagnosticId = Obsoletions.RuntimeTlsCipherAlgorithmEnumsDiagId, UrlFormat = Obsoletions.RuntimeSharedUrlFormat)] public int CipherStrength { get; private set; } + [Obsolete(Obsoletions.RuntimeTlsCipherAlgorithmEnumsMessage, DiagnosticId = Obsoletions.RuntimeTlsCipherAlgorithmEnumsDiagId, UrlFormat = Obsoletions.RuntimeSharedUrlFormat)] public HashAlgorithmType HashAlgorithm { get; private set; } + [Obsolete(Obsoletions.RuntimeTlsCipherAlgorithmEnumsMessage, DiagnosticId = Obsoletions.RuntimeTlsCipherAlgorithmEnumsDiagId, UrlFormat = Obsoletions.RuntimeSharedUrlFormat)] public int HashStrength { get; private set; } + [Obsolete(Obsoletions.RuntimeTlsCipherAlgorithmEnumsMessage, DiagnosticId = Obsoletions.RuntimeTlsCipherAlgorithmEnumsDiagId, UrlFormat = Obsoletions.RuntimeSharedUrlFormat)] public ExchangeAlgorithmType KeyExchangeAlgorithm { get; private set; } + [Obsolete(Obsoletions.RuntimeTlsCipherAlgorithmEnumsMessage, DiagnosticId = Obsoletions.RuntimeTlsCipherAlgorithmEnumsDiagId)] public int KeyExchangeStrength { get; private set; } protected IAsyncIOEngine? AsyncIO { get; set; } @@ -395,12 +402,14 @@ private void GetTlsHandshakeResults() { var handshake = GetTlsHandshake(); Protocol = (SslProtocols)handshake.Protocol; +#pragma warning disable SYSLIB0058 // Type or member is obsolete CipherAlgorithm = (CipherAlgorithmType)handshake.CipherType; CipherStrength = (int)handshake.CipherStrength; HashAlgorithm = (HashAlgorithmType)handshake.HashType; HashStrength = (int)handshake.HashStrength; KeyExchangeAlgorithm = (ExchangeAlgorithmType)handshake.KeyExchangeType; KeyExchangeStrength = (int)handshake.KeyExchangeStrength; +#pragma warning restore SYSLIB0058 // Type or member is obsolete var sni = GetClientSni(); SniHostName = sni.Hostname.ToString(); diff --git a/src/Servers/IIS/IIS/src/Microsoft.AspNetCore.Server.IIS.csproj b/src/Servers/IIS/IIS/src/Microsoft.AspNetCore.Server.IIS.csproj index a3d525a577e9..d9ffb24a0867 100644 --- a/src/Servers/IIS/IIS/src/Microsoft.AspNetCore.Server.IIS.csproj +++ b/src/Servers/IIS/IIS/src/Microsoft.AspNetCore.Server.IIS.csproj @@ -26,6 +26,7 @@ + diff --git a/src/Servers/IIS/IIS/test/Common.FunctionalTests/WebSocketInProcessTests.cs b/src/Servers/IIS/IIS/test/Common.FunctionalTests/WebSocketInProcessTests.cs index b4e7ddca7e0b..1491480b7a65 100644 --- a/src/Servers/IIS/IIS/test/Common.FunctionalTests/WebSocketInProcessTests.cs +++ b/src/Servers/IIS/IIS/test/Common.FunctionalTests/WebSocketInProcessTests.cs @@ -1,7 +1,6 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -using Microsoft.AspNetCore.Server.IIS.FunctionalTests; using Microsoft.AspNetCore.InternalTesting; using Microsoft.AspNetCore.Server.IntegrationTesting; using Xunit.Abstractions; diff --git a/src/Servers/IIS/IIS/test/Common.FunctionalTests/WebSocketOutOfProcessTests.cs b/src/Servers/IIS/IIS/test/Common.FunctionalTests/WebSocketOutOfProcessTests.cs index 69a98c86875d..d50328d10170 100644 --- a/src/Servers/IIS/IIS/test/Common.FunctionalTests/WebSocketOutOfProcessTests.cs +++ b/src/Servers/IIS/IIS/test/Common.FunctionalTests/WebSocketOutOfProcessTests.cs @@ -1,7 +1,6 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -using Microsoft.AspNetCore.Server.IIS.FunctionalTests; using Microsoft.AspNetCore.InternalTesting; using Microsoft.AspNetCore.Server.IntegrationTesting; using Xunit.Abstractions; diff --git a/src/Servers/IIS/IIS/test/Common.FunctionalTests/WebSocketTests.cs b/src/Servers/IIS/IIS/test/Common.FunctionalTests/WebSocketTests.cs index c27926b6ccbd..606ba6c8c654 100644 --- a/src/Servers/IIS/IIS/test/Common.FunctionalTests/WebSocketTests.cs +++ b/src/Servers/IIS/IIS/test/Common.FunctionalTests/WebSocketTests.cs @@ -8,7 +8,6 @@ using System.Net.WebSockets; using System.Text; using Microsoft.AspNetCore.InternalTesting; -using Microsoft.AspNetCore.Server.IIS.FunctionalTests; using Microsoft.AspNetCore.Server.IntegrationTesting; using Microsoft.AspNetCore.Server.IntegrationTesting.IIS; using Xunit.Abstractions; diff --git a/src/Servers/IIS/IIS/test/IIS.Tests/TlsHandshakeFeatureTests.cs b/src/Servers/IIS/IIS/test/IIS.Tests/TlsHandshakeFeatureTests.cs index 9f42714edbbb..07e565338805 100644 --- a/src/Servers/IIS/IIS/test/IIS.Tests/TlsHandshakeFeatureTests.cs +++ b/src/Servers/IIS/IIS/test/IIS.Tests/TlsHandshakeFeatureTests.cs @@ -33,6 +33,7 @@ public async Task SetsTlsHandshakeFeatureForHttps() Assert.True(protocol > SslProtocols.None, "Protocol: " + protocol); Assert.True(Enum.IsDefined(typeof(SslProtocols), protocol), "Defined: " + protocol); // Mapping is required, make sure it's current +#pragma warning disable SYSLIB0058 // Type or member is obsolete var cipherAlgorithm = tlsHandshakeFeature.CipherAlgorithm; Assert.True(cipherAlgorithm > CipherAlgorithmType.Null, "Cipher: " + cipherAlgorithm); @@ -50,6 +51,7 @@ public async Task SetsTlsHandshakeFeatureForHttps() var keyExchangeStrength = tlsHandshakeFeature.KeyExchangeStrength; Assert.True(keyExchangeStrength >= 0, "KeyExchangeStrength: " + keyExchangeStrength); +#pragma warning restore SYSLIB0058 // Type or member is obsolete if (Environment.OSVersion.Version > new Version(10, 0, 19043, 0)) { diff --git a/src/Servers/Kestrel/Core/src/Internal/TlsConnectionFeature.cs b/src/Servers/Kestrel/Core/src/Internal/TlsConnectionFeature.cs index 2e23dbe585a5..2e16b0042715 100644 --- a/src/Servers/Kestrel/Core/src/Internal/TlsConnectionFeature.cs +++ b/src/Servers/Kestrel/Core/src/Internal/TlsConnectionFeature.cs @@ -8,6 +8,7 @@ using Microsoft.AspNetCore.Connections.Features; using Microsoft.AspNetCore.Http.Features; using Microsoft.AspNetCore.Server.Kestrel.Core.Features; +using Obsoletions = Microsoft.AspNetCore.Shared.Obsoletions; namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal; @@ -54,16 +55,22 @@ public X509Certificate2? ClientCertificate public TlsCipherSuite? NegotiatedCipherSuite => _sslStream.NegotiatedCipherSuite; + [Obsolete(Obsoletions.RuntimeTlsCipherAlgorithmEnumsMessage, DiagnosticId = Obsoletions.RuntimeTlsCipherAlgorithmEnumsDiagId, UrlFormat = Obsoletions.RuntimeSharedUrlFormat)] public CipherAlgorithmType CipherAlgorithm => _sslStream.CipherAlgorithm; + [Obsolete(Obsoletions.RuntimeTlsCipherAlgorithmEnumsMessage, DiagnosticId = Obsoletions.RuntimeTlsCipherAlgorithmEnumsDiagId, UrlFormat = Obsoletions.RuntimeSharedUrlFormat)] public int CipherStrength => _sslStream.CipherStrength; + [Obsolete(Obsoletions.RuntimeTlsCipherAlgorithmEnumsMessage, DiagnosticId = Obsoletions.RuntimeTlsCipherAlgorithmEnumsDiagId, UrlFormat = Obsoletions.RuntimeSharedUrlFormat)] public HashAlgorithmType HashAlgorithm => _sslStream.HashAlgorithm; + [Obsolete(Obsoletions.RuntimeTlsCipherAlgorithmEnumsMessage, DiagnosticId = Obsoletions.RuntimeTlsCipherAlgorithmEnumsDiagId, UrlFormat = Obsoletions.RuntimeSharedUrlFormat)] public int HashStrength => _sslStream.HashStrength; + [Obsolete(Obsoletions.RuntimeTlsCipherAlgorithmEnumsMessage, DiagnosticId = Obsoletions.RuntimeTlsCipherAlgorithmEnumsDiagId, UrlFormat = Obsoletions.RuntimeSharedUrlFormat)] public ExchangeAlgorithmType KeyExchangeAlgorithm => _sslStream.KeyExchangeAlgorithm; + [Obsolete(Obsoletions.RuntimeTlsCipherAlgorithmEnumsMessage, DiagnosticId = Obsoletions.RuntimeTlsCipherAlgorithmEnumsDiagId, UrlFormat = Obsoletions.RuntimeSharedUrlFormat)] public int KeyExchangeStrength => _sslStream.KeyExchangeStrength; public Task GetClientCertificateAsync(CancellationToken cancellationToken) diff --git a/src/Servers/Kestrel/Core/src/Microsoft.AspNetCore.Server.Kestrel.Core.csproj b/src/Servers/Kestrel/Core/src/Microsoft.AspNetCore.Server.Kestrel.Core.csproj index d53a2a61a10c..9199ae066c0a 100644 --- a/src/Servers/Kestrel/Core/src/Microsoft.AspNetCore.Server.Kestrel.Core.csproj +++ b/src/Servers/Kestrel/Core/src/Microsoft.AspNetCore.Server.Kestrel.Core.csproj @@ -34,6 +34,7 @@ + diff --git a/src/Servers/Kestrel/samples/Http2SampleApp/Program.cs b/src/Servers/Kestrel/samples/Http2SampleApp/Program.cs index 8830c9331005..8fb8afe4fcfb 100644 --- a/src/Servers/Kestrel/samples/Http2SampleApp/Program.cs +++ b/src/Servers/Kestrel/samples/Http2SampleApp/Program.cs @@ -46,10 +46,14 @@ public static void Main(string[] args) var tlsFeature = context.Features.Get(); +#pragma warning disable CS0618 // Type or member is obsolete +#pragma warning disable SYSLIB0058 // Type or member is obsolete if (tlsFeature.CipherAlgorithm == CipherAlgorithmType.Null) { throw new NotSupportedException("Prohibited cipher: " + tlsFeature.CipherAlgorithm); } +#pragma warning restore SYSLIB0058 // Type or member is obsolete +#pragma warning restore CS0618 // Type or member is obsolete return next(context); }); diff --git a/src/Servers/Kestrel/test/InMemory.FunctionalTests/HttpsConnectionMiddlewareTests.cs b/src/Servers/Kestrel/test/InMemory.FunctionalTests/HttpsConnectionMiddlewareTests.cs index 70005eaf0432..2d4ab6c59018 100644 --- a/src/Servers/Kestrel/test/InMemory.FunctionalTests/HttpsConnectionMiddlewareTests.cs +++ b/src/Servers/Kestrel/test/InMemory.FunctionalTests/HttpsConnectionMiddlewareTests.cs @@ -147,12 +147,14 @@ void ConfigureListenOptions(ListenOptions listenOptions) Assert.Equal(expectedHostname, tlsFeature.HostName); Assert.True(tlsFeature.Protocol > SslProtocols.None, "Protocol"); Assert.True(tlsFeature.NegotiatedCipherSuite >= TlsCipherSuite.TLS_NULL_WITH_NULL_NULL, "NegotiatedCipherSuite"); +#pragma warning disable SYSLIB0058 // Type or member is obsolete Assert.True(tlsFeature.CipherAlgorithm > CipherAlgorithmType.Null, "Cipher"); Assert.True(tlsFeature.CipherStrength > 0, "CipherStrength"); Assert.True(tlsFeature.HashAlgorithm >= HashAlgorithmType.None, "HashAlgorithm"); // May be None on Linux. Assert.True(tlsFeature.HashStrength >= 0, "HashStrength"); // May be 0 for some algorithms Assert.True(tlsFeature.KeyExchangeAlgorithm >= ExchangeAlgorithmType.None, "KeyExchangeAlgorithm"); // Maybe None on Windows 7 Assert.True(tlsFeature.KeyExchangeStrength >= 0, "KeyExchangeStrength"); // May be 0 on mac +#pragma warning restore SYSLIB0058 // Type or member is obsolete return context.Response.WriteAsync("hello world"); }, new TestServiceContext(LoggerFactory), ConfigureListenOptions)) @@ -183,12 +185,14 @@ void ConfigureListenOptions(ListenOptions listenOptions) var tlsFeature = context.Features.Get(); Assert.NotNull(tlsFeature); Assert.True(tlsFeature.Protocol > SslProtocols.None, "Protocol"); +#pragma warning disable SYSLIB0058 // Type or member is obsolete Assert.True(tlsFeature.CipherAlgorithm > CipherAlgorithmType.Null, "Cipher"); Assert.True(tlsFeature.CipherStrength > 0, "CipherStrength"); Assert.True(tlsFeature.HashAlgorithm >= HashAlgorithmType.None, "HashAlgorithm"); // May be None on Linux. Assert.True(tlsFeature.HashStrength >= 0, "HashStrength"); // May be 0 for some algorithms Assert.True(tlsFeature.KeyExchangeAlgorithm >= ExchangeAlgorithmType.None, "KeyExchangeAlgorithm"); // Maybe None on Windows 7 Assert.True(tlsFeature.KeyExchangeStrength >= 0, "KeyExchangeStrength"); // May be 0 on mac +#pragma warning restore SYSLIB0058 // Type or member is obsolete return context.Response.WriteAsync("hello world"); }, new TestServiceContext(LoggerFactory), ConfigureListenOptions)) diff --git a/src/Shared/E2ETesting/WaitAssert.cs b/src/Shared/E2ETesting/WaitAssert.cs index 022870aec08a..41928b07a003 100644 --- a/src/Shared/E2ETesting/WaitAssert.cs +++ b/src/Shared/E2ETesting/WaitAssert.cs @@ -116,7 +116,7 @@ private static TResult WaitAssertCore(IWebDriver driver, Func // tests running concurrently might use the DefaultTimeout in their current assertion, which is fine. TestRunFailed = true; - var innerHtml = driver.FindElement(By.CssSelector(":first-child"))?.GetAttribute("innerHTML"); + var innerHtml = driver.FindElement(By.CssSelector(":first-child"))?.GetDomProperty("innerHTML"); var fileId = $"{Guid.NewGuid():N}.png"; var screenShotPath = Path.Combine(Path.GetFullPath(E2ETestOptions.Instance.ScreenShotsPath), fileId); diff --git a/src/Shared/Obsoletions.cs b/src/Shared/Obsoletions.cs new file mode 100644 index 000000000000..69b49d150afb --- /dev/null +++ b/src/Shared/Obsoletions.cs @@ -0,0 +1,15 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System.Collections.Generic; +using System.Diagnostics; + +namespace Microsoft.AspNetCore.Shared; + +internal sealed class Obsoletions +{ + internal const string RuntimeSharedUrlFormat = "https://aka.ms/dotnet-warnings/{0}"; + + internal const string RuntimeTlsCipherAlgorithmEnumsMessage = "KeyExchangeAlgorithm, KeyExchangeStrength, CipherAlgorithm, CipherStrength, HashAlgorithm and HashStrength properties are obsolete. Use NegotiatedCipherSuite instead."; + internal const string RuntimeTlsCipherAlgorithmEnumsDiagId = "SYSLIB0058"; +}