Exemplo n.º 1
0
        private void AddScriptFile(string filePath)
        {
            _data.GFriendFiles.Clear();
            _gFriendFiles.Clear();
            TestDataManager testDataManager = null;

            try
            {
                testDataManager = Parser.ParseTestSuite(filePath);
                testDataManager.PostActionAfterParsingUsings();

                if (testDataManager.TargetTestSuite.TcCount == 0)
                {
                    MessageBox.Show("Testcase is not exist in the script. Please check script", "Add GFriend File", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    return;
                }
            }
            catch (Exception)
            {
                // Script check logic will be added if GFriend returns error details.
                MessageBox.Show("There is some problem in the script. Please check script.", "Add GFriend File", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }


            GFriendFile script = new GFriendFile(filePath, GFFileTypes.GFScript);

            AddToDataGridView(script);

            foreach (string usedFile in testDataManager.FilesToUse)
            {
                string      targetFilePath = Path.Combine(Path.GetDirectoryName(filePath), usedFile);
                GFFileTypes fileType;
                if (usedFile.EndsWith("gfvar"))
                {
                    fileType = GFFileTypes.GFVariable;
                }
                else if (usedFile.EndsWith("gflib"))
                {
                    fileType = GFFileTypes.GFLibrary;
                }
                else
                {
                    fileType = GFFileTypes.Unknown;
                }
                AddToDataGridView(new GFriendFile(targetFilePath, fileType));

                _requiredDevices = testDataManager.DeviceLibraryMapping.Keys.Where(s => !s.Equals(TestDataManager.NO_DUT)).ToList();
            }
        }
Exemplo n.º 2
0
 private void AddToDataGridView(GFriendFile file)
 {
     _gFriendFiles.Add(file);
 }
Exemplo n.º 3
0
 public EditScriptForm(GFriendFile file)
 {
     InitializeComponent();
     _targetFile = file;
     Refresh();
 }