Patrice Chalin a6478bcc9d docs(attribute-directives): minor updates incl. e2e fix (#3330)
- Prose: copyedits, including fix to misnamed directive class
(`MyHighlightDirective` --> `HighlightDirective`).
- E2E update to avoid warning of multiple matching elements.
- Code: remove obsolete template region.
- Remove obsolete Jade blocks (no longer required by Dart).
- Replace old Jade syntax with plain markdown.
- Remove a few unnecessary `:marked`.
2017-03-07 10:23:18 -08:00

32 lines
1.0 KiB
TypeScript

'use strict'; // necessary for es6 output in node
import { browser, element, by } from 'protractor';
describe('Attribute directives', function () {
let _title = 'My First Attribute Directive';
beforeAll(function () {
browser.get('');
});
it(`should display correct title: ${_title}`, function () {
expect(element(by.css('h1')).getText()).toEqual(_title);
});
it('should be able to select green highlight', function () {
let highlightedEle = element(by.cssContainingText('p', 'Highlight me!'));
let lightGreen = 'rgba(144, 238, 144, 1)';
expect(highlightedEle.getCssValue('background-color')).not.toEqual(lightGreen);
// let greenRb = element(by.cssContainingText('input', 'Green'));
let greenRb = element.all(by.css('input')).get(0);
greenRb.click().then(function() {
// TypeScript Todo: find the right type for highlightedEle
browser.actions().mouseMove(highlightedEle as any).perform();
expect(highlightedEle.getCssValue('background-color')).toEqual(lightGreen);
});
});
});