chore(material): add e2e smoke tests for a few more components.

Closes #1884
This commit is contained in:
Jeremy Elbourn
2015-05-12 08:54:47 -07:00
committed by Misko Hevery
parent 3011cd86bd
commit 8d6943227d
7 changed files with 63 additions and 8 deletions

View File

@ -0,0 +1,16 @@
var testUtil = require('angular2/src/test_lib/e2e_util');
describe('md-grid-list', function () {
var url = 'examples/src/material/grid_list/index.html';
beforeEach(() => { browser.get(url); });
afterEach(testUtil.verifyNoBrowserErrors);
it('should set tiles into different positions', () => {
var tiles = element.all(by.css('md-grid-list#complex md-grid-tile'));
// If the grid-list was not doing any layout, all of the tiles would have the same position.
// So our smoke test simply checks that any two tiles are in different positions.
expect(tiles.first().getLocation()).not.toEqual(tiles.last().getLocation());
});
});

View File

@ -0,0 +1,17 @@
var testUtil = require('angular2/src/test_lib/e2e_util');
describe('md-input', function () {
var url = 'examples/src/material/input/index.html';
beforeEach(() => { browser.get(url); });
afterEach(testUtil.verifyNoBrowserErrors);
it('should enter a value to the input', () => {
var input = element.all(by.css('md-input-container input')).first();
input.sendKeys('Hello');
expect(input.getAttribute('value')).toBe('Hello');
});
});

View File

@ -6,5 +6,16 @@ describe('md-radio-button', function () {
beforeEach(() => { browser.get(url); });
afterEach(testUtil.verifyNoBrowserErrors);
// Radio buttons are broken right now, see https://github.com/angular/angular/issues/1643
it('should check one radio button and then check another', () => {
var standaloneRadios = element.all(by.css('[name="element"]'));
var firstRadio = standaloneRadios.first();
var lastRadio = standaloneRadios.last();
firstRadio.click();
expect(firstRadio.getAttribute('aria-checked')).toBe('true');
lastRadio.click();
expect(firstRadio.getAttribute('aria-checked')).toBe('false');
expect(lastRadio.getAttribute('aria-checked')).toBe('true');
});
});