这是indexloc提供的服务,不要输入任何密码
Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
10 changes: 9 additions & 1 deletion azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ variables:
value: '16.13.0'
- name: TryDotNetPackagesPath
value: $(Build.SourcesDirectory)/artifacts/.trydotnet/packages
- name: RunIntegrationTests
value: true

stages:
- stage: build
Expand Down Expand Up @@ -125,6 +127,8 @@ stages:
displayName: Test / Blame
workingDirectory: $(Build.SourcesDirectory)
condition: ne(variables['SkipTests'], 'true')
env:
RunIntegrationTests: $(RunIntegrationTests)

- pwsh: Get-ChildItem *.dmp -Recurse | Remove-Item
displayName: Delete dump files
Expand All @@ -146,6 +150,7 @@ stages:
artifactName: Windows_playwright_screenshots
artifactType: container
condition: always()
continueOnError: true

- task: PublishBuildArtifacts@1
displayName: Publish packages to artifacts container
Expand Down Expand Up @@ -223,6 +228,8 @@ stages:
displayName: Test / Blame
workingDirectory: $(Build.SourcesDirectory)
condition: ne(variables['SkipTests'], 'true')
env:
RunIntegrationTests: $(RunIntegrationTests)

- pwsh: Get-ChildItem *.dmp -Recurse | Remove-Item
displayName: Delete dump files
Expand All @@ -236,14 +243,15 @@ stages:
artifactName: Linux_test_results_and_dumps
artifactType: container
condition: failed()

- task: PublishBuildArtifacts@1
displayName: Publish Playwright screen shots
inputs:
pathToPublish: $(Build.SourcesDirectory)/artifacts/bin/Microsoft.TryDotNet.IntegrationTests/Release/net6.0/playwright_screenshots
artifactName: Linux_playwright_screenshots
artifactType: container
condition: always()
continueOnError: true

#---------------------------------------------------------------------------------------------------------------------#
# Post Build #
Expand Down
36 changes: 18 additions & 18 deletions src/Microsoft.TryDotNet.IntegrationTests/EditorTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public EditorTests(PlaywrightFixture playwright, TryDotNetFixture tryDotNet) : b

}

[Fact]
[IntegrationTestFact]
public async Task can_load_monaco_editor()
{
var page = await Playwright.Browser!.NewPageAsync();
Expand All @@ -35,7 +35,7 @@ public async Task can_load_monaco_editor()

}

