diff --git a/tests/smoke/Tests_SmokeCommonModules/Tests_SmokeCommonModules/Ext/ObjectModule.bsl b/tests/smoke/Tests_SmokeCommonModules/Tests_SmokeCommonModules/Ext/ObjectModule.bsl index 0d08b6569..0dc184916 100644 --- a/tests/smoke/Tests_SmokeCommonModules/Tests_SmokeCommonModules/Ext/ObjectModule.bsl +++ b/tests/smoke/Tests_SmokeCommonModules/Tests_SmokeCommonModules/Ext/ObjectModule.bsl @@ -32,10 +32,16 @@ Procedure ЗаполнитьНаборТестов(TestsSet, CoreContextParam) E CoreContext = CoreContextParam; LoadSettings(); - LoadSubsystemTests(TestsSet, Settings.Subsystems); - LoadSmokeCommonModuleTests(TestsSet, Settings.Subsystems, - Settings.ExcludedCommonModules); - + LoadSubsystemTests(TestsSet, Settings.Subsystems); + + FavouritesCommonModules = LoadFavouritesCommonModules(Settings.FavouritesCommonModules); + + LoadSmokeCommonModuleTests( + TestsSet, + Settings.Subsystems, + Settings.ExcludedCommonModules, + FavouritesCommonModules); + EndProcedure // ЗаполнитьНаборТестов() #EndRegion // ServiceInterface @@ -680,13 +686,35 @@ Procedure LoadSettings() EndIf; If Not Settings.Property("ExcludedCommonModules") Then - Settings.Insert("ExcludedCommonModules", New Array); + Settings.Insert("ExcludedCommonModules", New Array); + EndIf; + + If Not Settings.Property("FavouritesCommonModules") Then + Settings.Insert("FavouritesCommonModules", New Array); EndIf; Settings = New FixedStructure(Settings); EndProcedure // LoadSettings() +Function LoadFavouritesCommonModules(FavouritesCommonModules) + + Result = New Map; + + If FavouritesCommonModules.Count() > 0 Then + + For Each CommonModule In Metadata.CommonModules Do + If CoreContext.ЕстьВИсключаемойКоллекции(CommonModule.Name, FavouritesCommonModules) Then + Result.Insert(CommonModule.Name, True); + EndIf; + EndDo; + + EndIf; + + Return Result; + +EndFunction + // Only for internal use. // Procedure AddSmokeCommonModuleTest(TestsSet, CommonModule) @@ -779,14 +807,20 @@ EndProcedure // LoadSubsystemTests() // Only for internal use. // -Procedure LoadSmokeCommonModuleTests(TestsSet, Subsystems, - ExcludedCommonModules) +Procedure LoadSmokeCommonModuleTests(TestsSet, Subsystems, + ExcludedCommonModules, FavouritesCommonModules) If Subsystems.Find("*") <> Undefined Then + ExistFavouritesCommonModules = (FavouritesCommonModules.Count() > 0); + GroupCommonModulesNotExists = True; For Each CommonModule In Metadata.CommonModules Do + If ExistFavouritesCommonModules And FavouritesCommonModules.Get(CommonModule.Name) = Undefined Then + Continue; + EndIf; + If ExcludedCommonModules.Find(CommonModule.Name) <> Undefined Then Continue; EndIf; @@ -846,17 +880,19 @@ Procedure LoadSmokeCommonModuleTests(TestsSet, Subsystems, GroupCommonModulesNotExists = True; If OnlySubordinate Then - RecursivelyLoadSmokeCommonModuleTestsFromSubsystem(TestsSet, - ParentSubsystem, - SubsystemName, - ExcludedCommonModules, - GroupCommonModulesNotExists); + RecursivelyLoadSmokeCommonModuleTestsFromSubsystem(TestsSet, + ParentSubsystem, + SubsystemName, + ExcludedCommonModules, + FavouritesCommonModules, + GroupCommonModulesNotExists); Else - LoadSmokeCommonModuleTestsFromSubsystem(TestsSet, + LoadSmokeCommonModuleTestsFromSubsystem(TestsSet, ParentSubsystem, - SubsystemName, - ExcludedCommonModules, - GroupCommonModulesNotExists); + SubsystemName, + ExcludedCommonModules, + FavouritesCommonModules, + GroupCommonModulesNotExists); EndIf; EndDo; @@ -865,15 +901,21 @@ EndProcedure // LoadSmokeCommonModuleTests() // Only for internal use. // -Procedure LoadSmokeCommonModuleTestsFromSubsystem(TestsSet, Subsystem, - SubsystemName, ExcludedCommonModules, GroupCommonModulesNotExists) +Procedure LoadSmokeCommonModuleTestsFromSubsystem(TestsSet, Subsystem, + SubsystemName, ExcludedCommonModules, FavouritesCommonModules, GroupCommonModulesNotExists) + ExistFavouritesCommonModules = (FavouritesCommonModules.Count() > 0); + CommonModules = Metadata.CommonModules; For Each Item In Subsystem.Content Do FullName = Item.FullName(); If Find(FullName, "CommonModule") <> 0 - Or Find(FullName, "ОбщийМодуль") <> 0 Then + Or Find(FullName, "ОбщийМодуль") <> 0 Then + + If ExistFavouritesCommonModules And FavouritesCommonModules.Get(Item.Name) = Undefined Then + Continue; + EndIf; If ExcludedCommonModules.Find(Item.Name) <> Undefined Then Continue; @@ -901,22 +943,24 @@ EndProcedure // LoadSmokeCommonModuleTestsFromSubsystem() // Only for internal use. // -Procedure RecursivelyLoadSmokeCommonModuleTestsFromSubsystem(TestsSet, - ParentSubsystem, SubsystemName, ExcludedCommonModules, GroupCommonModulesNotExists) +Procedure RecursivelyLoadSmokeCommonModuleTestsFromSubsystem(TestsSet, + ParentSubsystem, SubsystemName, ExcludedCommonModules, FavouritesCommonModules, GroupCommonModulesNotExists) For Each Subsystem In ParentSubsystem.Subsystems Do - LoadSmokeCommonModuleTestsFromSubsystem(TestsSet, + LoadSmokeCommonModuleTestsFromSubsystem(TestsSet, Subsystem, - SubsystemName, - ExcludedCommonModules, + SubsystemName, + ExcludedCommonModules, + FavouritesCommonModules, GroupCommonModulesNotExists); - RecursivelyLoadSmokeCommonModuleTestsFromSubsystem(TestsSet, + RecursivelyLoadSmokeCommonModuleTestsFromSubsystem(TestsSet, Subsystem, - SubsystemName, - ExcludedCommonModules, - GroupCommonModulesNotExists); + SubsystemName, + ExcludedCommonModules, + FavouritesCommonModules, + GroupCommonModulesNotExists); EndDo; diff --git a/tests/smoke/Tests_SmokeCommonModules/Tests_SmokeCommonModules/Forms/Form/Ext/Form/Module.bsl b/tests/smoke/Tests_SmokeCommonModules/Tests_SmokeCommonModules/Forms/Form/Ext/Form/Module.bsl index 546ba387f..1bb31ec8a 100644 --- a/tests/smoke/Tests_SmokeCommonModules/Tests_SmokeCommonModules/Forms/Form/Ext/Form/Module.bsl +++ b/tests/smoke/Tests_SmokeCommonModules/Tests_SmokeCommonModules/Forms/Form/Ext/Form/Module.bsl @@ -28,22 +28,30 @@ EndProcedure // Инициализация() // CoreContextParam - ExternalDataProcessorObject.xddTestRunner - test runner data processor. // Procedure ЗаполнитьНаборТестов(TestsSet, CoreContextParam) Export - - If CurrentRunMode() = ClientRunMode.OrdinaryApplication Then - Return; - EndIf; - + + If CurrentRunMode() = ClientRunMode.OrdinaryApplication Then + Return; + EndIf; + CoreContext = CoreContextParam; LoadSettings(); - - Если Не НужноВыполнятьТест() Тогда - Возврат; - КонецЕсли; - - LoadSubsystemTests(TestsSet, Object.Settings.Subsystems); - LoadSmokeCommonModuleTests(TestsSet, Object.Settings.Subsystems, Object.Settings.ExcludedCommonModules); - + + Если Не НужноВыполнятьТест() Тогда + Возврат; + КонецЕсли; + + Settings = Object.Settings; + + FavouritesCommonModules = LoadFavouritesCommonModules(Settings.FavouritesCommonModules); + + LoadSubsystemTests(TestsSet, Settings.Subsystems); + LoadSmokeCommonModuleTests( + TestsSet, + Settings.Subsystems, + Settings.ExcludedCommonModules, + FavouritesCommonModules); + EndProcedure // ЗаполнитьНаборТестов() #EndRegion // ServiceInterface @@ -530,6 +538,25 @@ Procedure LoadSettings() EndProcedure // LoadSettings() +&AtClient +Function LoadFavouritesCommonModules(FavouritesCommonModules) + + Result = New Map; + + If FavouritesCommonModules.Count() > 0 Then + + For Each CommonModule In CommonModules() Do + If CoreContext.ЕстьВИсключаемойКоллекции(CommonModule.Name, FavouritesCommonModules) Then + Result.Insert(CommonModule.Name, True); + EndIf; + EndDo; + + EndIf; + + Return Result; + +EndFunction + &НаКлиенте Функция НужноВыполнятьТест() @@ -651,14 +678,20 @@ EndProcedure // LoadSubsystemTests() &AtClient // Only for internal use. // -Procedure LoadSmokeCommonModuleTests(TestsSet, Subsystems, - ExcludedCommonModules) +Procedure LoadSmokeCommonModuleTests(TestsSet, Subsystems, + ExcludedCommonModules, FavouritesCommonModules) If Subsystems.Find("*") <> Undefined Then + ExistFavouritesCommonModules = (FavouritesCommonModules.Count() > 0); + GroupCommonModulesNotExists = True; For Each CommonModule In CommonModules() Do + If ExistFavouritesCommonModules And FavouritesCommonModules.Get(CommonModule.Name) = Undefined Then + Continue; + EndIf; + If ExcludedCommonModules.Find(CommonModule.Name) <> Undefined Then Continue; EndIf; @@ -718,17 +751,19 @@ Procedure LoadSmokeCommonModuleTests(TestsSet, Subsystems, GroupCommonModulesNotExists = True; If OnlySubordinate Then - RecursivelyLoadSmokeCommonModuleTestsFromSubsystem(TestsSet, - ParentSubsystem, - SubsystemName, - ExcludedCommonModules, - GroupCommonModulesNotExists); + RecursivelyLoadSmokeCommonModuleTestsFromSubsystem(TestsSet, + ParentSubsystem, + SubsystemName, + ExcludedCommonModules, + FavouritesCommonModules, + GroupCommonModulesNotExists); Else - LoadSmokeCommonModuleTestsFromSubsystem(TestsSet, + LoadSmokeCommonModuleTestsFromSubsystem(TestsSet, ParentSubsystem, - SubsystemName, - ExcludedCommonModules, - GroupCommonModulesNotExists); + SubsystemName, + ExcludedCommonModules, + FavouritesCommonModules, + GroupCommonModulesNotExists); EndIf; EndDo; @@ -738,15 +773,21 @@ EndProcedure // LoadSmokeCommonModuleTests() &AtClient // Only for internal use. // -Procedure LoadSmokeCommonModuleTestsFromSubsystem(TestsSet, Subsystem, - SubsystemName, ExcludedCommonModules, GroupCommonModulesNotExists) +Procedure LoadSmokeCommonModuleTestsFromSubsystem(TestsSet, Subsystem, + SubsystemName, ExcludedCommonModules, GroupCommonModulesNotExists, FavouritesCommonModules) + ExistFavouritesCommonModules = (FavouritesCommonModules.Count() > 0); + CommonModules = CommonModules(); For Each Item In SubsystemContent(SubsystemName) Do FullName = Item.FullName; If Find(FullName, "CommonModule") <> 0 - Or Find(FullName, "ОбщийМодуль") <> 0 Then + Or Find(FullName, "ОбщийМодуль") <> 0 Then + + If ExistFavouritesCommonModules And FavouritesCommonModules.Get(Item.Name) = Undefined Then + Continue; + EndIf; If ExcludedCommonModules.Find(Item.Name) <> Undefined Then Continue; @@ -775,22 +816,24 @@ EndProcedure // LoadSmokeCommonModuleTestsFromSubsystem() &AtClient // Only for internal use. // -Procedure RecursivelyLoadSmokeCommonModuleTestsFromSubsystem(TestsSet, - ParentSubsystem, SubsystemName, ExcludedCommonModules, GroupCommonModulesNotExists) +Procedure RecursivelyLoadSmokeCommonModuleTestsFromSubsystem(TestsSet, + ParentSubsystem, SubsystemName, ExcludedCommonModules, FavouritesCommonModules, GroupCommonModulesNotExists) For Each Subsystem In ParentSubsystem.Subsystems Do - LoadSmokeCommonModuleTestsFromSubsystem(TestsSet, + LoadSmokeCommonModuleTestsFromSubsystem(TestsSet, Subsystem, - SubsystemName, - ExcludedCommonModules, + SubsystemName, + ExcludedCommonModules, + FavouritesCommonModules, GroupCommonModulesNotExists); - RecursivelyLoadSmokeCommonModuleTestsFromSubsystem(TestsSet, + RecursivelyLoadSmokeCommonModuleTestsFromSubsystem(TestsSet, Subsystem, - SubsystemName, - ExcludedCommonModules, - GroupCommonModulesNotExists); + SubsystemName, + ExcludedCommonModules, + FavouritesCommonModules, + GroupCommonModulesNotExists); EndDo;