示例#1
0
        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});
        }
示例#2
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;
            }

              }
        }
        public PnlTotalCardListTest(TotalCardListTestConfig model)
        {
            InitializeComponent();

              tbxNumItems.DataBindings.Add("Text", model, "NumItemsOnPage");
        }