Blog posts by Stefan Forsberg2013-09-02T20:38:17.0000000Z/blogs/Stefan-Forsberg/Optimizely WorldIn memory IContentRepository – The genealogy of pageshttp://www.popkram.com/blog/?p=22962013-09-02T20:38:17.0000000ZThis post is part of a series of post where I try to implement an in memory IContentRepository. The tests for this posts are found here and here. This post will look at the last members of the IContentLoader interface for a while, namely GetDescendents and GetAncestors. First thing that pop out is that Descendents …In memory IContentRepository – Getting childrenhttp://www.popkram.com/blog/?p=22712013-08-29T20:26:39.0000000ZThis post is part of a series of post where I try to implement an in memory IContentRepository. The tests for this posts are found here. In this post we’ll continue to look at another member of the IContentLoader interface, namely the GetChildren method. There’s an interesting method with the signature But since we, like …In memory IContentRepository – Getting a pagehttp://www.popkram.com/blog/?p=22672013-08-27T21:05:20.0000000ZThis post is part of a series of post where I try to implement an in memory IContentRepository. The tests for this posts are found here. When getting a page we’re using the IContentLoader interface. In this post we’ll focus in the most simple case, to load a page by a page reference and not …Testing IContentRepositoryhttp://www.popkram.com/blog/?p=22542013-08-27T21:04:38.0000000ZIf you want to test against IContentRepository you have some different options. 1. Database This is basically the same thing as when you’re running the site. In your test project you start up episerver in a console mode and each query/command is executed against the database in the same way it would have been if …EPiServer 7 patch 2, MVC and session statehttp://www.popkram.com/blog/?p=22022013-04-20T13:22:45.0000000ZWhen my colleague Niklas Melinder applied patch 2 for EPiServer 7 he ran into trouble when the site was deployed to our acceptance server. The site started to throw “System.InvalidOperationException: The SessionStateTempDataProvider class requires session state to be enabled.”. Since our acceptance environment runs with sessions state switched off it was pretty clear what caused …API when creating page data used for testshttp://www.popkram.com/blog/?p=21872013-02-24T14:19:00.0000000ZSome context: when using an in memory implementation of IContentRepository (most likely in a test scenario) you need to create pages that are involved in the tests. I’m not quite sure which approach I fancy so I thought I’d ask you. Given that these two snippets produces the same result, do you find one “better” [...]One reason why I don’t like service locatorhttp://www.popkram.com/blog/?p=21772013-02-18T11:26:28.0000000ZLet’s say I want to use the new (brilliant) ISelectionFactory to easily create a list of something for the editor to choose. The data the editor uses is fetched from EPiServers IContentRepository. Unfortunately this won’t work since the class is not created from the container. Instead we get an error in edit mode saying the [...]UI-testing (EPiServer): SpecFlowhttp://www.popkram.com/blog/?p=20802013-01-29T11:24:21.0000000ZThis post is not going to be about what BDD / Specification by example is and the benefits of it but more of a quick start with doing UI-testing in a SpecFlow manner. Installing SpecFlow Although it’s not technically necessary I’d advice you to add the SpecFlow extension to Visual Studio. This is added through [...]UI-testing (EPiServer): the need for speedhttp://www.popkram.com/blog/?p=20342013-01-25T19:32:13.0000000ZExecuting our two test takes around 20 seconds. If you’ve run the test you’ve noticed that a lot of the test time is actually spent on opening a new browser window. One way to mitigate this is to use the same browser throughout all the test which opens before the first test and closes after [...]UI-testing (EPiServer): improving the test(s)http://www.popkram.com/blog/?p=20142013-01-24T19:49:35.0000000ZThe code we ended up with in the previous post works but it’s hardly optimal. There are some tasks that are performed in each and every UI test. For instance, before the test start up the browser and maximize it and after the test close the browser. If we put this common tasks in a [...]UI-testing (EPiServer): up and runninghttp://www.popkram.com/blog/?p=19942013-01-23T09:53:52.0000000ZI’ve blogged previously about UI-testing. The purpose of that series of posts was to share information I’d gathered in the process of testing but I never really got around to writing about how to get started. Inspired by the Selenium testing tools cookbook I want to write some very hands-on posts so let’s get started. [...]What’s in EPiServers container?http://www.popkram.com/blog/?p=20362013-01-18T22:10:20.0000000ZI was curious what’s registered in the StructureMap container by EpiServer themselves. StructureMap comes with the helpful method WhatDoIHave() which spits out everything registered. I formatted that list to make it slightly prettier Here’s the list from the above code. Rumor has it that you need to have this list memorized if you are to [...]Testing strategies for EPiServer now and in the futurehttp://www.popkram.com/blog/?p=19452012-10-10T21:08:00.0000000Z<p>This post discusses some different approaches you can take to testing your EPiServer site. Unfortunately it won’t give you answers to the eternal question “what to test?”. While it’s always boring to do the typical consultant “it depends” it’s very hard to give general guidelines what to test, when to do it and what approach [...]</p>EPiServer 7 Preview – EditorDescriptor ui type and wrapper typehttp://www.popkram.com/blog/?p=19242012-09-11T21:54:00.0000000Z<p>I’ve been exploring the possibility to change how the new on page editor behaves and this is what I’ve found so far (wow, that was an uninspired introduction even for me). The following standard page with two PropertyNumber (int) will server as the base for the exploration. The template for this is a plain MVC [...]</p>EPiServer 7 Preview – An adaptable content repositoryhttp://www.popkram.com/blog/?p=18622012-08-24T18:34:00.0000000Z<p>I’ve blogged previously on why you’d want to create your “IDataFactory” and how decorators can help you keep your code clean. In this post I’ll expand on that subject. A tale of five children A given node contains five children. Two of these (in grey) are not visible in menues and two (in pink) are [...]</p>EPiServer 7 Preview – On StructureMapDependencyResolverhttp://www.popkram.com/blog/?p=18642012-08-22T22:47:00.0000000Z<p>With the DI support coming in EPiServer 7 SM sooner or later is going to try and resolve a dependency and fail to do so. Most likely this is due to a container configuration issue and this is where the StructureMapDependencyResolver that ships with the MVC template preview falls slightly short. Not that it won’t [...]</p>EPiServer 7 Preview – container supporthttp://www.popkram.com/blog/?p=18292012-06-20T06:42:00.0000000Z<p>If you’ve read my blog during the years you’ll know that I’ve blogged at time or two about dependency injection and Ioc-containers. The biggest problem with this that always saddened me a bit was that I could almost never spend any time talking about why I liked it and how much easier they made my [...]</p>EPiServer 7 Preview – migrationhttp://www.popkram.com/blog/?p=18002012-06-19T16:14:00.0000000Z<p>I’ve previously written about the migration support in PTB 2 migrations. In Falcon EPiServer have added their own migration support. Let’s start with a simple page type And then we’ll give it a value Changing the property name If we were to change the property name EPiServer have no real way of knowing what the [...]</p>Reviewing pages in EPiServer – identifying commentable areashttp://www.popkram.com/blog/?p=17802012-03-18T11:38:42.0000000Z(If this post seems out of context, return to introduction post and hopefully it will make more sense) How to identify commentable areas As described previously an article is made up of both an article page type as well as one more more chapter page types. The chapter page contains a xhtml editor in which [...]Building a little chat for EPiServer using SignalRhttp://www.popkram.com/blog/?p=17642012-03-01T23:07:03.0000000ZRecently I saw a forum thread over at EpiServer world that asked for chat functionality and since I had previously toyed around with the basic idea I decided to write a quick POC. Like Fredrik says it can be implemented using SignalR. SignalR is in their own words an “async signaling library for .NET to [...]