New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tests: Add intern support #450
Conversation
test/intern.js
Outdated
environments: [ | ||
{ browserName: "chrome" }, | ||
{ browserName: "internet explorer", version: [ "11", "10" ] }, | ||
{ browserName: "firefox", version: "34" } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should include all the supported browsers see https://github.com/jquery/globalize/blob/master/browserstack.json
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One additional comment: When testing IE8, we need to include ES5 shim (see unit-es5-shim.html
and unit-es5-shim.html
).
The first time I ran
After manually killing the live process, I was able to run it again.
1: diff --git a/Gruntfile.js b/Gruntfile.js
index 900c6a0..ee17768 100644
--- a/Gruntfile.js
+++ b/Gruntfile.js
@@ -477,6 +477,9 @@ module.exports = function( grunt ) {
systemProperties: {}
}
}
+ },
+ "stop-selenium-server": {
+ dev: {}
}
});
|
@@ -480,10 +508,19 @@ module.exports = function( grunt ) { | |||
|
|||
// TODO fix issues, enable | |||
// "jscs:dist", | |||
"test:functional", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are two things I don't want to lose:
- Having local tests run on the default task.
- Having unit tests run before building (requirejs, ...) and having functional tests run before minification (uglify).
@rxaviers ill checkout the stop selenium server part i asked him to add this i use it on other projects. |
👍 |
It turns out intern doesn't support ie8 in unit tests, so I have removed it for now. |
@rxaviers are you happy with the latest changes? Do you want me to review this as well? |
Gruntfile.js
Outdated
} | ||
}, | ||
"stop-selenium-server": { | ||
dev: {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this (selenium + chromedriver) a requirement for having tests to run on browserstack? Or is it a requirement for having tests to run on Chrome locally?
Isn't 'browserstack.selenium_version': '2.45.0'
configuration sufficient? (more info).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is for running locally on chrome. Normally to run locally like this with intern you would need to download selenium, download, chromedriver start selenium with chrome driver then run the tests. This downloads everything with npm and starts and stops the server.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @arschmitz. So, @apsdehal let's remove this change please. More details in (1.2) of this comment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rxaviers What your talking about in your comment below is rather different. This is for testing via webdriver locally it very much aids in contributors being able to do with with out the steps i list above browserstack is great but most contributors wont have access to this.
Intern supports 3 ways of running tests.
Via Selenium with webdriver
Via Node with a runner
Via the browser directly via client.html
I think contributors should be able to easily do all three of these locally for proper testing this addresses # 1 what you ask for in the comment below addresses # 3
@apsdehal you have done a great work so far. But, before continuing with my review, I think it would be good to align with you the goals I have in mind for testing below. Do you think is it feasible to address them on this PR? @apsdehal @arschmitz @jzaefferer Does anyone see anything missing in the below (or that could be performed in a better way)?
|
This is part of intern already. Just need the tasks set up
Intern only supports IE8 for functional testing which you do not do ( or likely need ) with globalize there is no way manual or otherwise to run ie8 tests with intern. Chi does not support ie8 and is the assertion library used by intern. ES5 shim will not fix this. How important do you consider testing against IE8 at this point it will no longer be supported in 6 months and you dont support it with out the use of es5 shim anyway. As a side not both ui and mobile have talked about the current versions we are getting ready to release being the last to support IE8. There is intern geezer edition that supports ie8 but i don't think it supports qunit interface and has a lot of other disadvantages as well we may be able to use it just for ie8 though and add the interface for qunit i don't have any experience with geezer.
It already works they are just redirects now all tests are run from a single html page within the node modules intern directory configuration options are passed to it to tell it what tests to run.
The goal of this PR was just to really get globalize setup with intern for cross browser testing other sorts of matrix testing seem like they could be added later as you have time. |
For clarification, yeap Globalize doesn't need the browser interaction simulation that intern calls functional. But, Globalize does have functional tests (i.e., tests that ensure the distributed built Globalize works as expected), which can run using what intern calls unit testing. About IE8... Like I said, it can be tested manually in the meanwhile (while it's still supported) by using what I described in the item 1.2 above. I'm not concerned that we cannot automate its testing using intern.
I want to keep things simple. In other words, introducing intern for 1.2 introduces an unnecessary complexity.
I agree. Therefore, the items described in 2.1 and 3 could be ignored on this PR. |
Unless you are suggesting on keeping actual QUnit duplicating ALL the tests and having 2 complete and duplicated test setups im not sure what you mean by this?
What added complexity the fact that when you click the link it redirects? |
91ad84d
to
3236106
Compare
- Local - General
- Contains all the files to be tests for unit
- Explicitly set intern/main in config paths
- This will test globalize using phantom js in following envs: - 0.10 - 0.11 - 0.12 - Travis Stable - This will also test globalize on browsers in nodejs 0.10 version
- `grunt test:local` - Builds - Runs connect server - Navigate to `localhost:9000/test/unit.html` - Navigate to `localhost:9000/test/functional.html`
Fail fast option (to fail if any of tests fail) will take a little time. |
@rxaviers This is ready to be tested in the current scenario, except the problem that I am not yet able to achieve 100% tests passing with browserstack because different things fail in varied scenarios on browserstack. |
I am closing all old (and stalled) PRs |
TODO:
test:unit
andtest:functional
test:ci
task and make sure it runs properly on Travisconnect