Skip to content

Commit a283803

Browse files
committed
Fix value property asserts
1 parent 2cd4ef7 commit a283803

File tree

13 files changed

+441
-441
lines changed

13 files changed

+441
-441
lines changed

src/Components/test/E2ETest/ServerExecutionTests/PrerenderingTest.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,13 +56,13 @@ public void CanUseJSInteropFromOnAfterRenderAsync()
5656

5757
// Prerendered output can't use JSInterop
5858
Browser.Equal("No value yet", () => Browser.Exists(By.Id("val-get-by-interop")).Text);
59-
Browser.Equal(string.Empty, () => Browser.Exists(By.Id("val-set-by-interop")).GetDomAttribute("value"));
59+
Browser.Equal(string.Empty, () => Browser.Exists(By.Id("val-set-by-interop")).GetDomProperty("value"));
6060

6161
BeginInteractivity();
6262

6363
// Once connected, we can
6464
Browser.Equal("Hello from interop call", () => Browser.Exists(By.Id("val-get-by-interop")).Text);
65-
Browser.Equal("Hello from interop call", () => Browser.Exists(By.Id("val-set-by-interop")).GetDomAttribute("value"));
65+
Browser.Equal("Hello from interop call", () => Browser.Exists(By.Id("val-set-by-interop")).GetDomProperty("value"));
6666
}
6767

6868
[Fact]

src/Components/test/E2ETest/ServerRenderingTests/FormHandlingTests/FormWithParentBindingContextTest.cs

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ public void DataAnnotationsWorkForForms(bool suppressEnhancedNavigation)
107107
{
108108
var error = Assert.Single(errors);
109109
Assert.Equal("Name is too long", error.Text);
110-
Assert.Equal("John", Browser.FindElement(By.CssSelector("input[name='Parameter.FirstName']")).GetDomAttribute("value"));
110+
Assert.Equal("John", Browser.FindElement(By.CssSelector("input[name='Parameter.FirstName']")).GetDomProperty("value"));
111111
},
112112
};
113113
DispatchToFormCore(dispatchToForm);
@@ -150,7 +150,7 @@ public void MultipleParametersMultipleFormsDoNotConflict(bool suppressEnhancedNa
150150
{
151151
var error = Assert.Single(errors);
152152
Assert.Equal("The value 'abc' is not valid for 'Id'.", error.Text);
153-
Assert.Equal("abc", Browser.FindElement(By.CssSelector("form[name=bind-integer] input[name=Id]")).GetDomAttribute("value"));
153+
Assert.Equal("abc", Browser.FindElement(By.CssSelector("form[name=bind-integer] input[name=Id]")).GetDomProperty("value"));
154154
},
155155
SuppressEnhancedNavigation = suppressEnhancedNavigation,
156156
};
@@ -265,8 +265,8 @@ public void CanDisplayErrorsFromMultipleParametersToTheDefaultForm(bool suppress
265265
{
266266
Assert.Equal("The value 'invalid' is not valid for 'OtherParameter'.", error.Text);
267267
});
268-
Assert.Equal("abcd", Browser.FindElement(By.CssSelector("input[name=Parameter]")).GetDomAttribute("value"));
269-
Assert.Equal("invalid", Browser.FindElement(By.CssSelector("input[name=OtherParameter]")).GetDomAttribute("value"));
268+
Assert.Equal("abcd", Browser.FindElement(By.CssSelector("input[name=Parameter]")).GetDomProperty("value"));
269+
Assert.Equal("invalid", Browser.FindElement(By.CssSelector("input[name=OtherParameter]")).GetDomProperty("value"));
270270
},
271271
SuppressEnhancedNavigation = suppressEnhancedNavigation,
272272
};
@@ -294,7 +294,7 @@ public void CanHandleBindingErrorsBindParameterToTheDefaultForm(bool suppressEnh
294294
{
295295
Assert.Equal("The value 'abc' is not valid for 'Parameter'.", error.Text);
296296
});
297-
Assert.Equal("abc", Browser.FindElement(By.CssSelector("input[name=Parameter]")).GetDomAttribute("value"));
297+
Assert.Equal("abc", Browser.FindElement(By.CssSelector("input[name=Parameter]")).GetDomProperty("value"));
298298
}
299299
};
300300
DispatchToFormCore(dispatchToForm);
@@ -670,7 +670,7 @@ public void CanHandleBindingErrorsBindParameterToNamedForm(bool suppressEnhanced
670670
{
671671
Assert.Equal("The value 'abc' is not valid for 'Parameter'.", error.Text);
672672
});
673-
Assert.Equal("abc", Browser.FindElement(By.CssSelector("input[name=Parameter]")).GetDomAttribute("value"));
673+
Assert.Equal("abc", Browser.FindElement(By.CssSelector("input[name=Parameter]")).GetDomProperty("value"));
674674
}
675675
};
676676
DispatchToFormCore(dispatchToForm);
@@ -977,14 +977,14 @@ public void CanUsePlainForm(bool suppressEnhancedNavigation)
977977
Browser.Exists(By.Id("send")).Click();
978978
Browser.Exists(By.Id("pass"));
979979

