public void WhenIConfirmAllParent_BatchesIdForStartProductionAcceptance()
        {
            BDMainPage mainPage = new BDMainPage();

            mainPage.OpenProductionAcceptance();
            BDProductionAcceptancePage bDProductionAcceptancePage = new BDProductionAcceptancePage();
            MSDatabaseConnector        _msBDConnector             = new MSDatabaseConnector(Config.MSDbBatchDropperStab);
            string command        = $@"Select count ([Id]) FROM [BatchDropperStab].[dbo].[Batches] Where Status = 10";
            var    countOfBatches = _msBDConnector.QueryExecutorScalar(command);
            int    intCount;

            intCount = System.Convert.ToInt32(countOfBatches);

            if (intCount != 0)
            {
                string command1 = $@"SELECT [Id] FROM[BatchDropperStab].[dbo].[Batches] Where Status = 10 Order by ChangedOn desc";
                var    listOfID = _msBDConnector.QueryExecutor(command1);
                foreach (string i in listOfID)
                {
                    Debug.WriteLine(i);
                    bDProductionAcceptancePage.SetParentBatch(i);
                }
            }
            IsTrue(bDProductionAcceptancePage.AssertCountOfElementsInfo(countOfBatches), "Количество элементов не соответствует ожидаемому");
        }
Пример #2
0
        public void WhenIAddDNK_SampleOfTestToField(int count, string name, string workplace)
        {
            MSDatabaseConnector _msBDConnectorLW = new MSDatabaseConnector(Config.MSDbLW);
            string command = $@"select TOP({count}) s.TEXT_ID from test t with (nolock)
            inner join SAMPLE s on t.SAMPLE_NUMBER=s.SAMPLE_NUMBER
            where t.status='I' and t.ANALYSIS='{name}' and s.TEMPLATE = 'smp_in' and s.status='I' and s.LOCATION = 'HELIX-SPB' ";
            var    result  = _msBDConnectorLW.QueryExecutor(command);

            if (workplace.Equals("IsolationDNK")) // переход в выделение в ДНК и добавление образца
            {
                BDMainPage bDMainPage = new BDMainPage();
                bDMainPage.OpenDNKWorkplace();
                BDIsolationDNKPage bDIsolationDNKPage = new BDIsolationDNKPage();
                bDIsolationDNKPage.AssertTheButtonIsVisible();
                bDIsolationDNKPage.ClickCreateBatch();
                bDIsolationDNKPage.AssertBatchIsCreated();
                bDIsolationDNKPage.SetParentBatchID();
                BDPlanshetPositionPage bDPlanshetPositionPage = new BDPlanshetPositionPage();
                Thread.Sleep(500);
                // bDPlanshetPositionPage.NewWindowConfirmUsercode();
                bDIsolationDNKPage.AddSample(result);
            }
            else if (workplace.Equals("ProductionAcceptance")) // переход в Прием в постановке и добавление образца
            {
                BDMainPage bDMainPage = new BDMainPage();
                bDMainPage.OpenProductionAcceptance();
                BDProductionAcceptancePage bDProductionAcceptancePage = new BDProductionAcceptancePage();
                bDProductionAcceptancePage.AddSample(result);
            }
        }
        public void WhenIConfirmParent_BatchIdForStartProductionAcceptance()
        {
            BDMainPage mainPage = new BDMainPage();

            mainPage.OpenProductionAcceptance();
            BDProductionAcceptancePage bDProductionAcceptancePage = new BDProductionAcceptancePage();
            MSDatabaseConnector        _msBDConnector             = new MSDatabaseConnector(Config.MSDbBatchDropperStab);
            string command = $@"SELECT [Id] FROM[BatchDropperStab].[dbo].[Batches] Order by ChangedOn desc";
            var    Parent  = _msBDConnector.QueryExecutorScalar(command);

            bDProductionAcceptancePage.SetParentBatch(Parent);
            System.Threading.Thread.Sleep(500);
            IsTrue(bDProductionAcceptancePage.AssertCountOfChildBatches(), "Количество элементов не соответствует ожидаемому");
        }