Beispiel #1
0
 public PnlLoopTest(DlgConfig parentDlg, LoopConfig model)
     : this()
 {
     _parentDlg = parentDlg;
       _model = model;
       tbxIterrations.Text = model.Iterations.ToString();
       chb.Checked = model.Iterations == -1;
       chbStopOnError.DataBindings.Add("Checked", model, "StopOnError");
       chbNotifyWhenIterationFinished.DataBindings.Add("Checked", model, "NotifyWhenIterationFinished");
 }
Beispiel #2
0
        public Config()
        {
            LoginTemplate = "x";
              PhoneTemplate = "x";
              ClientNum = 1;
              StartFrom = 1;
              ServerIp = "localhost";
              AjaxPort = 80;
              WsPort = 3000;

              StatisticsDumpPeriod = 1;

              Tests = new LoopConfig();
        }
 public PnlTestConfig(DlgConfig dialog, LoopConfig parent, TestConfig test, TreeNode node)
 {
     _parentDialog = dialog;
       _parent = parent;
       _test = test;
       _node = node;
       InitializeComponent();
       tbxName.DataBindings.Add("Text", _test, "Name");
       textBox1.DataBindings.Add("Text", _test, "TimeIntervalTemplate");
       _initList = false;
       CreateEventsList(test);
       _initList = true;
       comboBox1.SelectedItem = ConditionConverter.ToText(_test.StartCondition);
       if(_parent == null)
     Controls.RemoveByKey(button1.Name);
 }
        public void Generate()
        {
            Config = new Config();

              LoopConfig root = Config.Tests;
              root.Iterations = 1;
              root.StopOnError = true;
              root.Name = "Root";

              LoginTestConfig loginTest = new LoginTestConfig();
              loginTest.LoginTemplate = "xxxx";
              root.Tests.Add(loginTest);

              ConfigurationTestConfig configuration = new ConfigurationTestConfig{ Name = "Configuration" };
              root.Tests.Add(configuration);

              TotalCardListTestConfig totalCardListTest = new TotalCardListTestConfig { Name = "TotalCardList" };
              root.Tests.Add(totalCardListTest);

              LoopConfig waitCallLoop = new LoopConfig { Iterations = 1, Name = "WaitCallLoop", StopOnError = false };
              root.Tests.Add(waitCallLoop);

              WaitCallConfig waitCall = new WaitCallConfig { StartCondition = Condition.TimeInterval, TimeInterval = 10000 };
              waitCall.AcceptCalls = true;
              waitCall.CallCommitCondition = Condition.WhenIterationFinished;
              waitCallLoop.Tests.Add(waitCall);

              LoopConfig mainLoop = new LoopConfig { Iterations = -1, Name = "MainLoop", StopOnError = true, NotifyWhenIterationFinished = true };
              root.Tests.Add(mainLoop);

              RelevantCardListTestConfig relevantCardListTest = new RelevantCardListTestConfig { Name = "RelevantCardList", StartCondition = Condition.WhenCallEstablished, NumItemsOnPage = 20 };
              mainLoop.Tests.Add(relevantCardListTest);

              IncidentTypeChoiceTestConfig incidentTypeChoice = new IncidentTypeChoiceTestConfig { Name = "IncidentTypeChoice", StartCondition = Condition.TimeInterval, TimeInterval = 1, NumItemsOnPage = 20};
              mainLoop.Tests.Add(incidentTypeChoice);

              CardTestConfig cardTest = new CardTestConfig { StartCondition = Condition.TimeInterval, TimeInterval = 1 };
              cardTest.Tests.Add(new CardSaveTestConfig { StartCondition = Condition.TimeInterval, TimeInterval = 5000 });
              cardTest.Tests.Add(new CardCloseTestConfig { CallsToCard = 0, StartCondition = Condition.TimeInterval, TimeInterval = 5000 });

              mainLoop.Tests.Add(cardTest);
              mainLoop.Tests.Add(new CardListTestConfig { NumberOfPageChanging = 2, StartCondition = Condition.TimeInterval, TimeInterval = 2000});
        }
Beispiel #5
0
        private void btnAddTest_Click(object sender, EventArgs e)
        {
            DlgAddTest dlg = new DlgAddTest();
              if (dlg.ShowDialog() == DialogResult.OK)
              {
            switch (dlg.Choice)
            {
              case "Login":
            LoginTestConfig login = new LoginTestConfig();
            _model.Tests.Add(login);
            _parentDlg.FillTree();
            break;
              case "Logout":
            LogoutTestConfig logout = new LogoutTestConfig();
            _model.Tests.Add(logout);
            _parentDlg.FillTree();
            break;

              case "Configuration":
            ConfigurationTestConfig configuration = new ConfigurationTestConfig();
            _model.Tests.Add(configuration);
            _parentDlg.FillTree();
            break;

              case "TotalCardList":
            TotalCardListTestConfig totalCardListTest = new TotalCardListTestConfig();
            _model.Tests.Add(totalCardListTest);
            _parentDlg.FillTree();
            break;

              case "RelevantCardList":
            RelevantCardListTestConfig relevantCardListTest = new RelevantCardListTestConfig();
            _model.Tests.Add(relevantCardListTest);
            _parentDlg.FillTree();
            break;

              case "IncidentTypeChoice":
            IncidentTypeChoiceTestConfig incidentTypeChoice = new IncidentTypeChoiceTestConfig();
            _model.Tests.Add(incidentTypeChoice);
            _parentDlg.FillTree();
            break;

              case "Loop":
            LoopConfig loop = new LoopConfig();
            _model.Tests.Add(loop);
            _parentDlg.FillTree();
            break;
              case "OpenCard":
            CardTestConfig card = new CardTestConfig();
            _model.Tests.Add(card);
            _parentDlg.FillTree();
            break;
              case "SaveCard":
            CardSaveTestConfig save = new CardSaveTestConfig();
            _model.Tests.Add(save);
            _parentDlg.FillTree();
            break;
              case "CardList":
            CardListTestConfig list = new CardListTestConfig();
            _model.Tests.Add(list);
            _parentDlg.FillTree();
            break;
              case "WaitCall":
            WaitCallConfig wc = new WaitCallConfig();
            _model.Tests.Add(wc);
            _parentDlg.FillTree();
            break;
            }

              }
        }