980-
Browser.Equal("StringViaExplicitPropertyName value", () => Browser.Exists(By.CssSelector("#StringViaExplicitPropertyName input")).GetDomAttribute("value"));
981-
Browser.Equal("StringViaOverriddenName value", () => Browser.Exists(By.CssSelector("#StringViaOverriddenName input")).GetDomAttribute("value"));
982-
Browser.Equal(/* should not match */ "", () => Browser.Exists(By.CssSelector("#StringViaOverriddenNameUnmatched input")).GetDomAttribute("value"));
983-
Browser.Equal("StringViaExpression value", () => Browser.Exists(By.CssSelector("#StringViaExpression input")).GetDomAttribute("value"));
984-
Browser.Equal("StringViaExpressionWithHandler value", () => Browser.Exists(By.CssSelector("#StringViaExpressionWithHandler input")).GetDomAttribute("value"));
985-
Browser.Equal(/* should not match */ "", () => Browser.Exists(By.CssSelector("#StringViaExpressionWithUnmatchedHandler input")).GetDomAttribute("value"));
986-
Browser.Equal("PersonName value", () => Browser.Exists(By.CssSelector("#PersonName input")).GetDomAttribute("value"));
987-
Browser.Equal("123", () => Browser.Exists(By.CssSelector("#PersonAge input")).GetDomAttribute("value"));
980+
Browser.Equal("StringViaExplicitPropertyName value", () => Browser.Exists(By.CssSelector("#StringViaExplicitPropertyName input")).GetDomProperty("value"));
981+
Browser.Equal("StringViaOverriddenName value", () => Browser.Exists(By.CssSelector("#StringViaOverriddenName input")).GetDomProperty("value"));
982+
Browser.Equal(/* should not match */ "", () => Browser.Exists(By.CssSelector("#StringViaOverriddenNameUnmatched input")).GetDomProperty("value"));
983+
Browser.Equal("StringViaExpression value", () => Browser.Exists(By.CssSelector("#StringViaExpression input")).GetDomProperty("value"));
984+
Browser.Equal("StringViaExpressionWithHandler value", () => Browser.Exists(By.CssSelector("#StringViaExpressionWithHandler input")).GetDomProperty("value"));
985+
Browser.Equal(/* should not match */ "", () => Browser.Exists(By.CssSelector("#StringViaExpressionWithUnmatchedHandler input")).GetDomProperty("value"));
986+
Browser.Equal("PersonName value", () => Browser.Exists(By.CssSelector("#PersonName input")).GetDomProperty("value"));
987+
Browser.Equal("123", () => Browser.Exists(By.CssSelector("#PersonAge input")).GetDomProperty("value"));
988988
}
989989

