예제 #1
0
        public void SetBrowserAsPerCOnfiguration()
        {
            var chromeOptions = new ChromeOptions();

            downloadDirectory = @"C:\Temp";
            chromeOptions.AddUserProfilePreference("download.default_directory", downloadDirectory);
            chromeOptions.AddUserProfilePreference("download.prompt_for_download", false);
            chromeOptions.AddUserProfilePreference("disable-popup-blocking", "true");
            if (Convert.ToString(TestContext.Properties["Module"]) == "TestData")
            {
                testCase  = new TestCaseHelper();
                execution = new TestExecutions();
            }
            else
            {
                string ModuleName = Convert.ToString(TestContext.Properties["Module"]);
                testCase  = new TestCaseHelper(ModuleName);
                execution = new TestExecutions(ModuleName, chromeOptions);
            }

            /*This code block will get executed while debugging/runing test locally or in case
             *   Connection to TFS fails due any unknown reason*/
            //ConfigHelper.Environment = "INT";
            ConfigHelper.TestingTool = "selenium"; ConfigHelper.TestRunID = -1;
        }
예제 #2
0
        private IList <TestDataKeyNamePair> GetTestData(string testCaseKey)
        {
            string       dataFilePath            = Path.Combine(Configuration.Current.UITest.BasePath, this.TestCaseCollection.Suite.SuiteRef.DataFile);
            TestCaseData data                    = XmlHelper.LoadNodeAsObject <TestCaseData>(dataFilePath, @"/testcases/testcase[@key='" + testCaseKey + "']");
            IList <TestDataKeyNamePair> keyPairs = data.Values;

            TestCaseHelper.AddEnvirontmentParams(keyPairs, this.WebDriver.TestRunner.Environment);
            return(keyPairs);
        }
예제 #3
0
        /// <summary>Tests the functionality of the <see cref="FileRepository{T}.WriteAllRecordsToFile(FileInfo,DataSourceInfo,IEnumerable{T})"/>
        /// method when writing an empty file.</summary>
        /// <param name="sourceInfo">The source info that is used to create the repository.</param>
        /// <param name="templatePath">The path to the file that serves as a template to check the output of the repository.</param>
        protected void WriteEmptyFile(DataSourceInfo sourceInfo, string templatePath)
        {
            Repository <TestDummy> repository = this.CreateRepository <TestDummy>(sourceInfo);

            /* Retrieve all entities. This forces the repository to read the file */
            IEnumerable <TestDummy> results = repository.FindAll();

            repository.DeleteEntities(results);

            repository.SaveChanges();

            TestCaseHelper.CheckTestResult(templatePath, FileSourceInfo.SelectSourceFileInfo(sourceInfo).FullName);
        }
예제 #4
0
 public void GetCombinations_EmptyList()
 {
     Assert.Equal(new[] { Array.Empty <int>() }, TestCaseHelper.GetCombinations(Array.Empty <int>()).ToArray());
 }
예제 #5
0
 public void GetCombinationsOfMultipleLists_TwoTwo()
 {
     Assert.Equal(new[] { new object[] { 1, "1" }, new object[] { 1, "2" }, new object[] { 2, "1" }, new object[] { 2, "2" } }, TestCaseHelper.GetCombinationsOfMultipleLists(new object[] { 1, 2 }, new object[] { "1", "2" }));
 }
예제 #6
0
 public void GetCombinationsOfMultipleLists_OneOne()
 {
     Assert.Equal(new[] { new object[] { 1, "1" } }, TestCaseHelper.GetCombinationsOfMultipleLists(new object[] { 1 }, new object[] { "1" }));
 }
예제 #7
0
 public void GetCombinations_TwoItemList()
 {
     Assert.Equal(new[] { Array.Empty <int>(), new[] { 2 }, new[] { 1 }, new[] { 1, 2 } }, TestCaseHelper.GetCombinations(1, 2));
 }
예제 #8
0
 public void GetCombinations_OneItemList()
 {
     Assert.Equal(new[] { Array.Empty <int>(), new[] { 1 } }, TestCaseHelper.GetCombinations(1));
 }
        public void ExpandArguments_FromTestCaseSource_RessultLengthAsExpected(Object value)
        {
            TestCaseHelper current = (TestCaseHelper)value;

            Assert.That(current.Arguments.ExpandArguments().Length, Is.EqualTo(current.Expected));
        }