Skip to content
This repository has been archived by the owner on Apr 12, 2024. It is now read-only.

JSTD adapter for running e2e tests #337

Closed
wants to merge 4 commits into from

Conversation

vojtajina
Copy link
Contributor

Including three commits:

  • jstd-scenario adapter
  • removing HEAD requests before navigateTo
  • set Content-Type only for POST/PUT requests

@@ -17,7 +17,7 @@
<script src="syntaxhighlighter/shBrushJScript.js"></script>
<script src="syntaxhighlighter/shBrushXml.js"></script>

<script src="../angular.min.js" ng:autobind></script>
<script src="angular.min.js" ng:autobind></script>
Copy link
Contributor

Choose a reason for hiding this comment

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

this looks wrong.

@IgorMinar
Copy link
Contributor

I like the new changes.

I'm a bit concerned about the naming of ng:autostart and how it is related or unrelated to ng:autobind and our possible plans to rename ng:autobind to ng:autoboot (which may or might not happen). But I can't come to any hard conclusion so I think it's ok if we stick to ng:autostart. (but it needs to be documented somewhere)

Lastly, I don't understand why angular is being bundled with the documentation app. We want to avoid that because it increases the size of the release artifacts and because we want to always use code.angularjs.org in production so that angular.min.js gets cached in user's browsers.

@vojtajina
Copy link
Contributor Author

ng:autostart means that the runner is started automatically (when document ready)

  • we use ng:autostart when running without jstd
  • we don't use it, when running with jstd as jstd will start the runner on its own...

I hope this is fine.

@vojtajina
Copy link
Contributor Author

WRT to copying angular into documenation app:
This was kinda hackery. I did that because all links in docs are relative to docs folder (i.e. build/docs/), so it was easy to set jstd proxy to build/docs/. But then, you are not able to load build/angular.min.js, because you can't access http://localhost:8000/../angular.min.js.

jQuery has nothing to do with docs either - so I did the same for angular - just copy into docs folder.

I agree with you - it's wrong. Now I realized I can define a different proxy, see my last commit. So now, angular.min.js is not copied into build/docs folder anymore...

I did some changes into docs: rename copy() into copyTpl() and add more general copy() method.
Now, we don't need it anymore (it was just because of copying angular.min.js) - but I think it could be helpful and it makes kinda sense to call it copyTpl as it copies a file from templates folder.
Well, do you want me to revert these changes as well ?

Vojta Jina added 2 commits May 11, 2011 20:52
Removed angular.scenario.Application.checkUrlStatus_ method and these tests:
* should call error handler if status check fails
* should perform a HEAD request to verify file existence
* should call error handler if status code is less than 200
* should call error handler if status code is greater than 299
* should call error handler if status code is greater than 299
Sending Content-type header causes JSTD (Jetty) proxy to change GET methods into POST.
@vojtajina
Copy link
Contributor Author

Rebased onto last master, squashed into three commits...

@IgorMinar
Copy link
Contributor

I'll test this against feedback today and if there are no issues, we can go ahead and merge this into master

Vojta Jina added 2 commits May 19, 2011 17:37
Couple of changes into angular.scenario runner:
 - add autotest config (runs tests when document ready)
 - update ObjectModel (forwards events)
 - use only one ObjectModel instance for all outputters
 - expose error msg and line number in ObjectModel.Spec and ObjectModel.Step
 - fix generating spec.ids
 - fix 'html' output so that it does not mutate ObjectModel

Couple of changes into docs / generator:
 - rename copy -> copyTpl
 - move docs/static into docs/examples (to avoid conflict with jstd proxy)

Running all docs e2e tests:
========================================================
1/ compile angular-scenario, jstd-scenario-adapter
>> rake compile

2/ build docs
>> rake docs

3/ start jstd server
>> ./server-scenario.sh

4/ capture some browser

5/ run node server to serve static content
>> node ../lib/nodeserver/server.js

6/ run tests
>> ./test-scenario.sh
find . -name "*.js" -print | xargs sed -Ei s/[[:space:]]*$//
@IgorMinar
Copy link
Contributor

this was merged in yesterday!

@IgorMinar
Copy link
Contributor

closing

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants