From 534a9e894a0680b1ea973a34e14c95f0f98306fa Mon Sep 17 00:00:00 2001 From: MaxSorokin Date: Thu, 16 Nov 2023 14:39:02 +0300 Subject: [PATCH] feature: search on smokes --- lib/coverage/test_coverage.rb | 14 ++++--- reports/coverage_result.json | 78 +++++++++++++++++++++++++++++++++-- 2 files changed, 82 insertions(+), 10 deletions(-) diff --git a/lib/coverage/test_coverage.rb b/lib/coverage/test_coverage.rb index d61eb4854..0f4b5da22 100644 --- a/lib/coverage/test_coverage.rb +++ b/lib/coverage/test_coverage.rb @@ -14,9 +14,9 @@ module TestCoverage }.freeze SOURCES = { - 'CDE' => File.join(Dir.pwd, 'js', 'docx').to_s, - 'CSE' => File.join(Dir.pwd, 'js', 'xlsx').to_s, - 'CPE' => File.join(Dir.pwd, 'js', 'pptx').to_s + 'CDE' => File.join(Dir.pwd, 'js', 'docx', 'smoke').to_s, + 'CSE' => File.join(Dir.pwd, 'js', 'xlsx', 'smoke').to_s, + 'CPE' => File.join(Dir.pwd, 'js', 'pptx', 'smoke').to_s }.freeze # MethodCoverage class @@ -49,7 +49,7 @@ def recursive_search(pattern = @pattern, node = @path) def contains_matches?(path, pattern) File.open(path, 'r') do |file| file.each_line do |line| - next unless line.include?(pattern) + next unless line.include?("#{pattern}(") @flag = true # Switch global flag break @@ -81,5 +81,7 @@ def self.run(method_list = get_api(ADDRESS)) end end -result = TestCoverage.run -File.binwrite(File.join(Dir.pwd, 'reports', 'coverage_result.json').to_s, result) +# p TestCoverage::Matcher.new('SetData', 'js').pattern_found? + +File.binwrite(File.join(Dir.pwd, 'reports', 'coverage_result.json').to_s, + TestCoverage.run) diff --git a/reports/coverage_result.json b/reports/coverage_result.json index e30669065..e94864465 100644 --- a/reports/coverage_result.json +++ b/reports/coverage_result.json @@ -20,9 +20,11 @@ "LoadMailMergeData", "MailMerge", "ReplaceDocumentContent", - "ReplaceTextSmart" + "ReplaceTextSmart", + "Save" ], "apiblocklvlsdt": [ + "AddCaption", "AddComment", "Delete", "GetAlias", @@ -38,9 +40,11 @@ "GetParentTableCell", "GetPlaceholderText", "GetPosInParent", + "GetRange", "GetTag", "ReplaceByElement", "Search", + "Select", "SetAlias", "SetBackgroundColor", "SetLabel", @@ -54,6 +58,7 @@ ], "ApiChart": [ + "ApplyChartStyle", "GetNextChart", "GetPrevChart", "RemoveSeria", @@ -81,10 +86,12 @@ "SetXValues" ], "ApiCheckBoxForm": [ + "Clear", "Copy", "GetFormKey", "GetFormType", "GetRadioGroup", + "GetText", "GetTipText", "GetWrapperShape", "IsChecked", @@ -104,10 +111,12 @@ "ToInline" ], "ApiComboBoxForm": [ + "Clear", "Copy", "GetFormKey", "GetFormType", "GetListValues", + "GetText", "GetTipText", "GetWrapperShape", "IsEditable", @@ -120,15 +129,18 @@ "SetListValues", "SetPlaceholderText", "SetRequired", + "SetText", "SetTextPr", "SetTipText", "ToFixed", "ToInline" ], "ApiComplexForm": [ + "Clear", "Copy", "GetFormKey", "GetFormType", + "GetText", "GetTipText", "GetWrapperShape", "IsFixed", @@ -144,6 +156,8 @@ "ToInline" ], "apicontentcontrollist": [ + "Add", + "Clear", "GetAllItems", "GetItem", "GetParent" @@ -152,25 +166,34 @@ "Delete", "GetIndex", "GetParent", + "GetText", "GetValue", "MoveDown", "MoveUp", + "Select", "SetIndex", + "SetText", "SetValue" ], "apidocument": [ "AcceptAllRevisionChanges", "AddComment", + "AddEndnote", + "AddFootnote", "AddTableOfContents", "AddTableOfFigures", "ClearAllFields", + "CreateNewHistoryPoint", "DeleteBookmark", "GetAllBookmarksNames", + "GetAllCaptionParagraphs", "GetAllCharts", "GetAllComments", "GetAllContentControls", "GetAllDrawingObjects", "GetAllForms", + "GetAllHeadingParagraphs", + "GetAllNumberedParagraphs", "GetAllOleObjects", "GetAllParagraphs", "GetAllShapes", @@ -180,8 +203,11 @@ "GetBookmarkRange", "GetCommentById", "GetContentControlsByTag", + "GetEndNotesFirstParagraphs", + "GetFootnotesFirstParagraphs", "GetFormsByTag", "GetPageCount", + "GetRange", "GetRangeBySelect", "GetSections", "GetSelectedDrawings", @@ -216,6 +242,7 @@ "GetAllParagraphs", "GetAllShapes", "GetAllTables", + "GetRange", "ToJSON" ], "ApiDrawing": [ @@ -233,6 +260,7 @@ "InsertParagraph", "ScaleHeight", "ScaleWidth", + "Select", "SetDrawingPrFromDrawing", "SetHorFlip", "SetLockValue", @@ -244,9 +272,11 @@ "ToJSON" ], "ApiFormBase": [ + "Clear", "Copy", "GetFormKey", "GetFormType", + "GetText", "GetTipText", "GetWrapperShape", "IsFixed", @@ -267,6 +297,7 @@ "ApiHyperlink": [ "GetDisplayedText", "GetLinkedText", + "GetRange", "GetScreenTipText", "SetDefaultStyle", "SetDisplayedText", @@ -291,6 +322,7 @@ "GetParentTable", "GetParentTableCell", "GetPlaceholderText", + "GetRange", "GetTag", "IsForm", "SetAlias", @@ -310,12 +342,20 @@ "ApiOleObject": [ "GetApplicationId", "GetData", - "SetApplicationId" + "SetApplicationId", + "SetData" ], "apiparagraph": [ + "AddBookmarkCrossRef", + "AddCaption", + "AddCaptionCrossRef", "AddComment", + "AddEndnoteCrossRef", + "AddFootnoteCrossRef", + "AddHeadingCrossRef", "AddHyperlink", "AddInlineLvlSdt", + "AddNumberedCrossRef", "Copy", "Delete", "GetAllCharts", @@ -335,17 +375,20 @@ "GetParentTableCell", "GetPosInParent", "GetPrevious", + "GetRange", "GetSection", "GetShd", "GetSpacingAfter", "GetSpacingBefore", "GetSpacingLineRule", "GetSpacingLineValue", + "GetText", "InsertInContentControl", "InsertParagraph", "Last", "ReplaceByElement", "Search", + "Select", "SetBullet", "SetSection", "SetTextPr", @@ -366,12 +409,14 @@ "ToJSON" ], "ApiPictureForm": [ + "Clear", "Copy", "GetFormKey", "GetFormType", "GetImage", "GetPicturePosition", "GetScaleFlag", + "GetText", "GetTipText", "GetWrapperShape", "IsFixed", @@ -397,12 +442,17 @@ "ToJSON" ], "ApiRange": [ + "AddBookmark", "AddComment", "AddHyperlink", "Delete", "ExpandTo", "GetAllParagraphs", + "GetParagraph", + "GetRange", + "GetText", "IntersectWith", + "Select", "SetTextPr", "ToJSON" ], @@ -418,6 +468,9 @@ "GetParentContentControl", "GetParentTable", "GetParentTableCell", + "GetRange", + "GetText", + "Select", "SetFill", "SetOutLine", "SetTextFill", @@ -445,9 +498,11 @@ "ToJSON" ], "apitable": [ + "AddCaption", "AddColumns", "AddComment", "AddRows", + "Clear", "Copy", "Delete", "GetNext", @@ -456,12 +511,14 @@ "GetParentTableCell", "GetPosInParent", "GetPrevious", + "GetRange", "GetTableDescription", "GetTables", "GetTableTitle", "InsertInContentControl", "ReplaceByElement", "Search", + "Select", "SetBackgroundColor", "SetHAlign", "SetPaddings", @@ -475,6 +532,7 @@ "ApiTableCell": [ "AddColumns", "AddRows", + "Clear", "GetIndex", "GetNext", "GetParentRow", @@ -501,10 +559,12 @@ ], "ApiTableRow": [ "AddRows", + "Clear", "GetIndex", "GetNext", "GetParentTable", "GetPrevious", + "Remove", "Search", "SetBackgroundColor", "SetTextPr", @@ -517,10 +577,12 @@ "ToJSON" ], "ApiTextForm": [ + "Clear", "Copy", "GetCharactersLimit", "GetFormKey", "GetFormType", + "GetText", "GetTipText", "GetWrapperShape", "IsAutoFit", @@ -538,6 +600,7 @@ "SetMultiline", "SetPlaceholderText", "SetRequired", + "SetText", "SetTextPr", "SetTipText", "ToFixed", @@ -561,10 +624,12 @@ "GetImageURL", "GetImageWidth", "GetOpacity", + "GetText", "SetDirection", "SetImageSize", "SetImageURL", "SetOpacity", + "SetText", "SetTextPr" ] }, @@ -583,6 +648,7 @@ "Intersect", "RecalculateAllFormulas", "ReplaceTextSmart", + "Save", "SetLocale", "event-onworksheetchange" ], @@ -631,7 +697,7 @@ ], "ApiComment": [ - + "GetText" ], "ApiDocument": [ @@ -694,6 +760,7 @@ "apirange": [ "AddComment", "AutoFit", + "Clear", "Copy", "End", "Find", @@ -706,8 +773,10 @@ "GetFillColor", "GetFormula", "GetOrientation", + "GetText", "GetValue2", "GetWorksheet", + "Insert", "Paste", "Replace", "SetOrientation", @@ -784,7 +853,8 @@ "detachEvent", "FromJSON", "GetFullName", - "ReplaceTextSmart" + "ReplaceTextSmart", + "Save" ], "ApiBullet": [