diff --git a/e2e/pages/inicio.po.js b/e2e/pages/inicio.po.js new file mode 100644 index 0000000..98c4f81 --- /dev/null +++ b/e2e/pages/inicio.po.js @@ -0,0 +1,11 @@ +module.exports = (function() { + 'use strict'; + + var PageObject = function() { + this.video = element(by.css('.video-player')); + + this.agenda = element(by.css('.event-list')); + }; + + return (new PageObject()); +})(); diff --git a/e2e/pages/inicio.spec.js b/e2e/pages/inicio.spec.js index 1eeb492..68d48c3 100644 --- a/e2e/pages/inicio.spec.js +++ b/e2e/pages/inicio.spec.js @@ -3,8 +3,7 @@ 'use strict'; describe('The index page', function () { - var page = browser.get('/'); - + var page = require('./inicio.po.js'); // beforeEach(function () { // browser.get('/'); // }); @@ -14,27 +13,59 @@ }); describe('Component: Main Video', function(){ - it('should have a alt text', function() {}); - it('should have a thumb background image (for async)', function() {}); - it('should have a button play trigger', function() {}); - it('should be accessible', function() {}); + it('should have a thumb background image (for async)', function() { + expect(page.video.element(by.css('.video-thumbnail'))).toBeDefined(); + expect(page.video.element(by.css('.video-thumbnail')).getCssValue('background-image')).toContain('youtube-background.png'); + expect(page.video.element(by.css('.video-thumbnail')).getAttribute('aria-hidden')).toBe('true'); + }); + + it('should have a button play trigger', function() { + expect(page.video.element(by.css('.video-play-button'))).toBeDefined(); + expect(page.video.element(by.css('.video-play-button')).getAttribute('aria-label')).toBeDefined(); + }); }); describe('Component: Agenda', function(){ - it('should have a title', function() {}); - it('should have a icon', function() {}); - it('should show the number of scheduled chats', function() {}); - it('should have a open trigger', function() {}); - it('should be accessible', function() {}); + it('should have a tab-trigger', function() { + expect(page.agenda.element(by.css('.event-tab--trigger'))).toBeDefined(); + expect(page.agenda.element(by.css('.event-tab--title'))).toBeDefined(); + expect(page.agenda.element(by.css('.event-tab--icon'))).toBeDefined(); + expect(page.agenda.element(by.css('.event-tab--icon')).element(by.css('.glyphicon'))).toBeDefined(); + expect(page.agenda.element(by.css('.event-tab--icon')).element(by.css('.glyphicon')).getAttribute('aria-hidden')).toBe('true'); + expect(page.agenda.element(by.css('.event-tab--button'))).toBeDefined(); + expect(page.agenda.element(by.css('.event-tab--total-scheduled'))).toBeDefined(); + expect(page.agenda.element(by.css('.event-tab--total-scheduled'))).toMatch(/(\d)*/); + }); describe('Component: Agenda / Open-panel', function(){ - it('should have a close trigger', function() {}); - it('should have the date/time of scheduled chat', function() {}); - it('should have the title of scheduled chat', function() {}); - it('should have a subscribe button to scheduled chat', function() {}); - it('should show the number of subscribers on each item', function() {}); - it('should show 5 itens at most', function() {}); - it('should be accessible', function() {}); + it('should have a header', function() { + // the 2 lines below need to open panel and make elements visibles + expect(page.agenda.element(by.model('eventListCtrl.isListVisible'))).toBeDefined(); + page.agenda.element(by.css('.event-tab--trigger')).click(); + + expect(page.agenda.element(by.css('.event-list--title'))).toBeDefined(); + expect(page.agenda.element(by.css('.event-list--title')).getText()).toEqual('Bate-papo com ministr@s'); + expect(page.agenda.element(by.css('.event-list--icon'))).toBeDefined(); + expect(page.agenda.element(by.css('.event-list--icon')).element(by.css('.glyphicon'))).toBeDefined(); + expect(page.agenda.element(by.css('.event-list--icon')).element(by.css('.glyphicon')).getAttribute('aria-hidden')).toBe('true'); + expect(page.agenda.element(by.css('.event-list--minimize'))).toBeDefined(); + expect(page.agenda.element(by.css('.event-list--minimize')).element(by.css('.glyphicon'))).toBeDefined(); + expect(page.agenda.element(by.css('.event-list--minimize')).element(by.css('.glyphicon')).getAttribute('aria-hidden')).toBe('true'); + }); + + it('should have a table with content', function() { + // date/time + expect(page.agenda.element(by.css('.event-list--minimize')).element(by.css('.glyphicon')).getAttribute('aria-hidden')).toBe('true'); + // title + // subscribe button + // total of subscribers + // show only 5 itens + }); + // it('should have the title of scheduled chat', function() {}); + // it('should have a subscribe button to scheduled chat', function() {}); + // it('should show the number of subscribers on each item', function() {}); + // it('should show 5 itens at most', function() {}); + // it('should be accessible', function() {}); }); describe('Component: Agenda / with Hangout', function(){ diff --git a/protractor.conf.js b/protractor.conf.js index 4236206..307dc98 100644 --- a/protractor.conf.js +++ b/protractor.conf.js @@ -30,12 +30,12 @@ browser.addMockModule('disableNgAnimate', disableNgAnimate); // Disable debug info - var disableDebugInfo = function() { - angular.module('disableDebugInfo', []).run(['$compileProvider', function($compileProvider) { - $compileProvider.debugInfoEnabled(false); - }]); - }; - browser.addMockModule('disableDebugInfo', disableDebugInfo); + // var disableDebugInfo = function() { + // angular.module('disableDebugInfo', []).run(['$compileProvider', function($compileProvider) { + // $compileProvider.debugInfoEnabled(false); + // }]); + // }; + // browser.addMockModule('disableDebugInfo', disableDebugInfo); // Store the name of the browser that's currently being used. browser.getCapabilities().then(function(caps) { @@ -52,10 +52,10 @@ // The timeout in milliseconds for each script run on the browser. This should // be longer than the maximum time your application needs to stabilize between // tasks. - allScriptsTimeout: 11000, + allScriptsTimeout: 15000, // How long to wait for a page to load. - getPageTimeout: 10000, + getPageTimeout: 12000, // Spec patterns are relative to the current working directly when // protractor is called. diff --git a/src/app/components/event-list/event-list.html b/src/app/components/event-list/event-list.html index a9b467d..0694e93 100644 --- a/src/app/components/event-list/event-list.html +++ b/src/app/components/event-list/event-list.html @@ -2,12 +2,13 @@
- +
Bate-Papo com ministr@s
@@ -17,9 +18,7 @@
-

- Bate-papo com ministr@s -

+

Bate-papo com ministr@s

-- libgit2 0.21.2