Ejemplo n.º 1
0
        public void Tc002()
        {
            // Make sure login is possible
            WrapTrackShell.Login();

            var me = WrapTrackShell.Me();

            StfAssert.IsNotNull("wrapTrackShell", WrapTrackShell);
            StfAssert.IsInstanceOfType("me", me, typeof(IMeProfile));

            // try wrong pw
            WrapTrackShell.Logout();
            WrapTrackShell.Login("mie88", "1234");

            var feedback = WrapTrackShell.InfoText("mes_loginerror");

            StfAssert.IsTrue("User got feedback: 'wrong username/pw'", feedback);

            // try unkown username
            WrapTrackShell.Login("detvillemanadrigkaldesig", "wraptrack4ever");

            var feedback2 = WrapTrackShell.InfoText("mes_loginerror");

            StfAssert.IsTrue("User got feedback: 'wrong username/pw'", feedback2);
        }
Ejemplo n.º 2
0
        public void Tc024()
        {
            // Set up user context for actual test
            // Use default user
            WrapTrackShell.Login();

            var me = WrapTrackShell.Me();

            StfAssert.IsNotNull("WrapTrackShell", this.WrapTrackShell);
            StfAssert.IsInstanceOfType("me", me, typeof(IMeProfile));

            // Actual test

            // Create a new wrap
            var wrapCollection = me.GetCollection();

            StfAssert.IsNotNull("check if me.GetCollection null", wrapCollection);

            var newWrapWtId = wrapCollection.AddWrap();

            // Move to the new wrap
            var wrapToSendOnHoliday = this.WrapTrackShell.GetToWrap(newWrapWtId);
            var recipient           = this.GetAnotherUser();

            // Send warp away on holiday
            wrapToSendOnHoliday.SendAwayTemporarily(SendAwayReason.Holiday, recipient);

            // Validate the the wrap indeed is on holiday
            var wtApi    = this.Get <IWtApi>();
            var wrapInfo = wtApi.WrapInfoByTrackId(newWrapWtId);

            StfLogger.LogInfo("The recipient user name attempted is {0} and userid from wrapInfo API is {1}", recipient, wrapInfo.VisitingUserId);
            StfAssert.IsTrue("Wrap is on holiday", wrapInfo.OnHoliday);
        }
Ejemplo n.º 3
0
        public void Tc026()
        {
            // Set up user context for actual test
            // Use default user
            WrapTrackShell.Login();

            var me = WrapTrackShell.Me();

            StfAssert.IsNotNull("WrapTrackShell", WrapTrackShell);
            StfAssert.IsInstanceOfType("me", me, typeof(IMeProfile));

            // Create a new wrap
            var wrapCollection = me.GetCollection();

            StfAssert.IsNotNull("check if me.GetCollection null", wrapCollection);

            var newWrapWtId = wrapCollection.AddWrap();

            // Move to the new wrap
            var wraptoSendOnVisit = WrapTrackShell.GetToWrap(newWrapWtId);

            StfAssert.IsNotNull("Check if wraptoSendOnVisit is null", wraptoSendOnVisit);

            // Move to the new wrap
            var wrapToSendOnHoliday = WrapTrackShell.GetToWrap(newWrapWtId);
            var recipient           = GetAnotherUser();

            // Send wrap away on holiday
            wrapToSendOnHoliday.SendAwayTemporarily(SendAwayReason.Holiday, recipient);

            var isNewsAboutWrapSentOnHoliday = IsNewsAboutWrapSentOnHoliday(newWrapWtId, WrapTrackShell.CurrentLoggedInUser, recipient);

            StfAssert.IsTrue("Is there news that the wrap is sent on holiday", isNewsAboutWrapSentOnHoliday);
        }
        /// <summary>
        /// The get random brand.
        /// </summary>
        /// <returns>
        /// The <see cref="IBrand"/>.
        /// </returns>
        protected IBrand GetBrand(string brandName)
        {
            var explorer = WrapTrackShell.Explore();

            StfAssert.IsInstanceOfType("explorer", explorer, typeof(IExplore));

            var brands        = explorer.Brands();
            var selectedBrand = brands.SelectAndOpenBrand(brandName);

            return(selectedBrand);
        }
Ejemplo n.º 5
0
        public void Tc001()
        {
            // WrapTrackShell.WebAdapter.Configuration.CheckForErrorsOnAllPagesText = "Error # ParseError";
            WrapTrackShell.WebAdapter.Configuration.CheckForErrorsOnAllPagesText = "do not match # ParseError";
            WrapTrackShell.WebAdapter.Configuration.CheckForErrorsOnAllPages     = true;

            // Use default user
            WrapTrackShell.Login();

            // And the result....
            var me = WrapTrackShell.Me();

            StfAssert.IsNotNull("wrapTrackShell", WrapTrackShell);
            StfAssert.IsInstanceOfType("me", me, typeof(IMeProfile));
        }
Ejemplo n.º 6
0
        public void TestMethodAssertIsInstanceOf()
        {
            Assert.IsFalse(StfAssert.IsInstanceOfType("An integer", 1, Type.GetType("int")));
            Assert.IsTrue(StfAssert.IsInstanceOfType("A string", "1", Type.GetType(typeof(string).FullName)));
            Assert.IsTrue(StfAssert.IsInstanceOfType("An object", new object(), Type.GetType(typeof(object).FullName)));
            Assert.IsFalse(StfAssert.IsInstanceOfType("null", null, null));

            /*
             * TODO: Have no idea why this fails?
             * Assert.IsTrue(StfAssert.IsInstanceOfType("An object", StfAssert, Type.GetType(typeof(StfAssert).FullName)));
             *
             * typeof(StfAssert).FullName returns null?
             *
             */
        }
Ejemplo n.º 7
0
        /// <summary>
        /// Test of creating a new brand.
        /// </summary>
        // Uncommented as AddBrand is unsupported[TestMethod]
        public void Tc014()
        {
            StfAssert.IsNotNull("wrapTrackShell", wrapTrackShell);

            var explorer = wrapTrackShell.Explore();

            StfAssert.IsInstanceOfType("explorer", explorer, typeof(IExplore));

            var brands   = explorer.Brands();
            var addBrand = brands.AddBrand();

            StfAssert.IsNotNull("Add brand", addBrand);

            var newBrandName = WtUtils.GetRandomString("StfBrand");

            addBrand.NewBrandName = newBrandName;
            addBrand.Save();
        }
Ejemplo n.º 8
0
        public void Tc024()
        {
            // Set up user context for actual test
            // Use default user
            WrapTrackShell.Login();

            var me = WrapTrackShell.Me();

            StfAssert.IsNotNull("WrapTrackShell", WrapTrackShell);
            StfAssert.IsInstanceOfType("me", me, typeof(IMeProfile));

            // Create a new wrap
            var wrapCollection = me.GetCollection();

            StfAssert.IsNotNull("check if me.GetCollection null", wrapCollection);

            var newWrapWtId    = wrapCollection.AddWrap();
            var wtApi          = Get <IWtApi>();
            var wrapInfoBefore = wtApi.WrapInfoByTrackId(newWrapWtId);
            var internalId     = wrapInfoBefore.InternalId;

            // Move to the new wrap
            var wraptoSendOnVisit = WrapTrackShell.GetToWrap(internalId);

            // StfAssert.IsNotNull("Check if wraptoSendOnVisit is null", wraptoSendOnVisit);

            // Move to the new wrap
            // var wraptoSendOnVisit = WrapTrackShell.GetToWrap(newWrapWtId);
            var recipient = GetAnotherUser();

            // Send wrap away on holiday
            wraptoSendOnVisit.SendAwayTemporarily(SendAwayReason.Holiday, recipient);

            // Validate the the wrap indeed is on holiday
            var wrapInfoAfter = wtApi.WrapInfoByTrackId(newWrapWtId);
            var userId        = wtApi.UserId(recipient);

            StfLogger.LogInfo("The recipient user name, user id attempted is {0},{1} and userid from wrapInfo API is {1}", recipient, userId, wrapInfoAfter.VisitingUserId);

            StfAssert.IsTrue("Wrap is on holiday", wrapInfoAfter.OnHoliday);
            StfAssert.AreEqual("recipient userid is same as VisitingUserId in wrap", userId, wrapInfoAfter.VisitingUserId);
        }
Ejemplo n.º 9
0
        public void Tc020()
        {
            const string PictureToUpload = @"C:\temp\Stf\Images\WT.jpg";

            // Set up user context for actual test
            // Use default user
            WrapTrackShell.Login();

            var me = WrapTrackShell.Me();

            StfAssert.IsNotNull("WrapTrackShell", WrapTrackShell);
            StfAssert.IsInstanceOfType("me", me, typeof(IMeProfile));

            var modelId                = GetRandomModelId();
            var wtApi                  = Get <IWtApi>();
            var modelInfoBefore        = wtApi.ModelInfoByModelId(modelId);
            var oldNumberOfModelImages = modelInfoBefore.NumOfImages;

            // TODO: Check also for Empty String e.g.
            // StfAssert.IsEmptyString("modelId", modelId)
            StfAssert.IsNotNull("modelId", modelId);

            var modelToGet = WrapTrackShell.GetToModel(modelId);

            StfAssert.IsNotNull("modelToGet", modelToGet);
            var uploadPicture = modelToGet.UploadPicture(PictureToUpload);

            StfAssert.IsNotNull($"Able to upload picture [{PictureToUpload}]", uploadPicture);

            var modelInfoAfter        = wtApi.ModelInfoByModelId(modelId);
            var newNmberOfModelImages = modelInfoAfter.NumOfImages;

            StfAssert.AreEqual(
                "Check if number of model images has increased",
                oldNumberOfModelImages + 1,
                newNmberOfModelImages);
        }