Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added CI for running UI integration tests. #37

Closed
wants to merge 4 commits into from
Closed
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
5 changes: 5 additions & 0 deletions .github/workflows/cake-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,9 @@ jobs:
corepack enable
corepack install --global [email protected]
dotnet cake

- name: UI Integration Tests
run: |
cd src
dotnet cake --target Test

3 changes: 2 additions & 1 deletion src/Cody.VisualStudio.Tests/CodyPackageTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ public async Task CodyToolWindow_Activated()
var codyPackage = await GetPackageAsync();

// when
codyPackage.ShowToolWindow(this, EventArgs.Empty);
await codyPackage.ShowToolWindowAsync();
await Task.Delay(TimeSpan.FromSeconds(10)); // TODO: waiting for the agent to fully initialize WebView

// then
Assert.NotNull(codyPackage.MainView);
Expand Down
2 changes: 1 addition & 1 deletion src/Cody.VisualStudio.Tests/PlaywrightTestsBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ private async Task InitializeAsync()
CodyPackage = await GetPackageAsync();
CodyPackage.Logger.Debug("CodyPackage loaded.");

CodyPackage.ShowToolWindow(this, EventArgs.Empty);
await CodyPackage.ShowToolWindowAsync();
CodyPackage.Logger.Debug("Tool Window activated.");

Playwright = await Microsoft.Playwright.Playwright.CreateAsync();
Expand Down
5 changes: 5 additions & 0 deletions src/Cody.VisualStudio/CodyPackage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,11 @@ private async Task InitOleMenu()
}

public async void ShowToolWindow(object sender, EventArgs eventArgs)
{
await ShowToolWindowAsync();
}

public async Task ShowToolWindowAsync()
{
try
{
Expand Down
27 changes: 19 additions & 8 deletions src/build.cake
Original file line number Diff line number Diff line change
Expand Up @@ -140,10 +140,28 @@ Task("Build")
MSBuild("./Cody.sln", new MSBuildSettings
{
Configuration = configuration,
PlatformTarget = PlatformTarget.MSIL
PlatformTarget = PlatformTarget.MSIL,
Verbosity = Verbosity.Minimal
});
});

Task("Test")
.Does(() =>
{
MSBuild("./Cody.sln", new MSBuildSettings
{
Configuration = "Debug",
PlatformTarget = PlatformTarget.MSIL,
Verbosity = Verbosity.Minimal
});

DotNetTest("./Cody.VisualStudio.Tests/bin/Debug/Cody.VisualStudio.Tests.dll", new DotNetTestSettings
{
NoBuild = true,
NoRestore = true
});
});

Task("Restore")
.Does(() =>
{
Expand Down Expand Up @@ -180,13 +198,6 @@ Task("Clean")
//todo
});

Task("Test")
.IsDependentOn("Build")
.Does(() =>
{
//todo
});

//////////////////////////////////////////////////////////////////////
// EXECUTION
//////////////////////////////////////////////////////////////////////
Expand Down
Loading