2

I am writing e2e Tests for some JS application at the moment. Since I am not a JS developer I was investigating on this theme for a while and ended up with the following setup:

  • Jasmine2 as testing framework
  • grunt as "build-tool"
  • protractor as test runner
  • jenkins as CI server (already in use for plenty java projects)

Although the application under tests is not written in angular I decided to go for protractor, following a nice guide on howto make protractor run nicely even without angular.

Writing some simple tests and running them locally worked like a charm. In order to implicitly wait for some elements to show up in den DOM I used the following code in my conf.js:

  onPrepare: function() {
  	browser.driver.manage().timeouts().implicitlyWait(5000);
  }

All my tests were running as expected and so I decided to go to the next step, i.e. installation in the CI server.

The development team of the aplication I want to tests was already using grunt to build their application so I decided to just hook myself into that. The goal of my new grunt task is to:

  • assemble the application
  • start a local webserver running the application
  • run my protractor test
  • write some test reports

Finally I accomplished all of the above steps, but I am dealing with a problem now I cannot solve and did not find any help googling it. In order to run the protractor test from grunt I installed the grunt-protractor-runner.

The tests are running, BUT the implicit wait is not working, causing some tests to fail. When I added some explicit waits (browser.sleep(...)) everything is ok again but that is not what I want.

Is there any chance to get implicitly waiting to work when using the grunt-protractor-runner?

UPDATE: The problem does not have anything to do with the grunt-protractor-runner. When using a different webserver I start up during my taks its working again. To be more precisley: Using the plugin "grunt-contrib-connect" the tests is working using the plugin "grunt-php" the test fails. So I am looking for another php server for grunt now. I will be updating this question.

UPDATE 2: While looking for some alternatives I considered and finally decided to mock the PHP part of the app.

4

0 回答 0