[Fact]
[IntegrationTestFact]
public async Task can_load_the_wasm_runner()
{
var wasmRunnerLoaded = false;
Expand All @@ -60,7 +60,7 @@ await page.RouteAsync("**/*", async route =>
wasmRunnerLoaded.Should().BeTrue();
}

[Fact]
[IntegrationTestFact]
public async Task wasm_runner_is_not_visible_to_screenReaders()
{
var page = await Playwright.Browser!.NewPageAsync();
Expand All @@ -77,7 +77,7 @@ public async Task wasm_runner_is_not_visible_to_screenReaders()

}

[Fact]
[IntegrationTestFact]
public async Task wasm_runner_is_not_part_of_tab_navigation()
{
var page = await Playwright.Browser!.NewPageAsync();
Expand All @@ -94,7 +94,7 @@ public async Task wasm_runner_is_not_part_of_tab_navigation()

}

[Fact]
[IntegrationTestFact]
public async Task notifies_when_editor_is_ready()
{
var page = await Playwright.Browser!.NewPageAsync();
Expand All @@ -111,7 +111,7 @@ public async Task notifies_when_editor_is_ready()
found.Should().NotBeNull();
}

[Fact]
[IntegrationTestFact]
public async Task can_open_project()
{
var page = await Playwright.Browser!.NewPageAsync();
Expand Down Expand Up @@ -143,7 +143,7 @@ await page.DispatchMessage(new
projectLoaded.Should().NotBeNull();
}

[Fact]
[IntegrationTestFact]
public async Task can_open_document()
{
var page = await Playwright.Browser!.NewPageAsync();
Expand Down Expand Up @@ -187,7 +187,7 @@ await page.DispatchMessage(new
text.Should().Contain(randomValue);
}

[Fact]
[IntegrationTestFact]
public async Task can_open_document_and_populate_editor_from_region()
{
var page = await Playwright.Browser!.NewPageAsync();
Expand Down Expand Up @@ -231,7 +231,7 @@ await page.DispatchMessage(new
text.Should().Contain("Console.WriteLine(123);");
}

[Fact]
[IntegrationTestFact]
public async Task minimap_is_not_visible()
{
var page = await Playwright.Browser!.NewPageAsync();
Expand All @@ -245,7 +245,7 @@ public async Task minimap_is_not_visible()
isHidden.Should().BeTrue();
}

[Fact]
[IntegrationTestFact]
public async Task can_show_minimap()
{
var page = await Playwright.Browser!.NewPageAsync();
Expand All @@ -270,7 +270,7 @@ await page.DispatchMessage(new
isVisible.Should().BeTrue();
}

[Fact]
[IntegrationTestFact]
public async Task can_configure_theme()
{
var page = await Playwright.Browser!.NewPageAsync();
Expand All @@ -291,7 +291,7 @@ await page.DispatchMessage(new
classAttribute.Should().Contain("vs-dark");
}

[Fact]
[IntegrationTestFact]
public async Task when_user_code_in_editor_diagnostics_are_produced()
{
var page = await Playwright.Browser!.NewPageAsync();
Expand Down Expand Up @@ -357,7 +357,7 @@ await editor.TypeAsync(@"/////////////////////////
markers.Should().ContainSingle(m => m == expected);
}

[Fact]
[IntegrationTestFact]
public async Task when_user_code_in_editor_is_executed_display_events_are_produced()
{
var page = await Playwright.Browser!.NewPageAsync();
Expand Down Expand Up @@ -415,7 +415,7 @@ static void Main() {{
.Contain(randomValue);
}

[Fact]
[IntegrationTestFact]
public async Task user_typing_code_gets_completion()
{
var page = await Playwright.Browser!.NewPageAsync();
Expand Down Expand Up @@ -473,7 +473,7 @@ static void Main() {{
completionItemDisplayText.Should().Contain(new[] { "BackgroundColor", "Beep", "Clear" });
}

[Fact]
[IntegrationTestFact]
public async Task user_typing_code_gets_signatureHelp()
{
var page = await Playwright.Browser!.NewPageAsync();
Expand Down Expand Up @@ -537,7 +537,7 @@ Writes the current line terminator to the standard output stream.
".Trim().Replace("\r", ""));
}

[Fact]
[IntegrationTestFact]
public async Task when_user_code_in_editor_is_executed_it_produces_runResult_event()
{
var page = await Playwright.Browser!.NewPageAsync();
Expand Down Expand Up @@ -594,7 +594,7 @@ static void Main() {{
.Contain("Success");
}

[Fact]
[IntegrationTestFact]
public async Task when_user_code_in_editor_is_executed_it_produces_runResult_event_with_outputs()
{
var page = await Playwright.Browser!.NewPageAsync();
Expand Down Expand Up @@ -653,7 +653,7 @@ static void Main() {{
.Contain($"[\"{randomValue}\\n\",\"{randomValue}a\\n\",\"{randomValue}b\\n\"]");
}

[Fact]
[IntegrationTestFact]
public async Task user_code_in_editor_is_executed()
{
var page = await Playwright.Browser!.NewPageAsync();
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
// Copyright (c) .NET Foundation and contributors. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.

using System;
using Xunit;

namespace Microsoft.TryDotNet.IntegrationTests
{
internal class IntegrationTestFactAttribute : FactAttribute
{
private const string EnvironmentVariableName = "RunIntegrationTests";

public IntegrationTestFactAttribute()
{
var variableValue = Environment.GetEnvironmentVariable(EnvironmentVariableName) ?? "false";
switch (variableValue.ToLowerInvariant())
{
case "1":
case "true":
break;
default:
Skip = $"Skipping integration tests because environment variable '{EnvironmentVariableName}' was not 'true' or '1'.";
break;
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public TryDotNetJsIntegrationTests(PlaywrightFixture playwright, TryDotNetFixtur
Learn = learn;
}

[Fact]
[IntegrationTestFact]
public async Task loads_trydotnet_editor()
{
var page = await Playwright.Browser!.NewPageAsync();
Expand All @@ -44,7 +44,7 @@ public async Task loads_trydotnet_editor()
await page.FindEditor();
}

[Fact]
[IntegrationTestFact]
public async Task can_load_code()
{
var page = await Playwright.Browser!.NewPageAsync();
Expand Down Expand Up @@ -75,7 +75,7 @@ public async Task can_load_code()
text.Should().Contain("Console.WriteLine(123);");
}

[Fact]
[IntegrationTestFact]
public async Task outputs_are_rendered()
{
var page = await Playwright.Browser!.NewPageAsync();
Expand Down Expand Up @@ -122,4 +122,4 @@ await page.RunAndWaitForConsoleMessageAsync(async () =>
var result = await outputElement.TextContentAsync();
result.Should().Be("123\n");
}
}
}
8 changes: 4 additions & 4 deletions src/Microsoft.TryDotNet.IntegrationTests/WasmRunnerTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ namespace Microsoft.TryDotNet.IntegrationTests;
public class WasmRunnerTests : PlaywrightTestBase
{

[Fact]
[IntegrationTestFact]
public async Task can_load_wasmrunner()
{
var page = await Playwright.Browser!.NewPageAsync();
Expand All @@ -25,7 +25,7 @@ public async Task can_load_wasmrunner()
await page.TestScreenShotAsync();
}

[Fact]
[IntegrationTestFact]
public async Task can_run_assembly()
{
var page = await Playwright.Browser!.NewPageAsync();
Expand All @@ -45,7 +45,7 @@ public async Task can_run_assembly()
.result!.success.Should().Be(true);
}

[Fact]
[IntegrationTestFact]
public async Task can_run_assembly_2()
{
var page = await Playwright.Browser!.NewPageAsync();
Expand All @@ -65,7 +65,7 @@ public async Task can_run_assembly_2()
.result!.success.Should().Be(true);
}

[Fact]
[IntegrationTestFact]
public async Task can_run_assembly_and_produce_output()
{
var page = await Playwright.Browser!.NewPageAsync();
Expand Down
1 change: 1 addition & 0 deletions src/microsoft-learn-mock/.npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
registry=https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/
Loading