diff --git a/ADotNet/Models/Pipelines/GithubPipelines/DotNets/Tasks/InstallPlaywrightBrowsersTask.cs b/ADotNet/Models/Pipelines/GithubPipelines/DotNets/Tasks/InstallPlaywrightBrowsersTask.cs new file mode 100644 index 0000000..3407963 --- /dev/null +++ b/ADotNet/Models/Pipelines/GithubPipelines/DotNets/Tasks/InstallPlaywrightBrowsersTask.cs @@ -0,0 +1,41 @@ +// --------------------------------------------------------------------------- +// Copyright (c) Hassan Habib & Shri Humrudha Jagathisun All rights reserved. +// Licensed under the MIT License. +// See License.txt in the project root for license information. +// --------------------------------------------------------------------------- + +namespace ADotNet.Models.Pipelines.GithubPipelines.DotNets.Tasks +{ + /// + /// Represents a task that installs Playwright browsers for a given project. + /// + public class InstallPlaywrightBrowsersTask : GithubTask + { + private readonly string projectName; + private readonly string dotnetVersion; + + /// + /// Initializes a new instance of the class. + /// + /// The name of the project for which Playwright browsers should be installed. + public InstallPlaywrightBrowsersTask( + string projectName, + string dotnetVersion = "net9.0") + { + this.projectName = projectName; + this.dotnetVersion = dotnetVersion; + } + /// + /// Gets or sets the name of the task. + /// The default value is: "Install Microsoft.Playwright.CLI". + /// + public override string Name { get; set; } = "Install Microsoft.Playwright.CLI."; + + /// + /// Gets the command to execute for the task. + /// The command installs Playwright browsers by running the Playwright CLI script. + /// The default value is: "pwsh ./{projectName}/bin/Debug/{dotnetVersion}/playwright.ps1 install". + /// + public override string Run => $"pwsh ./{projectName}/bin/Debug/{dotnetVersion}/playwright.ps1 install"; + } +} diff --git a/ADotNet/Models/Pipelines/GithubPipelines/DotNets/Tasks/InstallPlaywrightTask.cs b/ADotNet/Models/Pipelines/GithubPipelines/DotNets/Tasks/InstallPlaywrightTask.cs new file mode 100644 index 0000000..607861c --- /dev/null +++ b/ADotNet/Models/Pipelines/GithubPipelines/DotNets/Tasks/InstallPlaywrightTask.cs @@ -0,0 +1,13 @@ +// --------------------------------------------------------------------------- +// Copyright (c) Hassan Habib & Shri Humrudha Jagathisun All rights reserved. +// Licensed under the MIT License. +// See License.txt in the project root for license information. +// --------------------------------------------------------------------------- + +namespace ADotNet.Models.Pipelines.GithubPipelines.DotNets.Tasks +{ + public class InstallPlaywrightTask : GithubTask + { + public override string Run { get; set; } = "dotnet tool install --global Microsoft.Playwright.CLI"; + } +} diff --git a/ADotNet/Models/Pipelines/GithubPipelines/DotNets/Tasks/WorkloadUpdateTask.cs b/ADotNet/Models/Pipelines/GithubPipelines/DotNets/Tasks/WorkloadUpdateTask.cs new file mode 100644 index 0000000..f5c02cc --- /dev/null +++ b/ADotNet/Models/Pipelines/GithubPipelines/DotNets/Tasks/WorkloadUpdateTask.cs @@ -0,0 +1,13 @@ +// --------------------------------------------------------------------------- +// Copyright (c) Hassan Habib & Shri Humrudha Jagathisun All rights reserved. +// Licensed under the MIT License. +// See License.txt in the project root for license information. +// --------------------------------------------------------------------------- + +namespace ADotNet.Models.Pipelines.GithubPipelines.DotNets.Tasks +{ + public class WorkloadUpdateTask : GithubTask + { + public override string Run { get; set; } = "dotnet workload update"; + } +}