forked from angular/angular
-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.e2e-spec.ts
28 lines (20 loc) · 1 KB
/
app.e2e-spec.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import { browser, element, by } from 'protractor';
describe('Attribute directives', () => {
const title = 'My First Attribute Directive';
beforeAll(() => browser.get(''));
it(`should display correct title: ${title}`, async () => {
expect(await element(by.css('h1')).getText()).toEqual(title);
});
it('should be able to select green highlight', async () => {
const highlightedEle = element(by.cssContainingText('p', 'Highlight me!'));
const lightGreen = 'rgba(144, 238, 144, 1)';
const getBgColor = () => highlightedEle.getCssValue('background-color');
expect(await highlightedEle.getCssValue('background-color')).not.toEqual(lightGreen);
const greenRb = element.all(by.css('input')).get(0);
await greenRb.click();
await browser.actions().mouseMove(highlightedEle).perform();
// Wait for up to 4s for the background color to be updated,
// to account for slow environments (e.g. CI).
await browser.wait(async () => await getBgColor() === lightGreen, 4000);
});
});