Modified after function for Jasmine to be afterEach.
Added functions from Angular JS E2E testing.