chore(material): add e2e smoke tests for a few more components.
Closes #1884
This commit is contained in:

committed by
Misko Hevery

parent
3011cd86bd
commit
8d6943227d
16
modules/examples/e2e_test/material/grid_list_spec.es6
Normal file
16
modules/examples/e2e_test/material/grid_list_spec.es6
Normal 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());
|
||||
});
|
||||
});
|
17
modules/examples/e2e_test/material/input_spec.es6
Normal file
17
modules/examples/e2e_test/material/input_spec.es6
Normal 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');
|
||||
});
|
||||
});
|
||||
|
@ -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');
|
||||
});
|
||||
});
|
||||
|
Reference in New Issue
Block a user