Exemple #1
0
        public void TestUploadProfilePictExistingImage()
        {
            var wrapTrackShell     = Get <IWrapTrackWebShell>();
            var me                 = wrapTrackShell.Me();
            var uploadProfileImage = me.UploadProfileImage();
            var oldId              = uploadProfileImage.Identification;

            uploadProfileImage.FileName = @"C:\temp\TestData\Kurt.png";
            uploadProfileImage.Upload();

            var newId = uploadProfileImage.Identification;

            StfAssert.AreNotEqual("New Picture Id", oldId, newId);
        }
        public void Tc004()
        {
            var newUsername = WtUtils.GetRandomUsername();

            StfAssert.IsNotNull("wrapTrackShell", WrapTrackShell);
            WrapTrackShell.SignUp();

            var me = WrapTrackShell.Me();

            StfAssert.IsNotNull("me", me);

            var oldName = me.Username;

            me.Username = newUsername;

            var newName = me.Username;

            StfAssert.AreEqual("name check", newName, newUsername);
            StfAssert.AreNotEqual("New name is different", newName, oldName);
        }
        public void Tc028()
        {
            // User #1: Add a wrap
            var collection = GetCurrentUserCollection();

            // Add a wrap
            var wrapToGo   = collection.GetRandomWrap();
            var wtId       = wrapToGo.WtId;
            var wtApi      = Get <IWtApi>();
            var wrapInfo   = wtApi.WrapInfoByTrackId(wtId);
            var internalId = wrapInfo.InternalId;

            WrapTrackShell.Logout();

            // user #2 want the new wrap
            var anotherUser = GetAnotherUser(WrapTrackShell);

            // TODO: pw should not be hardcoded
            WrapTrackShell.Login(anotherUser, "wraptrack4ever");

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

            desiredWrap.AskFor();
            WrapTrackShell.Logout();

            // User #1: Don't want to pass on
            WrapTrackShell.Login(); // Default user
            WrapTrackShell.Me();

            // navigate to the news page - and then to request page
            WrapTrackShell.WebAdapter.ButtonClickById("nav_home");
            WrapTrackShell.WebAdapter.ButtonClickById("navRequests");

            var testNoRequests = WrapTrackShell.WebAdapter.FindElement(By.Id("textNoRequests"));
            var respons        = testNoRequests.Displayed;

            StfAssert.IsFalse("Dont want to hear 'no pending requests'", respons);

            // On actual page: Find button Decline
            var xPath  = $"//a[text()='{wtId}']/../../../../../..//button[@id='butDeclineReq']";
            var retVal = WrapTrackShell.WebAdapter.Click(By.XPath(xPath));

            if (!retVal)
            {
                StfAssert.IsFalse("Decline button not found", true);
            }

            // Find the ''yes'Im-sure'
            var xPath2  = $"//a[text()='{wtId}']/../../../../../..//button[@id='butDoDecline']";
            var retVal2 = WrapTrackShell.WebAdapter.Click(By.XPath(xPath2));

            // Click to accept the request
            if (!retVal2)
            {
                StfAssert.IsFalse("Do-decline button not found", true);
            }

            // Assert: The link to <wtId> is gone (request handled)
            Wait(TimeSpan.FromSeconds(1));
            var xPath3  = $"//a[text()='{wtId}']";
            var retVal3 = WrapTrackShell.WebAdapter.FindElement(By.XPath(xPath3));

            StfAssert.IsNull("Reqest is gone", retVal3);

            // Assert: User#2 not new owner
            var validationTarget = Get <IWtApi>();
            var wrapInfoAfter    = validationTarget.WrapInfoByTrackId(wtId);
            var newOwnerName     = wrapInfoAfter.OwnerName;

            StfAssert.AreNotEqual("User #2 is not new owner", newOwnerName, anotherUser);
        }