Commit graph

13 commits

Author SHA1 Message Date
Misko Hevery
5143e7bf06 feat(module): new module loader 2012-01-10 22:27:00 -08:00
Misko Hevery
9c06394376 chore(scenario tests): make scenario tests pass again 2011-11-14 20:31:15 -08:00
Igor Minar
fe5240732d feat(strict mode): adding strict mode flag to all js files
the flag must be in all src and test files so that we get the benefit of
running in the strict mode even in jstd

the following script was used to modify all files:

for file in `find src test -name "*.js"`; do
  echo -e "'use strict';\n" > temp.txt
  cat $file >> temp.txt
  mv temp.txt $file
done
2011-07-18 12:12:55 -07:00
DiPeng
7974e7eb5f refactor($browser): hide startPoll and poll methods
Breaks $browser.poll() method is moved inline to $browser.startpoll()
Breaks $browser.startpoll() method is made private
Refactor tests to reflect updated browser API

Closes #387
2011-07-18 00:04:14 -07:00
Vojta Jina
7460a7ef61 Fix test for scenario.Application - should remove old iframe
This behavior was changed by e83465c362
So this commit should have been part of e83465c362

Also removed hiding and navigating to about:blank as it makes no sense now...
2011-06-15 22:58:57 -07:00
Vojta Jina
c5f0342ad8 Don't check url (by HEAD request) before navigateTo
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
2011-05-19 09:43:56 -07:00
Elliott Sprehn
dcf76e6816 Provide better sandbox error messages, and disallow running from file:// URLs 2010-11-02 11:27:54 -07:00
Elliott Sprehn
5524d2b0fb Check if file exists (not a 404) and that document is accessible and not using file:// URLs in Application 2010-10-29 11:40:56 -07:00
Misko Hevery
9c0225512c fixes IE related failures, and form submit event handling in ie 2010-10-26 16:33:59 -07:00
Elliott Sprehn
40d7e66f40 Lots of bug fixes in the scenario runner and a bunch of new features.
- By default the runner now creates multiple output formats as it runs. Nodes are created in the DOM with ids: json, xml, and html.

ex. $('#json').html() => json output of the runner
ex. $('#xml').html() => json output of the runner

$result is also an object tree result.

The permitted formats are html,json,xml,object.

If you don't want certain formats you can select specific ones with the new ng:scenario-output attribute on the script tag.

<script src="angular-scenario.js" ng:scenario-output="xml,json">

- Added element(...).count() that returns the number of matching elements for the selector.

- repeater(...).count() now returns 0 if no elements matched which can be used to check if a repeater is empty.

- Added toBe() matcher that does strict equality with ===

- Implement iit and ddescribe. If iit() is used instead of it() then only that test will run. If ddescribe() is used instead of describe() them only it() statements inside of it will run. Several iit/ddescribe() blocks can be used to run isolated tests.

- Implement new event based model for SpecRunner. You can now listen for events in the runner. This is useful for writing your own UI or connecting a remote process (ex. WebDriver). Event callbacks execute on the Runner instance.

Events, if fired, will always be in the below order. All events always happen
except for Failure and Error events which only happen in error conditions.

Events:
  RunnerBegin
  SpecBegin(spec)
  StepBegin(spec, step)
  StepError(spec, step, error)
  StepFailure(spec, step, error)
  StepEnd(spec, step)
  SpecError(spec, step, error)
  SpecEnd(spec)
  RunnerEnd

- Only allow the browser to repaint every 10 steps. Cuts 700ms off Firefox in benchmark, 200ms off Chrome.

- Bug Fix: Manually navigate anchors on click since trigger wont work in Firefox.
2010-10-26 15:17:57 -07:00
Misko Hevery
6ddcf91861 Fix test which was causing the Chrome runner to fail. Upgraded JSTD to latest. Cleanup whitespace. 2010-10-23 13:12:45 -07:00
Elliott Sprehn
e7e894a2e3 Significantly clean up the way the scenario DSL works and implement many more DSL statements.
- "this" always means the current chain scope inside a DSL

- addFutureAction callbacks now take ($window, $document, done)

- $document has a special method elements() that uses the currently selected nodes in the document as defined by using() statements.

- $document.elements() allows placeholder insertion into selectors to make them more readable.
  ex. $document.elements('input[name="$1"]', myVar) will substitute the value of myVar for $1 in the selector. Subsequent arguments are $2 and so on.

- $document.elements() results have a special method trigger(event) which should be used to events. This method implements some hacks to make sure browser UI controls update and the correct angular events fire.

- futures now allow custom formatting. By default any chain that results in a future can use toJson() or fromJson() to convert the future value to and from json. A custom parser can be provided with parsedWith(fn) where fn is a callback(value) that must return the parsed result.

Note: The entire widgets.html UI is now able to be controlled and asserted through DSL statements!!! Victory! :)
2010-10-19 00:45:38 -07:00
Elliott Sprehn
03df6cbddb New Angular Scenario runner and DSL system with redesigned HTML UI.
Uses the Jasmine syntax for tests, ex:

describe('widgets', function() {
  it('should verify that basic widgets work', function(){
    navigateTo('widgets.html');
    input('text.basic').enter('Carlos');
    expect(binding('text.basic')).toEqual('Carlos');
    input('text.basic').enter('Carlos Santana');
    expect(binding('text.basic')).not().toEqual('Carlos Boozer');
    input('text.password').enter('secret');
    expect(binding('text.password')).toEqual('secret');
    expect(binding('text.hidden')).toEqual('hiddenValue');
    expect(binding('gender')).toEqual('male');
    input('gender').select('female');
    expect(binding('gender')).toEqual('female');
  });
});

Note: To create new UI's implement the interface shown in angular.scenario.ui.Html.
2010-10-14 09:47:39 -07:00