Inheritance: MonoBehaviour
Exemplo n.º 1
0
        public void GivenIEnterTheEmailPasswordAndVerifyThatThePageLoadsWithMessage(string emailAddress, string passwordAddress, string typeMessage, string message)
        {
            try
            {
                UITests _uITests = new UITests(Settings);
                _uITests.WaitForLoad();

                if (!emailAddress.IsNullOrEmpty())
                {
                    _uITests.EmailAddess = emailAddress;
                }

                if (!passwordAddress.IsNullOrEmpty())
                {
                    _uITests.PasswordAddess = passwordAddress;
                }

                _uITests.SubmitLoginClick();

                if (typeMessage.ToLowerInvariant().Equals("error"))
                {
                    Check.That(_uITests.AlertMessage.Contains(message));
                }
            }
            catch (Exception ex)
            {
                Logger.LogError($"Exception caught in '{Settings.Scenario.StepContext.StepInfo.Text}', {ex.Message}");
                throw ex;
            }
            finally
            {
                Logger.EndStepLog(Settings.Scenario.StepContext.StepInfo.Text);
            }
        }
Exemplo n.º 2
0
        public void GivenIVerifyThatPersonalInformationPageIsOpenAndEnterTheRequestInformationsTitleFirstNameLastNamePasswordAddressCityZipPostalSatetCountryAndPhoneNumber(string title, string firstName, string lastName, string password, string address, string city, string zipPostal, string state, string country, string phone)
        {
            try
            {
                UITests _uITests = new UITests(Settings);
                _uITests.WaitForLoad();

                _uITests.TitleClick();
                _uITests.FirstName = firstName;
                _uITests.LastName  = lastName;
                _uITests.Password  = password;
                _uITests.Address   = address;
                _uITests.City      = city;
                _uITests.SetState(state);
                _uITests.ZipRegion = zipPostal;
                _uITests.SetCountry(country);
                _uITests.MobilePhone = phone;
                _uITests.SubmitAccountClick();
            }
            catch (Exception ex)
            {
                Logger.LogError($"Exception caught in '{Settings.Scenario.StepContext.StepInfo.Text}', {ex.Message}");
                throw ex;
            }
            finally
            {
                Logger.EndStepLog(Settings.Scenario.StepContext.StepInfo.Text);
            }
        }
        public void AlterColumnType_NoArchive(DatabaseType dbType)
        {
            var db  = GetCleanedServer(dbType);
            var tbl = db.CreateTable("MyTbl", new[] { new DatabaseColumnRequest("mycol", new DatabaseTypeRequest(typeof(string), 10)) });

            Import(tbl, out var ti, out _);

            var ui        = new UITests();
            var activator = new TestActivateItems(ui, new MemoryDataExportRepository());

            var myCol = tbl.DiscoverColumn("myCol");

            //should have started out as 10
            Assert.AreEqual(10, myCol.DataType.GetLengthIfString());

            //we want the new type to be 50 long
            var newType = myCol.DataType.SQLType.Replace("10", "50");

            activator.TypeTextResponse = newType;

            var cmd = new ExecuteCommandAlterColumnType(activator, ti.ColumnInfos.Single());

            cmd.Execute();

            //rediscover the col to get the expected new datatype
            myCol = tbl.DiscoverColumn("myCol");

            Assert.AreEqual(newType, myCol.DataType.SQLType);
            Assert.AreEqual(newType, ti.ColumnInfos[0].Data_type);

            tbl.Drop();
        }
Exemplo n.º 4
0
        public void AllCommandsCompatible()
        {
            Console.WriteLine("Looking in" + typeof(ExecuteCommandCreateNewExtractableDataSetPackage).Assembly);
            Console.WriteLine("Looking in" + typeof(ExecuteCommandViewCohortAggregateGraph).Assembly);
            Console.WriteLine("Looking in" + typeof(ExecuteCommandUnpin).Assembly);

            var uiTests   = new UITests();
            var activator = new TestActivateItems(uiTests, new MemoryDataExportRepository());

            activator.RepositoryLocator.CatalogueRepository.MEF = CatalogueRepository.MEF;

            allowedToBeIncompatible.AddRange(activator.GetIgnoredCommands());

            var commandCaller = new CommandInvoker(activator);

            Assert.IsTrue(commandCaller.IsSupported(typeof(ExecuteCommandDelete)));

            var notSupported = RepositoryLocator.CatalogueRepository.MEF.GetAllTypes()
                               .Where(t => typeof(IAtomicCommand).IsAssignableFrom(t) && !t.IsAbstract && !t.IsInterface) //must be something we would normally expect to be a supported Type
                               .Where(t => !commandCaller.IsSupported(t))                                                 //but for some reason isn't
                               .Except(allowedToBeIncompatible)                                                           //and isn't a permissable one
                               .ToArray();

            Assert.AreEqual(0, notSupported.Length, "The following commands were not compatible with RunUI:" + Environment.NewLine + string.Join(Environment.NewLine, notSupported.Select(t => t.Name)));

            var supported = RepositoryLocator.CatalogueRepository.MEF.GetAllTypes().Where(commandCaller.IsSupported).ToArray();

            Console.WriteLine("The following commands are supported:" + Environment.NewLine + string.Join(Environment.NewLine, supported.Select(cmd => cmd.Name)));
        }
Exemplo n.º 5
0
    public static void SaveData(UITests myBehaviour)
    {
        BinaryFormatter formatter = new BinaryFormatter();

        FileStream stream = new FileStream(path, FileMode.Create);

        DataManagerTest saveData = new DataManagerTest(myBehaviour);

        formatter.Serialize(stream, saveData);
        stream.Close();
    }