990990
[Fact]
@@ -1159,15 +1159,15 @@ public void CanMutateDataSuppliedFromForm(bool suppressEnhancedNavigation)
11591159
// Remember that the rendercount would be reset to zero since this is SSR, so
11601160
// receiving 2 here shows we did render twice on this cycle
11611161
Browser.Exists(By.Id("mutate-and-notify")).Click();
1162-
Browser.Equal("Abc Modified", () => Browser.Exists(By.Id("simple-value")).GetDomAttribute("value"));
1163-
Browser.Equal("Def Modified", () => Browser.Exists(By.Id("complex-value")).GetDomAttribute("value"));
1162+
Browser.Equal("Abc Modified", () => Browser.Exists(By.Id("simple-value")).GetDomProperty("value"));
1163+
Browser.Equal("Def Modified", () => Browser.Exists(By.Id("complex-value")).GetDomProperty("value"));
11641164
Browser.Equal("2", () => Browser.Exists(By.Id("render-count")).Text);
11651165
Browser.Exists(By.Id("received-notification"));
11661166

11671167
// Can perform a submit that replaces the received object entirely
11681168
Browser.Exists(By.Id("clear-and-notify")).Click();
1169-
Browser.Equal("", () => Browser.Exists(By.Id("simple-value")).GetDomAttribute("value"));
1170-
Browser.Equal("", () => Browser.Exists(By.Id("complex-value")).GetDomAttribute("value"));
1169+
Browser.Equal("", () => Browser.Exists(By.Id("simple-value")).GetDomProperty("value"));
1170+
Browser.Equal("", () => Browser.Exists(By.Id("complex-value")).GetDomProperty("value"));
11711171
Browser.Equal("2", () => Browser.Exists(By.Id("render-count")).Text);
11721172
Browser.Exists(By.Id("received-notification"));
11731173
}
@@ -1495,14 +1495,14 @@ public void EnhancedFormThatCallsNavigationManagerRefreshDoesNotPushHistoryEntry
14951495

14961496
// Submit the form
14971497
Browser.FindElement(By.Id("some-text")).SendKeys("test string");
1498-
Browser.Equal("test string", () => Browser.FindElement(By.Id("some-text")).GetDomAttribute("value"));
1498+
Browser.Equal("test string", () => Browser.FindElement(By.Id("some-text")).GetDomProperty("value"));
14991499
Browser.Exists(By.Id("submit-button")).Click();
15001500

15011501
// Wait for the async/streaming process to complete. We know this happened
15021502
// if the loading indicator says we're done, and the textbox was cleared
15031503
// due to the refresh
15041504
Browser.Equal("False", () => Browser.FindElement(By.Id("loading-indicator")).Text);
1505-
Browser.Equal("", () => Browser.FindElement(By.Id("some-text")).GetDomAttribute("value"));
1505+
Browser.Equal("", () => Browser.FindElement(By.Id("some-text")).GetDomProperty("value"));
15061506

15071507
// Checking that the history entry was not pushed
15081508
Browser.Navigate().Back();
@@ -1532,7 +1532,7 @@ private void DispatchToFormCore(DispatchToForm dispatch)
15321532
if (dispatch.ExpectedHandlerValue != null)
15331533
{
15341534
var handlerInput = form.FindElement(By.CssSelector("input[type=hidden][name=_handler]"));
1535-
Assert.Equal(dispatch.ExpectedHandlerValue, handlerInput.GetDomAttribute("value"));
1535+
Assert.Equal(dispatch.ExpectedHandlerValue, handlerInput.GetDomProperty("value"));
15361536
}
15371537

15381538
if (!dispatch.DispatchEvent)

src/Components/test/E2ETest/ServerRenderingTests/FormHandlingTests/NamedFormNoParentBindingContextTest.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public void CanDispatchToNamedFormNoParentBindingContext()
3232
Browser.Exists(By.Id("ready"));
3333

3434
var form = Browser.Exists(By.CssSelector("form"));
35-
Browser.Equal("named-form-handler", () => form.FindElement(By.CssSelector("input[name=_handler]")).GetDomAttribute("value"));
35+
Browser.Equal("named-form-handler", () => form.FindElement(By.CssSelector("input[name=_handler]")).GetDomProperty("value"));
3636

3737
Browser.Click(By.Id("send"));
3838
Browser.Exists(By.Id("pass"));

0 commit comments

Comments
 (0)