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

chore: completely remove the ng scenario runner #15931

Merged
merged 3 commits into from
Dec 14, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 0 additions & 12 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -186,16 +186,6 @@ module.exports = function(grunt) {
},

build: {
scenario: {
dest: 'build/angular-scenario.js',
src: [
'bower_components/jquery/dist/jquery.js',
util.wrap([files['angularSrc'], files['angularScenario']], 'ngScenario/angular')
],
styles: {
css: ['css/angular.css', 'css/angular-scenario.css']
}
},
angular: {
dest: 'build/angular.js',
src: util.wrap([files['angularSrc']], 'angular'),
Expand Down Expand Up @@ -281,9 +271,7 @@ module.exports = function(grunt) {
files: [
'src/**/*.js',
'test/**/*.js',
'!test/ngScenario/DescribeSpec.js',
'!src/ng/directive/attrs.js', // legitimate xit here
'!src/ngScenario/**/*.js',
'!test/helpers/privateMocks*.js'
],
options: {
Expand Down
27 changes: 0 additions & 27 deletions angularFiles.js
Original file line number Diff line number Diff line change
Expand Up @@ -153,26 +153,8 @@ var angularFiles = {
]
},

'angularScenario': [
'src/ngScenario/Scenario.js',
'src/ngScenario/Application.js',
'src/ngScenario/Describe.js',
'src/ngScenario/Future.js',
'src/ngScenario/ObjectModel.js',
'src/ngScenario/Runner.js',
'src/ngScenario/SpecRunner.js',
'src/ngScenario/dsl.js',
'src/ngScenario/matchers.js',
'src/ngScenario/output/Html.js',
'src/ngScenario/output/Json.js',
'src/ngScenario/output/Xml.js',
'src/ngScenario/output/Object.js'
],

'angularTest': [
'test/helpers/*.js',
'test/ngScenario/*.js',
'test/ngScenario/output/*.js',
'test/*.js',
'test/auto/*.js',
'test/ng/**/*.js',
Expand All @@ -193,22 +175,15 @@ var angularFiles = {
'test/jquery_remove.js',
'@angularSrc',
'@angularSrcModules',
'@angularScenario',
'@angularTest'
],

'karmaExclude': [
'test/jquery_alias.js',
'src/angular-bootstrap.js',
'src/ngScenario/angular-bootstrap.js',
'src/angular.bind.js'
],

'karmaScenario': [
'build/angular-scenario.js',
'build/docs/docs-scenario.js'
],

'karmaModules': [
'build/angular.js',
'@angularSrcModules',
Expand All @@ -231,13 +206,11 @@ var angularFiles = {
'test/jquery_alias.js',
'@angularSrc',
'@angularSrcModules',
'@angularScenario',
'@angularTest'
],

'karmaJqueryExclude': [
'src/angular-bootstrap.js',
'src/ngScenario/angular-bootstrap.js',
'test/jquery_remove.js',
'src/angular.bind.js'
]
Expand Down
6 changes: 0 additions & 6 deletions docs/content/guide/e2e-testing.ngdoc
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,6 @@

# E2E Testing

<div class="alert alert-danger">
**Note:** In the past, end-to-end testing could be done with a deprecated tool called
[AngularJS Scenario Runner](http://code.angularjs.org/1.2.16/docs/guide/e2e-testing). That tool
is now in maintenance mode.
</div>

As applications grow in size and complexity, it becomes unrealistic to rely on manual testing to
verify the correctness of new features, catch bugs and notice regressions. Unit tests
are the first line of defense for catching bugs, but sometimes issues come up with integration
Expand Down
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@
"karma-firefox-launcher": "^1.0.1",
"karma-jasmine": "^1.1.0",
"karma-junit-reporter": "^1.2.0",
"karma-ng-scenario": "^1.0.0",
"karma-sauce-launcher": "^1.2.0",
"karma-script-launcher": "^1.0.0",
"karma-spec-reporter": "^0.0.31",
Expand Down
1 change: 0 additions & 1 deletion src/ng/browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ function Browser(window, document, $log, $sniffer) {

/**
* @private
* Note: this method is used only by scenario runner
* TODO(vojta): prefix this method with $$ ?
* @param {function()} callback Function that will be called when no outstanding request
*/
Expand Down
2 changes: 0 additions & 2 deletions src/ng/location.js
Original file line number Diff line number Diff line change
Expand Up @@ -938,8 +938,6 @@ function $LocationProvider() {
// update location manually
if ($location.absUrl() !== $browser.url()) {
$rootScope.$apply();
// hack to work around FF6 bug 684208 when scenario runner clicks on links
$window.angular['ff-684208-preventDefault'] = true;
Copy link
Member

Choose a reason for hiding this comment

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

}
}
}
Expand Down
74 changes: 49 additions & 25 deletions src/ngMock/browserTrigger.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,56 @@

(function() {
/**
* Triggers a browser event. Attempts to choose the right event if one is
* not specified.
* @ngdoc function
* @name browserTrigger
* @description
*
* This is a global (window) function that is only available when the {@link ngMock} module is
* included.
*
* It can be used to trigger a native browser event on an element, which is useful for unit testing.
*
*
* @param {Object} element Either a wrapped jQuery/jqLite node or a DOMElement
* @param {string} eventType Optional event type
* @param {Object=} eventData An optional object which contains additional event data (such as x,y
* coordinates, keys, etc...) that are passed into the event when triggered
* @param {string=} eventType Optional event type. If none is specified, the function tries
* to determine the right event type for the element, e.g. `change` for
* `input[text]`.
* @param {Object=} eventData An optional object which contains additional event data that is used
* when creating the event:
*
* - `bubbles`: [Event.bubbles](https://developer.mozilla.org/docs/Web/API/Event/bubbles).
* Not applicable to all events.
*
* - `cancelable`: [Event.cancelable](https://developer.mozilla.org/docs/Web/API/Event/cancelable).
* Not applicable to all events.
*
* - `charcode`: [charCode](https://developer.mozilla.org/docs/Web/API/KeyboardEvent/charcode)
* for keyboard events (keydown, keypress, and keyup).
*
* - `elapsedTime`: the elapsedTime for
* [TransitionEvent](https://developer.mozilla.org/docs/Web/API/TransitionEvent)
* and [AnimationEvent](https://developer.mozilla.org/docs/Web/API/AnimationEvent).
*
* - `keycode`: [keyCode](https://developer.mozilla.org/docs/Web/API/KeyboardEvent/keycode)
* for keyboard events (keydown, keypress, and keyup).
*
* - `keys`: an array of possible modifier keys (ctrl, alt, shift, meta) for
* [MouseEvent](https://developer.mozilla.org/docs/Web/API/MouseEvent) and
* keyboard events (keydown, keypress, and keyup).
*
* - `relatedTarget`: the
* [relatedTarget](https://developer.mozilla.org/docs/Web/API/MouseEvent/relatedTarget)
* for [MouseEvent](https://developer.mozilla.org/docs/Web/API/MouseEvent).
*
* - `which`: [which](https://developer.mozilla.org/docs/Web/API/KeyboardEvent/which)
* for keyboard events (keydown, keypress, and keyup).
*
* - `x`: x-coordinates for [MouseEvent](https://developer.mozilla.org/docs/Web/API/MouseEvent)
* and [TouchEvent](https://developer.mozilla.org/docs/Web/API/TouchEvent).
*
* - `y`: y-coordinates for [MouseEvent](https://developer.mozilla.org/docs/Web/API/MouseEvent)
* and [TouchEvent](https://developer.mozilla.org/docs/Web/API/TouchEvent).
*
*/
window.browserTrigger = function browserTrigger(element, eventType, eventData) {
if (element && !element.nodeName) element = element[0];
Expand Down Expand Up @@ -104,30 +147,11 @@

if (!evnt) return;

var originalPreventDefault = evnt.preventDefault,
appWindow = element.ownerDocument.defaultView,
fakeProcessDefault = true,
finalProcessDefault,
angular = appWindow.angular || {};

// igor: temporary fix for https://bugzilla.mozilla.org/show_bug.cgi?id=684208
angular['ff-684208-preventDefault'] = false;
evnt.preventDefault = function() {
fakeProcessDefault = false;
return originalPreventDefault.apply(evnt, arguments);
};

if (!eventData.bubbles || supportsEventBubblingInDetachedTree() || isAttachedToDocument(element)) {
element.dispatchEvent(evnt);
return element.dispatchEvent(evnt);
} else {
triggerForPath(element, evnt);
}

finalProcessDefault = !(angular['ff-684208-preventDefault'] || !fakeProcessDefault);

delete angular['ff-684208-preventDefault'];

return finalProcessDefault;
};

function supportsTouchEvents() {
Expand Down
15 changes: 0 additions & 15 deletions src/ngScenario/.eslintrc.json

This file was deleted.

142 changes: 0 additions & 142 deletions src/ngScenario/Application.js

This file was deleted.

Loading