scenarios.js 936 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. 'use strict';
  2. /* https://github.com/angular/protractor/blob/master/docs/toc.md */
  3. describe('my app', function() {
  4. it('should automatically redirect to /view1 when location hash/fragment is empty', function() {
  5. browser.get('index.html');
  6. expect(browser.getLocationAbsUrl()).toMatch("/view1");
  7. });
  8. describe('view1', function() {
  9. beforeEach(function() {
  10. browser.get('index.html#!/view1');
  11. });
  12. it('should render view1 when user navigates to /view1', function() {
  13. expect(element.all(by.css('[ng-view] p')).first().getText()).
  14. toMatch(/partial for view 1/);
  15. });
  16. });
  17. describe('view2', function() {
  18. beforeEach(function() {
  19. browser.get('index.html#!/view2');
  20. });
  21. it('should render view2 when user navigates to /view2', function() {
  22. expect(element.all(by.css('[ng-view] p')).first().getText()).
  23. toMatch(/partial for view 2/);
  24. });
  25. });
  26. });