@@ -107,7 +107,7 @@ public void DataAnnotationsWorkForForms(bool suppressEnhancedNavigation)
107
107
{
108
108
var error = Assert . Single ( errors ) ;
109
109
Assert . Equal ( "Name is too long" , error . Text ) ;
110
- Assert . Equal ( "John" , Browser . FindElement ( By . CssSelector ( "input[name='Parameter.FirstName']" ) ) . GetAttribute ( "value" ) ) ;
110
+ Assert . Equal ( "John" , Browser . FindElement ( By . CssSelector ( "input[name='Parameter.FirstName']" ) ) . GetDomProperty ( "value" ) ) ;
111
111
} ,
112
112
} ;
113
113
DispatchToFormCore ( dispatchToForm ) ;
@@ -150,7 +150,7 @@ public void MultipleParametersMultipleFormsDoNotConflict(bool suppressEnhancedNa
150
150
{
151
151
var error = Assert . Single ( errors ) ;
152
152
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]" ) ) . GetAttribute ( "value" ) ) ;
153
+ Assert . Equal ( "abc" , Browser . FindElement ( By . CssSelector ( "form[name=bind-integer] input[name=Id]" ) ) . GetDomProperty ( "value" ) ) ;
154
154
} ,
155
155
SuppressEnhancedNavigation = suppressEnhancedNavigation ,
156
156
} ;
@@ -265,8 +265,8 @@ public void CanDisplayErrorsFromMultipleParametersToTheDefaultForm(bool suppress
265
265
{
266
266
Assert . Equal ( "The value 'invalid' is not valid for 'OtherParameter'." , error . Text ) ;
267
267
} ) ;
268
- Assert . Equal ( "abcd" , Browser . FindElement ( By . CssSelector ( "input[name=Parameter]" ) ) . GetAttribute ( "value" ) ) ;
269
- Assert . Equal ( "invalid" , Browser . FindElement ( By . CssSelector ( "input[name=OtherParameter]" ) ) . GetAttribute ( "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" ) ) ;
270
270
} ,
271
271
SuppressEnhancedNavigation = suppressEnhancedNavigation ,
272
272
} ;
@@ -294,7 +294,7 @@ public void CanHandleBindingErrorsBindParameterToTheDefaultForm(bool suppressEnh
294
294
{
295
295
Assert . Equal ( "The value 'abc' is not valid for 'Parameter'." , error . Text ) ;
296
296
} ) ;
297
- Assert . Equal ( "abc" , Browser . FindElement ( By . CssSelector ( "input[name=Parameter]" ) ) . GetAttribute ( "value" ) ) ;
297
+ Assert . Equal ( "abc" , Browser . FindElement ( By . CssSelector ( "input[name=Parameter]" ) ) . GetDomProperty ( "value" ) ) ;
298
298
}
299
299
} ;
300
300
DispatchToFormCore ( dispatchToForm ) ;
@@ -331,7 +331,7 @@ public void CanBindComplexTypeToDefaultForm(bool suppressEnhancedNavigation)
331
331
{
332
332
// Verify the same form element is still in the page
333
333
// We wouldn't be allowed to read the attribute if the element is stale
334
- Assert . NotEmpty ( form . GetAttribute ( "action" ) ) ;
334
+ Assert . NotEmpty ( form . GetDomAttribute ( "action" ) ) ;
335
335
}
336
336
}
337
337
@@ -388,7 +388,7 @@ public void CanBreakFormIntoMultipleComponents(bool suppressEnhancedNavigation)
388
388
{
389
389
// Verify the same form element is still in the page
390
390
// We wouldn't be allowed to read the attribute if the element is stale
391
- Assert . NotEmpty ( form . GetAttribute ( "action" ) ) ;
391
+ Assert . NotEmpty ( form . GetDomAttribute ( "action" ) ) ;
392
392
}
393
393
}
394
394
@@ -439,7 +439,7 @@ public void CanBreakFormIntoMultipleComponentsDisplaysErrorsCorrectly(bool suppr
439
439
{
440
440
// Verify the same form element is still in the page
441
441
// We wouldn't be allowed to read the attribute if the element is stale
442
- Assert . NotEmpty ( form . GetAttribute ( "action" ) ) ;
442
+ Assert . NotEmpty ( form . GetDomAttribute ( "action" ) ) ;
443
443
}
444
444
}
445
445
@@ -477,7 +477,7 @@ public void CanDisplayBindingErrorsComplexTypeToDefaultForm(bool suppressEnhance
477
477
{
478
478
// Verify the same form element is still in the page
479
479
// We wouldn't be allowed to read the attribute if the element is stale
480
- Assert . NotEmpty ( form . GetAttribute ( "action" ) ) ;
480
+ Assert . NotEmpty ( form . GetDomAttribute ( "action" ) ) ;
481
481
}
482
482
}
483
483
@@ -512,7 +512,7 @@ public void CanBindDictionaryToDefaultForm(bool suppressEnhancedNavigation)
512
512
{
513
513
// Verify the same form element is still in the page
514
514
// We wouldn't be allowed to read the attribute if the element is stale
515
- Assert . NotEmpty ( form . GetAttribute ( "action" ) ) ;
515
+ Assert . NotEmpty ( form . GetDomAttribute ( "action" ) ) ;
516
516
}
517
517
}
518
518
@@ -551,7 +551,7 @@ public void CanDisplayBindingErrorsDictionaryToDefaultForm(bool suppressEnhanced
551
551
{
552
552
// Verify the same form element is still in the page
553
553
// We wouldn't be allowed to read the attribute if the element is stale
554
- Assert . NotEmpty ( form . GetAttribute ( "action" ) ) ;
554
+ Assert . NotEmpty ( form . GetDomAttribute ( "action" ) ) ;
555
555
}
556
556
}
557
557
@@ -595,7 +595,7 @@ public void CanBindCollectionsToDefaultForm(bool suppressEnhancedNavigation)
595
595
{
596
596
// Verify the same form element is still in the page
597
597
// We wouldn't be allowed to read the attribute if the element is stale
598
- Assert . NotEmpty ( form . GetAttribute ( "action" ) ) ;
598
+ Assert . NotEmpty ( form . GetDomAttribute ( "action" ) ) ;
599
599
}
600
600
}
601
601
@@ -644,7 +644,7 @@ public void CanDisplayBindingErrorsCollectionsToDefaultForm(bool suppressEnhance
644
644
{
645
645
// Verify the same form element is still in the page
646
646
// We wouldn't be allowed to read the attribute if the element is stale
647
- Assert . NotEmpty ( form . GetAttribute ( "action" ) ) ;
647
+ Assert . NotEmpty ( form . GetDomAttribute ( "action" ) ) ;
648
648
}
649
649
}
650
650
@@ -670,7 +670,7 @@ public void CanHandleBindingErrorsBindParameterToNamedForm(bool suppressEnhanced
670
670
{
671
671
Assert . Equal ( "The value 'abc' is not valid for 'Parameter'." , error . Text ) ;
672
672
} ) ;
673
- Assert . Equal ( "abc" , Browser . FindElement ( By . CssSelector ( "input[name=Parameter]" ) ) . GetAttribute ( "value" ) ) ;
673
+ Assert . Equal ( "abc" , Browser . FindElement ( By . CssSelector ( "input[name=Parameter]" ) ) . GetDomProperty ( "value" ) ) ;
674
674
}
675
675
} ;
676
676
DispatchToFormCore ( dispatchToForm ) ;
@@ -977,14 +977,14 @@ public void CanUsePlainForm(bool suppressEnhancedNavigation)
977
977
Browser . Exists ( By . Id ( "send" ) ) . Click ( ) ;
978
978
Browser . Exists ( By . Id ( "pass" ) ) ;
979
979
980
- Browser . Equal ( "StringViaExplicitPropertyName value" , ( ) => Browser . Exists ( By . CssSelector ( "#StringViaExplicitPropertyName input" ) ) . GetAttribute ( "value" ) ) ;
981
- Browser . Equal ( "StringViaOverriddenName value" , ( ) => Browser . Exists ( By . CssSelector ( "#StringViaOverriddenName input" ) ) . GetAttribute ( "value" ) ) ;
982
- Browser . Equal ( /* should not match */ "" , ( ) => Browser . Exists ( By . CssSelector ( "#StringViaOverriddenNameUnmatched input" ) ) . GetAttribute ( "value" ) ) ;
983
- Browser . Equal ( "StringViaExpression value" , ( ) => Browser . Exists ( By . CssSelector ( "#StringViaExpression input" ) ) . GetAttribute ( "value" ) ) ;
984
- Browser . Equal ( "StringViaExpressionWithHandler value" , ( ) => Browser . Exists ( By . CssSelector ( "#StringViaExpressionWithHandler input" ) ) . GetAttribute ( "value" ) ) ;
985
- Browser . Equal ( /* should not match */ "" , ( ) => Browser . Exists ( By . CssSelector ( "#StringViaExpressionWithUnmatchedHandler input" ) ) . GetAttribute ( "value" ) ) ;
986
- Browser . Equal ( "PersonName value" , ( ) => Browser . Exists ( By . CssSelector ( "#PersonName input" ) ) . GetAttribute ( "value" ) ) ;
987
- Browser . Equal ( "123" , ( ) => Browser . Exists ( By . CssSelector ( "#PersonAge input" ) ) . GetAttribute ( "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" ) ) ;
988
988
}
989
989
990
990
[ Fact ]
@@ -1159,15 +1159,15 @@ public void CanMutateDataSuppliedFromForm(bool suppressEnhancedNavigation)
1159
1159
// Remember that the rendercount would be reset to zero since this is SSR, so
1160
1160
// receiving 2 here shows we did render twice on this cycle
1161
1161
Browser . Exists ( By . Id ( "mutate-and-notify" ) ) . Click ( ) ;
1162
- Browser . Equal ( "Abc Modified" , ( ) => Browser . Exists ( By . Id ( "simple-value" ) ) . GetAttribute ( "value" ) ) ;
1163
- Browser . Equal ( "Def Modified" , ( ) => Browser . Exists ( By . Id ( "complex-value" ) ) . GetAttribute ( "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" ) ) ;
1164
1164
Browser . Equal ( "2" , ( ) => Browser . Exists ( By . Id ( "render-count" ) ) . Text ) ;
1165
1165
Browser . Exists ( By . Id ( "received-notification" ) ) ;
1166
1166
1167
1167
// Can perform a submit that replaces the received object entirely
1168
1168
Browser . Exists ( By . Id ( "clear-and-notify" ) ) . Click ( ) ;
1169
- Browser . Equal ( "" , ( ) => Browser . Exists ( By . Id ( "simple-value" ) ) . GetAttribute ( "value" ) ) ;
1170
- Browser . Equal ( "" , ( ) => Browser . Exists ( By . Id ( "complex-value" ) ) . GetAttribute ( "value" ) ) ;
1169
+ Browser . Equal ( "" , ( ) => Browser . Exists ( By . Id ( "simple-value" ) ) . GetDomProperty ( "value" ) ) ;
1170
+ Browser . Equal ( "" , ( ) => Browser . Exists ( By . Id ( "complex-value" ) ) . GetDomProperty ( "value" ) ) ;
1171
1171
Browser . Equal ( "2" , ( ) => Browser . Exists ( By . Id ( "render-count" ) ) . Text ) ;
1172
1172
Browser . Exists ( By . Id ( "received-notification" ) ) ;
1173
1173
}
@@ -1495,14 +1495,14 @@ public void EnhancedFormThatCallsNavigationManagerRefreshDoesNotPushHistoryEntry
1495
1495
1496
1496
// Submit the form
1497
1497
Browser . FindElement ( By . Id ( "some-text" ) ) . SendKeys ( "test string" ) ;
1498
- Browser . Equal ( "test string" , ( ) => Browser . FindElement ( By . Id ( "some-text" ) ) . GetAttribute ( "value" ) ) ;
1498
+ Browser . Equal ( "test string" , ( ) => Browser . FindElement ( By . Id ( "some-text" ) ) . GetDomProperty ( "value" ) ) ;
1499
1499
Browser . Exists ( By . Id ( "submit-button" ) ) . Click ( ) ;
1500
1500
1501
1501
// Wait for the async/streaming process to complete. We know this happened
1502
1502
// if the loading indicator says we're done, and the textbox was cleared
1503
1503
// due to the refresh
1504
1504
Browser . Equal ( "False" , ( ) => Browser . FindElement ( By . Id ( "loading-indicator" ) ) . Text ) ;
1505
- Browser . Equal ( "" , ( ) => Browser . FindElement ( By . Id ( "some-text" ) ) . GetAttribute ( "value" ) ) ;
1505
+ Browser . Equal ( "" , ( ) => Browser . FindElement ( By . Id ( "some-text" ) ) . GetDomProperty ( "value" ) ) ;
1506
1506
1507
1507
// Checking that the history entry was not pushed
1508
1508
Browser . Navigate ( ) . Back ( ) ;
@@ -1532,7 +1532,7 @@ private void DispatchToFormCore(DispatchToForm dispatch)
1532
1532
if ( dispatch . ExpectedHandlerValue != null )
1533
1533
{
1534
1534
var handlerInput = form . FindElement ( By . CssSelector ( "input[type=hidden][name=_handler]" ) ) ;
1535
- Assert . Equal ( dispatch . ExpectedHandlerValue , handlerInput . GetAttribute ( "value" ) ) ;
1535
+ Assert . Equal ( dispatch . ExpectedHandlerValue , handlerInput . GetDomProperty ( "value" ) ) ;
1536
1536
}
1537
1537
1538
1538
if ( ! dispatch . DispatchEvent )
@@ -1598,7 +1598,7 @@ private void DispatchToFormCore(DispatchToForm dispatch)
1598
1598
{
1599
1599
// Verify the same form element is still in the page
1600
1600
// We wouldn't be allowed to read the attribute if the element is stale
1601
- Assert . Equal ( "post" , form . GetAttribute ( "method" ) ) ;
1601
+ Assert . Equal ( "post" , form . GetDomAttribute ( "method" ) , ignoreCase : true ) ;
1602
1602
}
1603
1603
}
1604
1604
}
0 commit comments