DATA: InstallPlaywrightBrowsersTask - #140
Open
mabroukmahdhi wants to merge 4 commits into
Open
Conversation
cjdutoit
reviewed
Jan 27, 2025
cjdutoit
reviewed
Jan 27, 2025
cjdutoit
reviewed
Jan 27, 2025
|
|
||
| namespace ADotNet.Models.Pipelines.GithubPipelines.DotNets.Tasks | ||
| { | ||
| public class InstallPlaywrightBrowsersTask : GithubTask |
cjdutoit
reviewed
Jan 27, 2025
| { | ||
| [YamlIgnore] | ||
| public string ProjectName { get; set; } | ||
| public override string Run => $"pwsh ./{ProjectName}/bin/Debug/net9.0/playwright.ps1 install"; |
Collaborator
There was a problem hiding this comment.
Add documentation to show the default command so consumers can know when to override it with additional arguments
Collaborator
There was a problem hiding this comment.
Just using ProjectName as a property is not enforcing its use. I would suggest taking that value in via a constructor so consumer does not have to figure out what is needed.
/// <summary>
/// Represents a task that installs Playwright browsers for a given project.
/// </summary>
public class InstallPlaywrightBrowsersTask : GithubTask
{
/// <summary>
/// Initializes a new instance of the <see cref="InstallPlaywrightBrowsersTask"/> class.
/// </summary>
/// <param name="projectName">The name of the project for which Playwright browsers should be installed.</param>
public InstallPlaywrightBrowsersTask(string projectName)
{
this.projectName = projectName;
}
/// <summary>
/// Gets or sets the name of the task.
/// The default value is: "Install Microsoft.Playwright.CLI".
/// </summary>
public override string Name { get; set; } = "Install Microsoft.Playwright.CLI.";
/// <summary>
/// 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/net9.0/playwright.ps1 install".
/// </summary>
public override string Run => $"pwsh ./{projectName}/bin/Debug/net9.0/playwright.ps1 install";
private readonly string projectName;
}
Contributor
Author
There was a problem hiding this comment.
I also added .NET version as parameter:
public InstallPlaywrightBrowsersTask(
string projectName,
string dotnetVersion = "net9.0")
{
this.projectName = projectName;
this.dotnetVersion = dotnetVersion;
}
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
closes #138