mirror of
https://github.com/angular/angular.git
synced 2026-09-14 13:54:52 +08:00
5498a35789
the aio examples have various eslint issues regarding template rules, those are currently turned off and TODO comments have been added to them in the examples eslintrc, fix such issues and remove the respective TODO comments this also includes examples refactoring to use buttons for better accessibility, this change tries to make the smallest amound of changes to the examples' behaviors and designs/UI PR Close #44557
41 lines
1.5 KiB
TypeScript
41 lines
1.5 KiB
TypeScript
import { browser, element, by } from 'protractor';
|
|
|
|
describe('Two-way binding e2e tests', () => {
|
|
|
|
beforeEach(() => browser.get(''));
|
|
|
|
const minusButton = element.all(by.css('button')).get(0);
|
|
const plusButton = element.all(by.css('button')).get(1);
|
|
const minus2Button = element.all(by.css('button')).get(2);
|
|
const plus2Button = element.all(by.css('button')).get(3);
|
|
|
|
it('should display Two-way Binding', async () => {
|
|
expect(await element(by.css('h1')).getText()).toEqual('Two-way Binding');
|
|
});
|
|
|
|
it('should display four buttons', async () => {
|
|
expect(await minusButton.getText()).toBe('-');
|
|
expect(await plusButton.getText()).toBe('+');
|
|
expect(await minus2Button.getText()).toBe('-');
|
|
expect(await plus2Button.getText()).toBe('+');
|
|
});
|
|
|
|
it('should change font size texts', async () => {
|
|
await minusButton.click();
|
|
expect(await element.all(by.css('span')).get(0).getText()).toEqual('FontSize: 15px');
|
|
expect(await element.all(by.css('input')).get(0).getAttribute('value')).toEqual('15');
|
|
|
|
await plusButton.click();
|
|
expect(await element.all(by.css('span')).get(0).getText()).toEqual('FontSize: 16px');
|
|
expect(await element.all(by.css('input')).get(0).getAttribute('value')).toEqual('16');
|
|
|
|
await minus2Button.click();
|
|
expect(await element.all(by.css('span')).get(1).getText()).toEqual('FontSize: 15px');
|
|
});
|
|
|
|
it('should display De-sugared two-way binding', async () => {
|
|
expect(await element(by.css('h2')).getText()).toEqual('De-sugared two-way binding');
|
|
});
|
|
|
|
});
|