Skip to content
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions Directory.Build.targets
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,17 @@
SkipUnchangedFiles="$(SkipCopyUnchangedFiles)" />
</Target>

<!--
Remove the implicit package reference for Microsoft.AspNetCore.App.Internal.Assets.
Projects within the repo will consume framework assets by importing
Microsoft.AspNetCore.App.Internal.Assets.targets directly
-->
<Target Name="_RemoveAspNetCoreAppInternalAssetsReference" AfterTargets="ProcessFrameworkReferences">
<ItemGroup>
<PackageReference Remove="Microsoft.AspNetCore.App.Internal.Assets" />
</ItemGroup>
</Target>

<Import Project="eng\Workarounds.targets" />
<Import Project="artifacts\bin\GenerateFiles\Directory.Build.targets" Condition=" '$(MSBuildProjectName)' != 'GenerateFiles' " />
<Import Project="eng\targets\ResolveIisReferences.targets" Condition=" '$(MSBuildProjectExtension)' != '.vcxproj' " />
Expand Down
4 changes: 2 additions & 2 deletions global.json
Original file line number Diff line number Diff line change
@@ -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)"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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[]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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")).GetDomAttribute("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")).GetDomAttribute("value"));
}

[Fact]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand All @@ -59,19 +59,19 @@ 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]
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]
Expand All @@ -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]
Expand All @@ -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");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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']")).GetDomAttribute("value"));
},
};
DispatchToFormCore(dispatchToForm);
Expand Down Expand Up @@ -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]")).GetDomAttribute("value"));
},
SuppressEnhancedNavigation = suppressEnhancedNavigation,
};
Expand Down Expand Up @@ -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]")).GetDomAttribute("value"));
Assert.Equal("invalid", Browser.FindElement(By.CssSelector("input[name=OtherParameter]")).GetDomAttribute("value"));
},
SuppressEnhancedNavigation = suppressEnhancedNavigation,
};
Expand Down Expand Up @@ -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]")).GetDomAttribute("value"));
}
};
DispatchToFormCore(dispatchToForm);
Expand Down Expand Up @@ -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"));
}
}

Expand Down Expand Up @@ -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"));
}
}

Expand Down Expand Up @@ -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"));
}
}

Expand Down Expand Up @@ -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"));
}
}

Expand Down Expand Up @@ -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"));
}
}

Expand Down Expand Up @@ -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"));
}
}

Expand Down Expand Up @@ -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"));
}
}

Expand Down Expand Up @@ -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"));
}
}

Expand All @@ -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]")).GetDomAttribute("value"));
}
};
DispatchToFormCore(dispatchToForm);
Expand Down Expand Up @@ -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")).GetDomAttribute("value"));
Browser.Equal("StringViaOverriddenName value", () => Browser.Exists(By.CssSelector("#StringViaOverriddenName input")).GetDomAttribute("value"));
Browser.Equal(/* should not match */ "", () => Browser.Exists(By.CssSelector("#StringViaOverriddenNameUnmatched input")).GetDomAttribute("value"));
Browser.Equal("StringViaExpression value", () => Browser.Exists(By.CssSelector("#StringViaExpression input")).GetDomAttribute("value"));
Browser.Equal("StringViaExpressionWithHandler value", () => Browser.Exists(By.CssSelector("#StringViaExpressionWithHandler input")).GetDomAttribute("value"));
Browser.Equal(/* should not match */ "", () => Browser.Exists(By.CssSelector("#StringViaExpressionWithUnmatchedHandler input")).GetDomAttribute("value"));
Browser.Equal("PersonName value", () => Browser.Exists(By.CssSelector("#PersonName input")).GetDomAttribute("value"));
Browser.Equal("123", () => Browser.Exists(By.CssSelector("#PersonAge input")).GetDomAttribute("value"));
}

[Fact]
Expand Down Expand Up @@ -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")).GetDomAttribute("value"));
Browser.Equal("Def Modified", () => Browser.Exists(By.Id("complex-value")).GetDomAttribute("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")).GetDomAttribute("value"));
Browser.Equal("", () => Browser.Exists(By.Id("complex-value")).GetDomAttribute("value"));
Browser.Equal("2", () => Browser.Exists(By.Id("render-count")).Text);
Browser.Exists(By.Id("received-notification"));
}
Expand Down Expand Up @@ -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")).GetDomAttribute("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")).GetDomAttribute("value"));

// Checking that the history entry was not pushed
Browser.Navigate().Back();
Expand Down Expand Up @@ -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.GetDomAttribute("value"));
}

if (!dispatch.DispatchEvent)
Expand Down Expand Up @@ -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"));
}
}
}
Expand Down
Loading
Loading