Exemplo n.º 6
0
    public DataManagerTest(UITests data)
    {
        colorData    = new float[3];
        colorData[0] = data.img.color.r;
        colorData[1] = data.img.color.b;
        colorData[2] = data.img.color.g;

        positionData    = new float[2];
        positionData[0] = data.img.gameObject.GetComponent <RectTransform>().anchoredPosition.x;
        positionData[1] = data.img.gameObject.GetComponent <RectTransform>().anchoredPosition.y;

        zRotationData = data.img.GetComponent <RectTransform>().rotation.eulerAngles.z;
    }
Exemplo n.º 7
0
        public void ThenIVerifyTheErroMessagem(string errorMessage)
        {
            try
            {
                UITests _uITests = new UITests(Settings);
                _uITests.WaitForLoad();

                Check.That(_uITests.CreateAccountError.Contains(errorMessage));
            }
            catch (Exception ex)
            {
                Logger.LogError($"Exception caught in '{Settings.Scenario.StepContext.StepInfo.Text}', {ex.Message}");
                throw ex;
            }
            finally
            {
                Logger.EndStepLog(Settings.Scenario.StepContext.StepInfo.Text);
            }
        }
Exemplo n.º 8
0
        public void WhenIGoToCartItemAndClickToRemoveTheProductFromMyCart()
        {
            try
            {
                UITests _uITests = new UITests(Settings);
                _uITests.WaitForLoad();

                _uITests.RemoveCartitemClick();
            }
            catch (Exception ex)
            {
                Logger.LogError($"Exception caught in '{Settings.Scenario.StepContext.StepInfo.Text}', {ex.Message}");
                throw ex;
            }
            finally
            {
                Logger.EndStepLog(Settings.Scenario.StepContext.StepInfo.Text);
            }
        }
Exemplo n.º 9
0
        public void WhenISelectAT_ShitInStockAndAddToCart()
        {
            try
            {
                UITests _uITests = new UITests(Settings);
                _uITests.WaitForLoad();

                _uITests.AddCartClick();
            }
            catch (Exception ex)
            {
                Logger.LogError($"Exception caught in '{Settings.Scenario.StepContext.StepInfo.Text}', {ex.Message}");
                throw ex;
            }
            finally
            {
                Logger.EndStepLog(Settings.Scenario.StepContext.StepInfo.Text);
            }
        }
Exemplo n.º 10
0
        public void GivenIGoToClickOnSignInButtonEnterEmailAddressAndClickCreateAnAccountButton(string email)
        {
            try
            {
                UITests _uITests = new UITests(Settings);
                _uITests.WaitForLoad();

                _uITests.SiginClick();
                _uITests.EnterEmail = email;
                _uITests.CreateAccountButtonClick();
            }
            catch (Exception ex)
            {
                Logger.LogError($"Exception caught in '{Settings.Scenario.StepContext.StepInfo.Text}', {ex.Message}");
                throw ex;
            }
            finally
            {
                Logger.EndStepLog(Settings.Scenario.StepContext.StepInfo.Text);
            }
        }
Exemplo n.º 11
0
        public void WhenIClickOnWomenButtonAndSearchItem(string searchTerm)
        {
            try
            {
                UITests _uITests = new UITests(Settings);
                _uITests.WaitForLoad();

                _uITests.WomenMenuClick();
                _uITests.SearchTerm = searchTerm;
                _uITests.SearchButtonClick();
            }
            catch (Exception ex)
            {
                Logger.LogError($"Exception caught in '{Settings.Scenario.StepContext.StepInfo.Text}', {ex.Message}");
                throw ex;
            }
            finally
            {
                Logger.EndStepLog(Settings.Scenario.StepContext.StepInfo.Text);
            }
        }
Exemplo n.º 12
0
        public void AlterColumnType_WithArchive(DatabaseType dbType, bool changeArchive)
        {
            var db         = GetCleanedServer(dbType);
            var tbl        = db.CreateTable("MyTbl", new[] { new DatabaseColumnRequest("mycol", new DatabaseTypeRequest(typeof(string), 10)) });
            var tblArchive = db.CreateTable("MyTbl_Archive", new[] { new DatabaseColumnRequest("mycol", new DatabaseTypeRequest(typeof(string), 10)) });

            Import(tbl, out TableInfo ti, out _);

            var ui        = new UITests();
            var activator = new TestActivateItems(ui, new MemoryDataExportRepository());

            var myCol = tbl.DiscoverColumn("myCol");

            //should have started out as 10
            Assert.AreEqual(10, myCol.DataType.GetLengthIfString());

            string oldType = myCol.DataType.SQLType;
            //we want the new type to be 50 long
            var newType = oldType.Replace("10", "50");

            activator.TypeTextResponse = newType;
            activator.YesNoResponse    = changeArchive;

            var cmd = new ExecuteCommandAlterColumnType(activator, ti.ColumnInfos.Single());

            cmd.Execute();

            //rediscover the col to get the expected new datatype
            myCol = tbl.DiscoverColumn("myCol");
            var myColArchive = tblArchive.DiscoverColumn("myCol");

            Assert.AreEqual(newType, myCol.DataType.SQLType);
            Assert.AreEqual(newType, ti.ColumnInfos[0].Data_type);

            //if they changed the archive then the archive column should also match on Type otherwise it should have stayed the old Type
            Assert.AreEqual(changeArchive ? newType : oldType, myColArchive.DataType.SQLType);

            tbl.Drop();
            tblArchive.Drop();
        }