Esempio n. 1
0
        public void WhenIConfirmParent_BatchIdForStartIsalatiion()
        {
            {
                BDMainPage bDMainPage = new BDMainPage();
                bDMainPage.OpenDNKWorkplace();
                IsTrue(bDMainPage.AssertOpenDNKWorkplace(), "Заголовок рабочего места не найден");

                BDIsolationDNKPage bDIsolationDNKPage = new BDIsolationDNKPage();
                bDIsolationDNKPage.AssertTheButtonIsVisible();
                bDIsolationDNKPage.ClickCreateBatch();
                bDIsolationDNKPage.AssertBatchIsCreated();
                bDIsolationDNKPage.SetParentBatchID();
                BDPlanshetPositionPage bDPlanshetPositionPage = new BDPlanshetPositionPage();
                Thread.Sleep(500);
                // подтверждаем своим ШК
                IsTrue(bDPlanshetPositionPage.AssertConfirmBatchWindow(), "Нет окна для подтверждения установки планшета");
                bDPlanshetPositionPage.ConfirmUsercodeInPlanshetPositionPage();
                // bDPlanshetPositionPage.NewWindowConfirmUsercode();
            }
        }
Esempio n. 2
0
        public void ThenITryToAddASampleOfTestAndLocationAndBiomaterialResultsInSortingWorkplace(string test, string location, string bm, string type, string wp)
        {
            BDMainPage BDMain = new BDMainPage();

            if (wp == "sorting")
            {
                BDMain.OpenSorting();
                IsTrue(BDMain.AssertOpenSorting(), "Заголовок рабочего места не найден");
                // создаем новый бэтч
                BDSortingPage sortingPage = new BDSortingPage();
                sortingPage.AssertTheButtonIsVisible();
                sortingPage.ClickCreateBatch();
                sortingPage.AssertTheConfirmBatchFieldIsVisible();
                sortingPage.SetParentBatchID();
                // подтверждаем своим ШК
                BDPlanshetPositionPage bDPlanshetPositionPage = new BDPlanshetPositionPage();
                IsTrue(bDPlanshetPositionPage.AssertConfirmBatchWindow(), "Нет окна для подтверждения установки планшета");
                bDPlanshetPositionPage.ConfirmUsercodeInPlanshetPositionPage();
                MSDatabaseConnector _msBDConnectorLW = new MSDatabaseConnector(Config.MSDbLW);
                string command = "";
                if (type == "with")
                {
                    command = $@"select top 1 s.TEXT_ID
                    from test t with (nolock)
                    inner join SAMPLE s on t.SAMPLE_NUMBER=s.SAMPLE_NUMBER
                    left join RESULT r on s.SAMPLE_NUMBER = r.SAMPLE_NUMBER
                    where t.status='A' and s.TEMPLATE = 'smp_in' and r.RESULT_NUMBER is not NULL and r.ENTRY is not NULL 
                    and s.LOCATION = '{location}' and t.ANALYSIS = '{test}' and s.SAMPLE_TYPE ='{bm}'";
                }
                else if (type == "without")
                {
                    command = $@"select top 1 s.TEXT_ID from test t 
                    inner join SAMPLE s on t.SAMPLE_NUMBER=s.SAMPLE_NUMBER
                    inner join [RESULT] r on s.SAMPLE_NUMBER = r.SAMPLE_NUMBER
                    where t.status='I' and s.TEMPLATE = 'smp_in' and s.status='I'
                    and s.LOCATION = '{location}'and t.ANALYSIS = '{test}'and s.SAMPLE_TYPE ='{bm}'";
                }
                var result = _msBDConnectorLW.QueryExecutor(command);
                sortingPage.CodeInputField.WaitForClickability();

                foreach (string i in result)
                {
                    sortingPage.CodeInputField.SendKeys(i);
                    sortingPage.CodeInputField.SendKeys(Keys.Enter);
                    Thread.Sleep(1500);
                }
            }
            else if (wp == "isolation")
            {
                BDMain.OpenDNKWorkplace();
                IsTrue(BDMain.AssertOpenDNKWorkplace(), "Заголовок рабочего места не найден");
                BDIsolationDNKPage bDIsolationDNKPage = new BDIsolationDNKPage();
                bDIsolationDNKPage.AssertTheButtonIsVisible();
                bDIsolationDNKPage.ClickCreateBatch();
                bDIsolationDNKPage.AssertBatchIsCreated();
                bDIsolationDNKPage.SetParentBatchID();
                BDPlanshetPositionPage bDPlanshetPositionPage = new BDPlanshetPositionPage();
                Thread.Sleep(500);
                // подтверждаем своим ШК
                IsTrue(bDPlanshetPositionPage.AssertConfirmBatchWindow(), "Нет окна для подтверждения установки планшета");
                bDPlanshetPositionPage.ConfirmUsercodeInPlanshetPositionPage();
                // bDPlanshetPositionPage.NewWindowConfirmUsercode();

                MSDatabaseConnector _msBDConnectorLW = new MSDatabaseConnector(Config.MSDbLW);
                string command = "";
                if (type == "with")
                {
                    command = $@"select top 1 s.TEXT_ID
                    from test t with (nolock)
                    inner join SAMPLE s on t.SAMPLE_NUMBER=s.SAMPLE_NUMBER
                    left join RESULT r on s.SAMPLE_NUMBER = r.SAMPLE_NUMBER
                    where t.status='A' and s.TEMPLATE = 'smp_in' and r.RESULT_NUMBER is not NULL and r.ENTRY is not NULL 
                    and s.LOCATION = '{location}' and t.ANALYSIS = '{test}' and s.SAMPLE_TYPE ='{bm}'";
                }
                else if (type == "without")
                {
                    command = $@"select top 1 s.TEXT_ID from test t 
                    inner join SAMPLE s on t.SAMPLE_NUMBER=s.SAMPLE_NUMBER
                    inner join [RESULT] r on s.SAMPLE_NUMBER = r.SAMPLE_NUMBER
                    where t.status='I' and s.TEMPLATE = 'smp_in' and s.status='I'
                    and s.LOCATION = '{location}'and t.ANALYSIS = '{test}'and s.SAMPLE_TYPE ='{bm}'";
                }
                var result = _msBDConnectorLW.QueryExecutor(command);
                bDIsolationDNKPage.AddSample(result);
            }
        }
