Example #1
0
        private void CheckAllFocusIN(List <OpenSpan> listHotKey)
        {
            int countHotKey = 0;

            foreach (var itemHotKey in listHotKey)
            {
                if (itemHotKey.Value1 == "F1" | itemHotKey.Value1 == "F6")
                {
                    Assert.IsTrue(itemHotKey.TimeStamp.Contains(AT.GetDate()));
                    countHotKey = countHotKey + 1;
                }
                if (itemHotKey.Value1 == "Alt")
                {
                    if (itemHotKey.Value2 == "S" | itemHotKey.Value2 == "F4")
                    {
                        Assert.IsTrue(itemHotKey.TimeStamp.Contains(AT.GetDate()));
                        countHotKey = countHotKey + 1;
                    }
                }

                if (itemHotKey.Value1 == "Control")
                {
                    if (itemHotKey.Value2 == "A" | itemHotKey.Value2 == "C" | itemHotKey.Value2 == "F" | itemHotKey.Value2 == "G" | itemHotKey.Value2 == "N" | itemHotKey.Value2 == "O"
                        | itemHotKey.Value2 == "P" | itemHotKey.Value2 == "S" | itemHotKey.Value2 == "V" | itemHotKey.Value2 == "X" | itemHotKey.Value2 == "Z" | itemHotKey.Value2 == "F6"
                        | itemHotKey.Value2 == "Tab" | itemHotKey.Value2 == "H")
                    {
                        Assert.IsTrue(itemHotKey.TimeStamp.Contains(AT.GetDate()));
                        countHotKey = countHotKey + 1;
                    }
                }

                if (itemHotKey.Value1 == "Win")
                {
                    if (itemHotKey.Value2 == "F2")
                    {
                        Assert.IsTrue(itemHotKey.TimeStamp.Contains(AT.GetDate()));
                        countHotKey = countHotKey + 1;
                    }
                }

                if (itemHotKey.Value1 == "Shift")
                {
                    if (itemHotKey.Value2 == "Tab")
                    {
                        Assert.IsTrue(itemHotKey.TimeStamp.Contains(AT.GetDate()));
                        countHotKey = countHotKey + 1;
                    }
                }
            }
            Assert.IsTrue(countHotKey >= 27, "Check hotkeys in packet! :" + countHotKey);
        }
Example #2
0
        /// <summary>
        /// Private methoda
        /// </summary>
        /// <returns></returns>
        private string GetContentOfLog(string nameLog)
        {
            //change
            var listFiles = AT.GetContentOfFolder(Path.Combine(Path.Combine(NunitSettings.DttPath, AT.GetDate()), "LOGS"), "*" + nameLog + ".log");

            foreach (var file in listFiles)
            {
                var text = File.ReadAllText(Path.Combine(Path.Combine(Path.Combine(NunitSettings.DttPath, AT.GetDate()), "LOGS"), file.Name));
                return(text.Replace(" ", "").Replace("\r\n", "").Replace("\n", "").Replace("\r", ""));
            }
            return(null);
        }
Example #3
0
        public void DttUseOfDttVariables()
        {
            Console.WriteLine("Create DTT environment variable.");
            BehaviorsRegression.CleanMachine();
            Environment.SetEnvironmentVariable("DTT", NunitSettings.InstallFileLocation, EnvironmentVariableTarget.Machine);

            Console.WriteLine("Set new Environment variable to dtt in 'dest'");
            using (var systemSettings = new SystemSettings())
            {
                systemSettings.setTransferItemParameter("packets", "dest", @"%DTT%\DataOutput\%FILE.CREATION.DATE%\LOGS\%HASHED_ID_SHA2%.%SESSION_ID%.%FILE.CREATION.DATE%.%FILE.CREATION.TIME%.%FILE%");
                systemSettings.setTransferItemParameter("OS log information", "dest", @"%DTT%\%FILE.CREATION.DATE%\LOGS\%HASHED_ID_SHA2%.%SESSION_ID%.%FILE.MODIFICATION.DATE%.%FILE.MODIFICATION.TIME%.os_runtime.log");
                systemSettings.setTransferItemParameter("log information", "dest", @"%DTT%\DataOutput\%FILE.CREATION.DATE%\LOGS\%HASHED_ID_SHA2%.%SESSION_ID%.%FILE.MODIFICATION.DATE%.%FILE.MODIFICATION.TIME%.%FILE%");
            }

            Console.WriteLine("Install AT");
            AT.Install();

            Console.WriteLine("Create packets and video");
            CreateUserDirectory();
            CreateSamplePackets();
            Service.Stop(NunitSettings.ServiceDttName);

            Console.WriteLine("Check files have been transferred correctly.");
            Assert.IsTrue(File.Exists(Path.Combine(Path.Combine(Path.Combine(NunitSettings.InstallFileLocation + "\\DATAOUTPUT", AT.GetDate()), "PACKETS"),
                                                   NamePacket)), "Couldn't find transfered file:" + NamePacket);
            if (ScreenRecording == "ON")
            {
                Assert.IsTrue(File.Exists(Path.Combine(Path.Combine(Path.Combine(NunitSettings.InstallFileLocation + "\\DATAOUTPUT", AT.GetDate()), "RECORDINGS"),
                                                       NameVideo)), "Couldn't find transfered file:" + NameVideo);
            }

            Console.WriteLine("Clean machine");
            BehaviorsRegression.CleanMachine();
        }