?? ?? ??? PPTX/DOCX/XLSX/HTML ???? ? ?????, PPTX? ???? ??? ? ???? ?? ???? ? ??? ?? ?? ???? ????. ?? ????: - ExcelSkill? conditional_formats? ??? ?? ???? ??? ? ?????? OpenXML? ?? ???? workbook quality review? ?? - DocxSkill? style_map? ??? ???? ??/??/?? ???? ?? ?? ParagraphStyleId? ?? - HtmlSkill? print_header/print_footer ?? ?? ???? ???? ArtifactQualityReviewService? ?? ?? ?? ???? ?? - PptxTemplatePackRegistry? PptxSkill template_pack ????? ??? strategy/board/pmo/finance/sales/operating_model ??? ??? ?? ?? ?? ??? ?? - ?????, ????, ?? ???, ??? ?? ?? ?? ???? ???? ?? ?? ?? ???? ???? ???? ?? ?? ??: - dotnet build src/AxCopilot/AxCopilot.csproj -c Release -v minimal -p:OutputPath=bin\\verify_next_doc_ppt\\ -p:IntermediateOutputPath=obj\\verify_next_doc_ppt\\ => ?? 0 / ?? 0 - dotnet test src/AxCopilot.Tests/AxCopilot.Tests.csproj -c Release -v minimal --filter "ArtifactQualityReviewServiceTests|ExcelSkillDataValidationTests|ExcelSkillConditionalFormattingTests|ExcelSkillExecutiveSummaryLinkTests|ExcelSkillSummarySheetTests|DocxSkillTemplateFeaturesTests|DocxSkillStyleMapTests|HtmlSkillConsultingSectionsTests|HtmlSkillPrintFrameTests|DocumentAssemblerDocxFeaturesTests|PptxSkillConsultingDeckTests|PptxSkillAutoRepairTests|PptxSkillTemplatePackTests" -p:OutputPath=bin\\verify_next_doc_ppt_tests\\ -p:IntermediateOutputPath=obj\\verify_next_doc_ppt_tests\\ => ?? 15
63 lines
2.0 KiB
C#
63 lines
2.0 KiB
C#
using System.IO;
|
|
using System.Text.Json;
|
|
using AxCopilot.Services.Agent;
|
|
using FluentAssertions;
|
|
using Xunit;
|
|
|
|
namespace AxCopilot.Tests.Services;
|
|
|
|
public class HtmlSkillPrintFrameTests
|
|
{
|
|
[Fact]
|
|
public async Task ExecuteAsync_WithPrintHeaderAndFooter_ShouldRenderPrintFrame()
|
|
{
|
|
var workDir = Path.Combine(Path.GetTempPath(), "ax-html-printframe-" + Guid.NewGuid().ToString("N"));
|
|
Directory.CreateDirectory(workDir);
|
|
|
|
try
|
|
{
|
|
var tool = new HtmlSkill();
|
|
var context = new AgentContext
|
|
{
|
|
WorkFolder = workDir,
|
|
Permission = "Auto",
|
|
OperationMode = "external",
|
|
};
|
|
|
|
var args = JsonDocument.Parse(
|
|
"""
|
|
{
|
|
"path": "board-report.html",
|
|
"title": "Board Report",
|
|
"print": true,
|
|
"print_header": "Board Review",
|
|
"print_footer": "Confidential",
|
|
"body": "<h2>Executive Summary</h2><p>Summary text with enough detail to qualify as a printable executive report.</p><h2>Recommendation</h2><p>Approve phase 1.</p><h2>Appendix</h2><p>Evidence notes.</p>"
|
|
}
|
|
""").RootElement;
|
|
|
|
var result = await tool.ExecuteAsync(args, context, CancellationToken.None);
|
|
|
|
result.Success.Should().BeTrue();
|
|
result.Output.Should().Contain("Quality score");
|
|
|
|
var html = File.ReadAllText(Path.Combine(workDir, "board-report.html"));
|
|
html.Should().Contain("print-header");
|
|
html.Should().Contain("print-footer");
|
|
html.Should().Contain("Board Review");
|
|
html.Should().Contain("Confidential");
|
|
}
|
|
finally
|
|
{
|
|
try
|
|
{
|
|
if (Directory.Exists(workDir))
|
|
Directory.Delete(workDir, true);
|
|
}
|
|
catch
|
|
{
|
|
}
|
|
}
|
|
}
|
|
}
|