Esempio n. 3
0
        public void WhenBeingInWorkplaceIAddSampleOfTestAndLocationAndBiomaterialResults(string wp, int count, string test, string location, string bm, string type)
        {
            // ОПИСЫВАЕТ ДОБАВЛЕНИЕ В ОТКРЫТОЕ РМ СОРТИРОВКА/ВЫДЕЛЕНИЕ НЕСКОЛЬКИХ ОБРАЗЦОВ, КОТОРЫХ ЕЩЕ НЕ ДОБАВЛЯЛИ.
            // ПРОСТО ДОБАВЛЕНИЕ, ПОПЫТКА. НЕГАТИВНЫЙ КЕЙС.
            BDMainPage BDMain = new BDMainPage();

            if (wp == "sorting")
            {
                IsTrue(BDMain.AssertOpenSorting(), "Заголовок рабочего места не найден");
                MSDatabaseConnector _msBDConnectorLW = new MSDatabaseConnector(Config.MSDbLW);
                string command = "";
                if (type == "with") // выбор образцов с результатами, которые еще НЕ были добавлены в базу BD
                {
                    command = $@"select top 1 s.TEXT_ID
                    from test t with (nolock)
                    inner join SAMPLE s on t.SAMPLE_NUMBER=s.SAMPLE_NUMBER
                    left join RESULT r on s.SAMPLE_NUMBER = r.SAMPLE_NUMBER
                    where t.status='A' and s.TEMPLATE = 'smp_in' and r.RESULT_NUMBER is not NULL and r.ENTRY is not NULL 
                    and s.LOCATION = '{location}' and t.ANALYSIS = '{test}' and s.SAMPLE_TYPE ='{bm}'
                    and s.SAMPLE_NUMBER not in (select [LwSampleNumber] from [BatchDropperStab].[dbo].[Samples] )";
                }
                else if (type == "without") // выбор образцов без результатов, которые еще НЕ были добавлены в базу BD
                {
                    command = $@"select top 1 s.TEXT_ID from test t 
                    inner join SAMPLE s on t.SAMPLE_NUMBER=s.SAMPLE_NUMBER
                    inner join [RESULT] r on s.SAMPLE_NUMBER = r.SAMPLE_NUMBER
                    where t.status='I' and s.TEMPLATE = 'smp_in' and s.status='I'
                    and s.LOCATION = '{location}'and t.ANALYSIS = '{test}'and s.SAMPLE_TYPE ='{bm}'
                    and s.SAMPLE_NUMBER not in (select [LwSampleNumber] from [BatchDropperStab].[dbo].[Samples] )";
                }
                var           result      = _msBDConnectorLW.QueryExecutor(command);
                BDSortingPage sortingPage = new BDSortingPage();
                sortingPage.CodeInputField.WaitForClickability();

                foreach (string i in result)
                {
                    sortingPage.CodeInputField.SendKeys(i);
                    sortingPage.CodeInputField.SendKeys(Keys.Enter);
                }
            }
            else if (wp == "isolation")
            {
                IsTrue(BDMain.AssertOpenDNKWorkplace(), "Заголовок рабочего места не найден");
                MSDatabaseConnector _msBDConnectorLW = new MSDatabaseConnector(Config.MSDbLW);
                string command = "";
                if (type == "with") // выбор образцов с результатами, которые еще НЕ были добавлены в базу BD
                {
                    command = $@"select top 1 s.TEXT_ID
                    from test t with (nolock)
                    inner join SAMPLE s on t.SAMPLE_NUMBER=s.SAMPLE_NUMBER
                    left join RESULT r on s.SAMPLE_NUMBER = r.SAMPLE_NUMBER
                    where t.status='A' and s.TEMPLATE = 'smp_in' and r.RESULT_NUMBER is not NULL and r.ENTRY is not NULL 
                    and s.LOCATION = '{location}' and t.ANALYSIS = '{test}' and s.SAMPLE_TYPE ='{bm}'
                    and s.SAMPLE_NUMBER not in (select [LwSampleNumber] from [BatchDropperStab].[dbo].[Samples] )";
                }
                else if (type == "without") // выбор образцов без результатов, которые еще НЕ были добавлены в базу BD
                {
                    command = $@"select top 1 s.TEXT_ID from test t 
                    inner join SAMPLE s on t.SAMPLE_NUMBER=s.SAMPLE_NUMBER
                    inner join [RESULT] r on s.SAMPLE_NUMBER = r.SAMPLE_NUMBER
                    where t.status='I' and s.TEMPLATE = 'smp_in' and s.status='I'
                    and s.LOCATION = '{location}'and t.ANALYSIS = '{test}'and s.SAMPLE_TYPE ='{bm}'
                    and s.SAMPLE_NUMBER not in (select [LwSampleNumber] from [BatchDropperStab].[dbo].[Samples] )";
                }
                var result = _msBDConnectorLW.QueryExecutor(command);
                BDIsolationDNKPage isolationDNKPage = new BDIsolationDNKPage();
                isolationDNKPage.AddSample(result);
            }
        }