Performance testing and measuring the page load time of web aplications using PhantomJS and Google charts | Load Testing for Websites Blog Performance testing the page load time of a web application can be a little tricky but pretty useful for simulating what the user experience of your customers. The following solution uses the PhantomJS headless browser for measuring the needed timing information, Google charts for visualizing the results. The solution can also be used pretty much as it in the continuous integration environment based on Jenkins or any other system. For what can I use this solution ? page load time testingsize and number of resources retrieved for URL callload time for each resource The solution described below is composed of the following scripts and executables: 1. Steps to make the solution work for you (Linux OS as this is what I have , similar on MacOS or Windows). 1. browse to a terminal window and issue wait for PhantomJS to be downloaded and issue the command “ “now PhantomJS is installed 2. 3. 4. 5. The results should look like below:
Nightwatch.js krasimir/bubble.js Mocking Requests with Mocha, Chai and Sinon | Rob Dodson talks internets After a bit of a rocky start yesterday I’ve finally got Mocha and Chai running in the browser which is great. Today I’d like to test out some of the async functionality of Mocha. This seems to be the big selling point for most people so we’ll kick the tires a bit. Basic Async Tests with Mocha and Chai I wrote a little Node service that we’ll consume for testing purposes. We’ll need to make sure our node service is running for our tests to work and all of our URLs will point at localhost:3000. Here is our really simple Mocha spec. I just want to see if the ajax methods will run and hit our Node service but I’m running into the following issue in Chrome: XMLHttpRequest cannot load Bummer… :( OK, what’s going on here… To StackOverflow! OK hopefully we’re done with Node for now. Enter Sinon.js I’m going to use Sinon.js to help me mock, stub, fake, spy and do whatever the heck else I need to make sure my client code is solid. Failing as expected.
4. Testing TDD? The best way to make code testable is to start by writing the tests first - TDD style. Essentially, TDD boils down to: TDD is a set of rules for writing code: you write a failing test (red), then add just enough code to make it pass (green) and finally refactor where necessary (refactor). In this chapter, we discuss how to set up testing for your project using Mocha, how to do dependency injection for your CommonJS modules, and how you can test asynchronous code. The rest is best covered by some other book or tutorial; so if you haven't heard of TDD, get out from under that rock you've been living under and read Kent Beck's book and perhaps Michael Feather's book. Why write tests? Test driven development is not valuable because it catches errors, but because it changes the way you think about interfaces between modules. In most cases, you don't completely understand the system when you start writing it. What to test? Test frameworks Setting up and writing a test Basic assertions