public void Tc031() { var testdata = InitTestData <TestDataAddWrapConversion>(); WrapTrackShell = Get <IWrapTrackWebShell>(); // Use default user WrapTrackShell.Login(); var testCaseUtil = new TestCaseUtils(StfAssert); var addCarrier = testCaseUtil.GetAddCarrier(WrapTrackShell, testdata.CarrierType); StfAssert.IsTrue("HandleHomeMade", testCaseUtil.HandleHomeMade(addCarrier, testdata.HomeMade)); testCaseUtil.HandleBrandCarriertypenicknameCarriermodel( addCarrier, testdata.Brand, testdata.CarrierTypeNickName, testdata.CarrierModel); StfAssert.IsTrue("Save", addCarrier.Save()); // Log where we got redirected to - Page Safe is fine - Control is better:-) StfLogger.LogScreenshot(StfLogLevel.SubHeader, "After Pressed Save"); }
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); }
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); }
/// <summary> /// The is news aboout wrap sent on holiday. /// </summary> /// <param name="wrapWtId"> /// The new wrap wt id. /// </param> /// <param name="sender"> /// The sender. /// </param> /// <param name="recipient"> /// The recipient. /// </param> /// <returns> /// The <see cref="bool"/>. /// </returns> private bool IsNewsAboutWrapSentOnHoliday(string wrapWtId, string sender, string recipient) { // set the profile context so we can navigate to the news page afterwards // Not sure why, but if we dont have this call in here the buttonclickbyid below doesn't find the navigation item WrapTrackShell.Me(); // navigate to the news page // Click tab page News WrapTrackShell.WebAdapter.ButtonClickById("nav_home"); var newsElements = WrapTrackShell.WebAdapter.FindElements(By.Id("vikle_ferie")); if (newsElements.Count == 0) { StfLogger.LogInfo("Found no news elements at all - for wraps sent on holiday"); return(false); } foreach (var newsElement in newsElements) { var newsHolidayText = newsElement.Text; if (newsHolidayText.Contains(recipient) && newsHolidayText.Contains(wrapWtId) && newsHolidayText.Contains(sender)) { return(true); } } return(false); }
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); }
public void Tc012() { // User #1: Add a wrap var collection = GetCurrentUserCollection(); // Find a random wrap var wrapToGo = collection.GetRandomWrap(); var wtId = wrapToGo.WtId; WrapTrackShell.Logout(); // user #2 want the wrap var anotherUser = GetAnotherUser(WrapTrackShell); WrapTrackShell.Login(anotherUser); var desiredWrap = WrapTrackShell.GetToWrap(wtId); desiredWrap.AskFor(); WrapTrackShell.Logout(); // User #1: Lets wrap go WrapTrackShell.Login(); // Default user // TODO:Assert: Der er en anmodning på nyhedssiden, hvor man lander efter login // TODO:Vises ved link med teksten 'You have 1 pending request' (evt X pending requests) // TODO:Bruger klikker og kommer til request side, hvor hun godkender reqest fra bruger #2 }
public void Tc016() { // For now hard coded. TOdo: Random const string BrandId = "289"; const string BrandName = "Agossie"; // Use default user WrapTrackShell.Login(); StfAssert.IsNotNull("wrapTrackShell", WrapTrackShell); var randomBrand = this.GetBrand(BrandName); var newModelName = WtUtils.GetRandomString("StfModel"); var baseLineNumberOfModels = wtApi.BrandNumberOfModels(BrandId); var modelAdded = randomBrand.AddModel(newModelName); var numberOfModels = wtApi.BrandNumberOfModels(BrandId); StfAssert.IsTrue($"Model {newModelName} Added", modelAdded); StfAssert.AreEqual("Number of models for brand up by one", numberOfModels, baseLineNumberOfModels + 1); var patternDeleted = randomBrand.DeleteModel(newModelName); numberOfModels = wtApi.BrandNumberOfModels(BrandId); StfAssert.IsTrue($"Model {newModelName} Deleted", patternDeleted); StfAssert.AreEqual($"Number of models for brand as baseline", numberOfModels, baseLineNumberOfModels); }
public void Tc027() { const string ChapterText = "Some text to add from TC027"; StfAssert.IsNotNull("wrapTrackShell", WrapTrackShell); WrapTrackShell.SignUp(); var me = WrapTrackShell.Me(); StfAssert.IsNotNull("me", me); var collection = me.GetCollection(); StfAssert.IsNotNull("Got my collection", collection); var newWrap = collection.AddWrap("Ali Dover", "Hygge", "blue"); var wrap = GetToWrap(newWrap); var addChapter = AddChapter(wrap, ChapterText); StfAssert.IsTrue("Added Chapter", addChapter); var doesNewsExist = DoesNewsExist(newWrap, ChapterText); StfAssert.IsTrue("Does news exist for the added Chapter", doesNewsExist); StfLogger.LogInfo("Hi Brian, here is the currently logged in user {0}", WrapTrackShell.CurrentLoggedInUser); }
public void Tc037() { const string ReviewText = "This is an automated review by TC037"; const string BrandName = "Agossie"; const string PatternName = "Orchid"; const string ModelName = "Glores"; StfAssert.IsNotNull("wrapTrackShell", WrapTrackShell); WrapTrackShell.SignUp(); var me = WrapTrackShell.Me(); StfAssert.IsNotNull("me", me); var collection = me.GetCollection(); StfAssert.IsNotNull("Got my collection", collection); var newWrap = collection.AddWrap(BrandName, PatternName, ModelName); var wrap = GetToWrap(newWrap); var writeReviewForWrap = WriteReviewForWrap(wrap, ReviewText); StfAssert.IsTrue("Review written for wrap", writeReviewForWrap); var doesNewsOfCarrierReviewExist = DoesNewsOfCarrierReviewExist(ModelName, ReviewText); StfAssert.IsTrue("Does news exist that carrier has a review", doesNewsOfCarrierReviewExist); }
public void Tc038() { StfAssert.IsNotNull("wrapTrackShell", WrapTrackShell); WrapTrackShell.SignUp(); var criteria = EnumExtensions.GetRandomEnum <ModelReviewProperties>(); var criteriaText = criteria.GetDisplayName(); var me = WrapTrackShell.Me(); StfAssert.IsNotNull("me", me); var collection = me.GetCollection(); StfAssert.IsNotNull("Got my collection", collection); var newWrap = collection.AddWrap(BrandName, PatternName, ModelName); var wrap = GetToWrap(newWrap); var makeEvaluationForWrap = MakeEvaluationForWrap(wrap, criteria); StfAssert.IsTrue("evaluation made for wrap", makeEvaluationForWrap); var doesNewsOfCarrierEvaluationExist = DoesNewsOfCarrierEvaluationExist(ModelName, criteriaText); StfAssert.IsTrue("Does news exist that carrier has an evaluation", doesNewsOfCarrierEvaluationExist); }
/// <summary> /// The is news about new wrap being registered /// </summary> /// <param name="wrapWtId"> /// The new wrap wt id. /// </param> /// <param name="registrar"> /// The registrar of the wrap /// </param> /// <returns> /// The <see cref="bool"/>. /// </returns> private bool IsNewsAboutNewWrap(string wrapWtId, string registrar) { // set the profile context so we can navigate to the news page afterwards // Not sure why, but if we dont have this call in here the buttonclickbyid below doesn't find the navigation item WrapTrackShell.Me(); // navigate to the news page // Click tab page News WrapTrackShell.WebAdapter.ButtonClickById("nav_home"); var newsElements = WrapTrackShell.WebAdapter.FindElements(By.Id("baereredskab_oprettet")); foreach (var newsElement in newsElements) { var newsAboutNewWrapText = newsElement.Text; if (newsAboutNewWrapText.Contains(registrar) && newsAboutNewWrapText.Contains(wrapWtId)) { return(true); } } return(false); }
public void Tc009() { WrapTrackShell.SignUp(); // new user - empty collection var me = WrapTrackShell.Me(); StfAssert.IsNotNull("We got a me - a brand new user", me); var collection = me.GetCollection(); collection.AddWrap(); // precise 1 wrap in collection var theOneAndOnlyWrap = collection.GetRandomWrap(); var pathToNewImage = GetNewImagePath(); // Find number of pictures before var validationTarget = Get <IWtApi>(); var wtId = theOneAndOnlyWrap.WtId; // tracking-id var numberOfPictures = GetNumberOfPictures(validationTarget, wtId); StfAssert.AreEqual("0 pictures before upload", 0, numberOfPictures); // Do 4 * upload theOneAndOnlyWrap.UploadWrapImage(pathToNewImage, 4); Wait(TimeSpan.FromSeconds(3)); numberOfPictures = GetNumberOfPictures(validationTarget, wtId); StfAssert.AreEqual("4 pictures after upload", numberOfPictures, 4); // Remove two pictures and assert there is 2 picture left this.RemovePicturesFromWrap(theOneAndOnlyWrap, 2); Wait(TimeSpan.FromSeconds(3)); numberOfPictures = GetNumberOfPictures(validationTarget, wtId); StfAssert.AreEqual("2 picture left", 2, numberOfPictures); }
public void Tc036() { const string TypeOfSale = "for sale (FSO)"; StfAssert.IsNotNull("wrapTrackShell", WrapTrackShell); WrapTrackShell.SignUp(); var me = WrapTrackShell.Me(); StfAssert.IsNotNull("me", me); var collection = me.GetCollection(); StfAssert.IsNotNull("Got my collection", collection); var newWrap = collection.AddWrap("Ali Dover", "Hygge", "blue"); var wrap = GetToWrap(newWrap); var markWrapForSale = MarkWrapForSale(wrap, TypeOfSale); StfAssert.IsTrue("Marked carrier for sale", markWrapForSale); var doesNewsOfCarrierForSaleExist = this.DoesNewsOfCarrierForSaleExist(newWrap, TypeOfSale); StfAssert.IsTrue("Does news exist that carrier is for sale", doesNewsOfCarrierForSaleExist); }
public void Tc015() { // For now hard coded. TOdo: Random const string BrandId = "289"; const string BrandName = "Agossie"; // Use default user WrapTrackShell.Login(); StfAssert.IsNotNull("wrapTrackShell", WrapTrackShell); var randomBrand = this.GetBrand(BrandName); var newPatternName = WtUtils.GetRandomString("StfPattern"); var baseLineNumberOfPatterns = wtApi.BrandNumberOfPatterns(BrandId); var patternAdded = randomBrand.AddPattern(newPatternName); var numberOfPatterns = wtApi.BrandNumberOfPatterns(BrandId); StfAssert.IsTrue($"Pattern {newPatternName} Added", patternAdded); StfAssert.GreaterThan("Number of patterns for brand up by one", numberOfPatterns, baseLineNumberOfPatterns); var patternDeleted = randomBrand.DeletePattern(newPatternName); StfAssert.IsTrue($"Pattern {newPatternName} Deleted", patternDeleted); numberOfPatterns = wtApi.BrandNumberOfPatterns(BrandId); StfAssert.AreEqual($"Number of patterns for brand as baseline", numberOfPatterns, baseLineNumberOfPatterns); }
public void TestInitialize() { WrapTrackShell = Get <IWrapTrackWebShell>(); WrapTrackShell.Login(); // Be sure we have enough wraps for all test instances Collection = GetCurrentUserCollection(WrapTrackShell); }
public void TestInitialize() { WrapTrackShell = Get <IWrapTrackWebShell>(); WrapTrackShell.Login(); // GetCurrentUserCollection will add one wrap if none found // Ensure we have enough wraps for all test instances this.GetCurrentUserCollection(this.WrapTrackShell); }
public void Tc004() { StfAssert.IsNotNull("wrapTrackShell", WrapTrackShell); WrapTrackShell.SignUp(); var me = WrapTrackShell.Me(); StfAssert.IsNotNull("me", me); }
public void Tc003() { WrapTrackShell.Login(); WrapTrackShell.Logout(); // And the result.... var me = WrapTrackShell.Me(); StfAssert.IsNull("me", me); }
/// <summary> /// The does news exist. /// </summary> /// <param name="wrapId"> /// The wrap id. /// </param> /// <param name="chapterText"> /// The chapter text. /// </param> /// <returns> /// The <see cref="bool"/>. /// </returns> private bool DoesNewsExist(string wrapId, string chapterText) { StfAssert.StringNotEmpty("WrapId", wrapId); var news = WrapTrackShell.News(); var newsEntry = news.GetNewsEntryCarrierStory(wrapId, chapterText); StfAssert.IsNotNull("NewsEntry", newsEntry); return(true); }
/// <summary> /// The does news exist. /// </summary> /// <param name="modelName"> /// The model name /// </param> /// <param name="criteriaText"> /// The review text /// </param> /// <returns> /// The <see cref="bool"/>. /// </returns> private bool DoesNewsOfCarrierEvaluationExist(string modelName, string criteriaText) { StfAssert.StringNotEmpty("modelId", modelName); StfAssert.StringNotEmpty("criteriaText", criteriaText); var news = WrapTrackShell.News(); var newsEntry = news.GetNewsEntryCarrierEvaluation(modelName, criteriaText); StfAssert.IsNotNull("NewsEntry", newsEntry); return(true); }
public void Tc025() { // Set up user context for actual test // Use default user WrapTrackShell.Login(); // Add a new wrap and check for a news item AddWrapAndCheckForNewsAboutNewWrap(); // Add another new wrap and check for a news item AddWrapAndCheckForNewsAboutNewWrap(); }
/// <summary> /// The does news exist. /// </summary> /// <param name="modelName"> /// The model name /// </param> /// <param name="reviewText"> /// The review text /// </param> /// <returns> /// The <see cref="bool"/>. /// </returns> private bool DoesNewsOfCarrierReviewExist(string modelName, string reviewText) { StfAssert.StringNotEmpty("modelId", modelName); StfAssert.StringNotEmpty("reviewText", reviewText); var news = WrapTrackShell.News(); var newsEntry = news.GetNewsEntryCarrierReview(modelName, reviewText); StfAssert.IsNotNull("NewsEntry", newsEntry); return(true); }
/// <summary> /// The does news exist. /// </summary> /// <param name="wrapId"> /// The wrap id. /// </param> /// <param name="typeOfSale"> /// The type of the sale /// </param> /// <returns> /// The <see cref="bool"/>. /// </returns> private bool DoesNewsOfCarrierForSaleExist(string wrapId, string typeOfSale) { StfAssert.StringNotEmpty("WrapId", wrapId); StfAssert.StringNotEmpty("typeOfSale", typeOfSale); var news = WrapTrackShell.News(); var newsEntry = news.GetNewsEntryCarrierForSale(wrapId, typeOfSale); StfAssert.IsNotNull("NewsEntry", newsEntry); return(true); }
/// <summary> /// The create user and find nati baby mulu model. /// </summary> /// <returns> /// The <see cref="IModel"/>. /// </returns> private IModel CreateUserAndFindNatiBabyMuluModel() { StfAssert.IsNotNull("wrapTrackShell", WrapTrackShell); var signUpResult = WrapTrackShell.SignUpAndLogin(); StfAssert.IsTrue("Sign up and login as test user", signUpResult); var natiBabyMuluModel = WrapTrackShell.GetToModel("2624"); StfAssert.IsNotNull("Nati Baby Mulu model", natiBabyMuluModel); return(natiBabyMuluModel); }
/// <summary> /// The get to wrap. /// </summary> /// <param name="wrapId"> /// The wrap id. /// </param> /// <returns> /// The <see cref="IWrap"/>. /// </returns> private IWrap GetToWrap(string wrapId) { StfAssert.StringNotEmpty("Got ID of new wrap", wrapId); var wtApi = Get <IWtApi>(); var wrapInfoBefore = wtApi.WrapInfoByTrackId(wrapId); var internalId = wrapInfoBefore.InternalId; // Move to the new wrap var retVal = WrapTrackShell.GetToWrap(internalId); return(retVal); }
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)); }
public void TestInitialize() { WrapTrackShell = Get <IWrapTrackWebShell>(); WrapTrackShell.Login(); // Be sure we have enough wraps for all test instances Collection = GetCurrentUserCollection(WrapTrackShell); var numOfWraps = Collection.NumOfWraps(); if (numOfWraps == 0) { Collection.AddWrap(); } }
public void Tc005() { var pathToNewImage = GetNewImagePath(); var me = WrapTrackShell.Me(); StfAssert.IsNotNull("Got a MeProfile", me); var oldImage = me.ActualImage(); StfLogger.LogInfo($"Found image [{oldImage}] as actual Image"); me.UploadProfileImage(pathToNewImage); var newImage = me.ActualImage(); StfLogger.LogInfo($"After upload found image [{newImage}] as actual Image"); StfAssert.StringNotEquals("Got a new actual image", oldImage, newImage); }
public void Tc006() { WrapTrackShell.Login(); var me = WrapTrackShell.Me(); var collection = me.GetCollection(); StfAssert.IsNotNull("Got a MeProfile", me); StfAssert.IsNotNull("Got my collection", collection); var numBefore = collection.NumOfWraps(); collection.AddWrap("Ali Dover", "Hygge", "blue"); var numAfter = collection.NumOfWraps(); StfAssert.AreEqual("One more wrap in collection", numBefore + 1, numAfter); }
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); }