private static void AddControl(CanvasDocument app, string filePath, bool isComponent, string fileContents, ErrorContainer errors) { var filename = Path.GetFileName(filePath); try { var parser = new Parser.Parser(filePath, fileContents, errors); var controlIR = parser.ParseControl(); if (controlIR == null) { return; // error condition } // validate that all the packages refferred are not accidentally deleted from pkgs dierectory ValidateIfTemplateExists(app, controlIR, controlIR, errors); // Since the TestSuites are sharded into individual files make sure to add them as children of AppTest control if (AppTestTransform.IsTestSuite(controlIR.Name.Kind.TypeName)) { AddTestSuiteControl(app, controlIR); } else { var collection = (isComponent) ? app._components : app._screens; collection.Add(controlIR.Name.Identifier, controlIR); } } catch (DocumentException) { // On DocumentException, continue looking for errors in other files. } }
public void Visit(BlockNode node) { // Ignore test templates here. // Test templates have control-like syntax, but allowed to repeat names: // Step4 As TestStep: if (AppTestTransform.IsTestSuite(node.Name.Kind.TypeName)) { return; } this.Visit(node.Name); foreach(var child in node.Children ) { this.Visit(child); } }