
This commit updates the docs examples to be compatible with the `only-arrow-functions` tslint rule. This is in preparation of updating the docs examples `tslint.json` to match the one generated for new Angular CLI apps in a future commit. PR Close #38143
48 lines
1.5 KiB
TypeScript
48 lines
1.5 KiB
TypeScript
import { browser, element, by } from 'protractor';
|
|
|
|
describe('Interpolation e2e tests', () => {
|
|
|
|
beforeEach(() => {
|
|
browser.get('');
|
|
});
|
|
|
|
it('should display Interpolation and Template Expressions', () => {
|
|
expect(element(by.css('h1')).getText()).toEqual('Interpolation and Template Expressions');
|
|
});
|
|
|
|
it('should display Current customer: Maria', () => {
|
|
expect(element.all(by.css('h3')).get(0).getText()).toBe(`Current customer: Maria`);
|
|
});
|
|
|
|
it('should display The sum of 1 + 1 is not 4.', () => {
|
|
expect(element.all(by.css('p:last-child')).get(0).getText()).toBe(`The sum of 1 + 1 is not 4.`);
|
|
});
|
|
|
|
it('should display Expression Context', () => {
|
|
expect(element.all(by.css('h2')).get(1).getText()).toBe(`Expression Context`);
|
|
});
|
|
|
|
it('should display a list of customers', () => {
|
|
expect(element.all(by.css('li')).get(0).getText()).toBe(`Maria`);
|
|
});
|
|
|
|
it('should display two pictures', () => {
|
|
let pottedPlant = element.all(by.css('img')).get(0);
|
|
let lamp = element.all(by.css('img')).get(1);
|
|
|
|
expect(pottedPlant.getAttribute('src')).toContain('potted-plant');
|
|
expect(pottedPlant.isDisplayed()).toBe(true);
|
|
|
|
expect(lamp.getAttribute('src')).toContain('lamp');
|
|
expect(lamp.isDisplayed()).toBe(true);
|
|
});
|
|
|
|
it('should support user input', () => {
|
|
let input = element(by.css('input'));
|
|
let label = element(by.css('label'));
|
|
expect(label.getText()).toEqual('Type something:');
|
|
input.sendKeys('abc');
|
|
expect(label.getText()).toEqual('Type something: abc');
|
|
});
|
|
});
|