Skip to content

Commit

Permalink
Use serve-static to run protractor with a single commmand. closes #210
Browse files Browse the repository at this point in the history
  • Loading branch information
lathonez committed Jan 17, 2017
1 parent ce8680e commit 8331382
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 10 deletions.
7 changes: 0 additions & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,8 @@ before_script:

script:
- ng test --watch=false --code-coverage # unit tests
- npm run ionic:build # ionic build
# Serve with python as ionic serve needs interaction
- cd www && python -m SimpleHTTPServer 8100 >> python_serve.log 2>&1 &
- npm run e2e # run e2e tests against ionic

after_failure:
- cat $TRAVIS_BUILD_DIR/python_serve.log
- cat $TRAVIS_BUILD_DIR/ionic_serve.log

after_success:
# Send coverage info off to cloud ppl
- ./node_modules/.bin/codecov
Expand Down
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@

The above update includes creating a mock for Ionic's platform class and using it as a provider in test.ts. I have not attempted to mock out the whole class, what is there is sufficient for clicker. If anything is missing for your app, you can add easily by referencing the signature in node_modules/ionic-angular/platform/platform.d.ts.

* **E2E**: Use serve-static to run protractor with a single commmand. closes [#210](https://github.com/lathonez/clicker/issues/210) ([](https://github.com/lathonez/clicker/commit/))

<a name="2.5.3"></a>
# 2.5.3 (2016-01-03)

Expand Down
3 changes: 1 addition & 2 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ test_script:
- npm --version
# run tests
- ng test --watch=false
# make sure app will build
- npm run ionic:build
- npm run e2e

build: off
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"scripts": {
"ionic:build": "ionic-app-scripts build",
"ionic:serve": "ionic-app-scripts serve",
"e2e": "protractor",
"e2e": "ionic-app-scripts build && protractor",
"postinstall": "ionic state restore && webdriver-manager update",
"start": "ionic serve",
"test": "ng test",
Expand Down
2 changes: 2 additions & 0 deletions protractor.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ exports.config = {
require('ts-node').register({
project: 'e2e'
});

require('connect')().use(require('serve-static')('www')).listen(8100);

This comment has been minimized.

Copy link
@mebibou

mebibou Jan 18, 2017

@lathonez you may want to add these to the package.json file

This comment has been minimized.

Copy link
@lordgreg

lordgreg Jun 26, 2017

Please add both modules to package.json.

This comment has been minimized.

Copy link
@lathonez

lathonez Jun 26, 2017

Author Owner
},
onPrepare: function() {
jasmine.getEnv().addReporter(new SpecReporter());
Expand Down

3 comments on commit 8331382

@lordgreg
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like you've previously installed both packages on travis, with or without package.json. Try to remove node_modules directory on travis-ci again and see what happens. Or try to clone this repo, do npm i and also see what happens when starting e2e tests.

@lathonez
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey,

Travis is a clean install each time, it's a docker container.

Also I cannot replicate locally (or on appveyor). That is the point of CI.

It makes sense that we should have serve-static installed - I'm thinking it is coming through as a dependency of another module depending on the node version - just wondering why we're not seeing it anywhere here.

Is it just serve-static that you're missing?

Thanks

@lordgreg
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi. Thank you for your reply. Its also the connect which was not found.

If doing only e2e/protractor, none of the dependencies have a sub-dependency to serve-static and connect.

My package.json currently includes both:

        "connect": "^3.6.2",
        "serve-static": "^1.12.3",

Please sign in to comment.