mirror of
https://github.com/angular/angular
synced 2026-05-24 09:28:37 +00:00
This commit disables the Selenium Promise Manager when running e2e tests for docs examples in order to more closely align them with new apps created with CLI v11. This change requires that any async operations in tests are handled explicitly (e.g. using `async/await` or `Promise#then()`). PR Close #39818
28 lines
1 KiB
TypeScript
28 lines
1 KiB
TypeScript
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);
|
|
});
|
|
});
|