2016-10-06 18:25:52 -04:00
|
|
|
'use strict'; // necessary for es6 output in node
|
|
|
|
|
|
|
|
import { browser, element, by } from 'protractor';
|
|
|
|
|
2015-12-20 16:17:16 -05:00
|
|
|
describe('Attribute directives', function () {
|
|
|
|
|
2016-05-30 14:05:09 -04:00
|
|
|
let _title = 'My First Attribute Directive';
|
2015-12-20 16:17:16 -05:00
|
|
|
|
|
|
|
beforeAll(function () {
|
|
|
|
browser.get('');
|
|
|
|
});
|
|
|
|
|
2016-06-01 12:11:58 -04:00
|
|
|
it(`should display correct title: ${_title}`, function () {
|
2015-12-20 16:17:16 -05:00
|
|
|
expect(element(by.css('h1')).getText()).toEqual(_title);
|
|
|
|
});
|
|
|
|
|
|
|
|
it('should be able to select green highlight', function () {
|
2017-03-07 13:23:18 -05:00
|
|
|
let highlightedEle = element(by.cssContainingText('p', 'Highlight me!'));
|
2016-05-30 14:05:09 -04:00
|
|
|
let lightGreen = 'rgba(144, 238, 144, 1)';
|
2015-12-20 16:17:16 -05:00
|
|
|
|
|
|
|
expect(highlightedEle.getCssValue('background-color')).not.toEqual(lightGreen);
|
2016-05-30 14:05:09 -04:00
|
|
|
// let greenRb = element(by.cssContainingText('input', 'Green'));
|
|
|
|
let greenRb = element.all(by.css('input')).get(0);
|
2015-12-20 16:17:16 -05:00
|
|
|
greenRb.click().then(function() {
|
2016-05-30 14:05:09 -04:00
|
|
|
// TypeScript Todo: find the right type for highlightedEle
|
|
|
|
browser.actions().mouseMove(highlightedEle as any).perform();
|
2015-12-20 16:17:16 -05:00
|
|
|
expect(highlightedEle.getCssValue('background-color')).toEqual(lightGreen);
|
|
|
|
});
|
|
|
|
|
|
|
|
});
|
|
|
|
});
|