fix e2e specs

This commit is contained in:
Foxandxss 2016-06-14 04:11:52 +02:00 committed by Naomi Black
parent bead3620df
commit c0edf369f4

View File

@ -37,10 +37,12 @@ describe('Animation Tests', () => {
expect(li.getCssValue('backgroundColor')).toBe(INACTIVE_COLOR); expect(li.getCssValue('backgroundColor')).toBe(INACTIVE_COLOR);
li.click(); li.click();
browser.driver.sleep(300);
expect(getScaleX(li)).toBe(1.1); expect(getScaleX(li)).toBe(1.1);
expect(li.getCssValue('backgroundColor')).toBe(ACTIVE_COLOR); expect(li.getCssValue('backgroundColor')).toBe(ACTIVE_COLOR);
li.click(); li.click();
browser.driver.sleep(300);
expect(getScaleX(li)).toBe(1.0); expect(getScaleX(li)).toBe(1.0);
expect(li.getCssValue('backgroundColor')).toBe(INACTIVE_COLOR); expect(li.getCssValue('backgroundColor')).toBe(INACTIVE_COLOR);
}); });
@ -49,7 +51,7 @@ describe('Animation Tests', () => {
describe('styles inline in transitions', () => { describe('styles inline in transitions', () => {
var host: protractor.ElementFinder; let host: protractor.ElementFinder;
beforeEach(function() { beforeEach(function() {
host = element(by.css('hero-list-inline-styles')); host = element(by.css('hero-list-inline-styles'));
@ -58,9 +60,10 @@ describe('Animation Tests', () => {
it('are not kept after animation', () => { it('are not kept after animation', () => {
addHero(); addHero();
var li = host.element(by.css('li')); let li = host.element(by.css('li'));
li.click(); li.click();
browser.driver.sleep(300);
expect(getScaleX(li)).toBe(1.0); expect(getScaleX(li)).toBe(1.0);
expect(li.getCssValue('backgroundColor')).toBe(INACTIVE_COLOR); expect(li.getCssValue('backgroundColor')).toBe(INACTIVE_COLOR);
}); });
@ -84,10 +87,12 @@ describe('Animation Tests', () => {
expect(li.getCssValue('backgroundColor')).toBe(INACTIVE_COLOR); expect(li.getCssValue('backgroundColor')).toBe(INACTIVE_COLOR);
li.click(); li.click();
browser.driver.sleep(300);
expect(getScaleX(li)).toBe(1.1); expect(getScaleX(li)).toBe(1.1);
expect(li.getCssValue('backgroundColor')).toBe(ACTIVE_COLOR); expect(li.getCssValue('backgroundColor')).toBe(ACTIVE_COLOR);
li.click(); li.click();
browser.driver.sleep(300);
expect(getScaleX(li)).toBe(1.0); expect(getScaleX(li)).toBe(1.0);
expect(li.getCssValue('backgroundColor')).toBe(INACTIVE_COLOR); expect(li.getCssValue('backgroundColor')).toBe(INACTIVE_COLOR);
}); });
@ -111,10 +116,12 @@ describe('Animation Tests', () => {
expect(li.getCssValue('backgroundColor')).toBe(INACTIVE_COLOR); expect(li.getCssValue('backgroundColor')).toBe(INACTIVE_COLOR);
li.click(); li.click();
browser.driver.sleep(300);
expect(getScaleX(li)).toBe(1.1); expect(getScaleX(li)).toBe(1.1);
expect(li.getCssValue('backgroundColor')).toBe(ACTIVE_COLOR); expect(li.getCssValue('backgroundColor')).toBe(ACTIVE_COLOR);
li.click(); li.click();
browser.driver.sleep(300);
expect(getScaleX(li)).toBe(1.0); expect(getScaleX(li)).toBe(1.0);
expect(li.getCssValue('backgroundColor')).toBe(INACTIVE_COLOR); expect(li.getCssValue('backgroundColor')).toBe(INACTIVE_COLOR);
}); });
@ -157,9 +164,11 @@ describe('Animation Tests', () => {
expect(li.getCssValue('transform')).toMatch(NO_TRANSFORM_MATRIX_REGEX); expect(li.getCssValue('transform')).toMatch(NO_TRANSFORM_MATRIX_REGEX);
li.click(); li.click();
browser.driver.sleep(300);
expect(getScaleX(li)).toBe(1.1); expect(getScaleX(li)).toBe(1.1);
li.click(); li.click();
browser.driver.sleep(300);
expect(li.getCssValue('transform')).toMatch(NO_TRANSFORM_MATRIX_REGEX); expect(li.getCssValue('transform')).toMatch(NO_TRANSFORM_MATRIX_REGEX);
removeHero(); removeHero();
@ -232,7 +241,7 @@ describe('Animation Tests', () => {
describe('parallel groups', () => { describe('parallel groups', () => {
var host: protractor.ElementFinder; let host: protractor.ElementFinder;
beforeEach(() => { beforeEach(() => {
host = element(by.css('hero-list-groups')); host = element(by.css('hero-list-groups'));
@ -253,10 +262,12 @@ describe('Animation Tests', () => {
function addHero() { function addHero() {
element(by.buttonText('Add hero')).click(); element(by.buttonText('Add hero')).click();
browser.driver.sleep(500);
} }
function removeHero() { function removeHero() {
element(by.buttonText('Remove hero')).click(); element(by.buttonText('Remove hero')).click();
browser.driver.sleep(500);
} }
function getScaleX(el: protractor.ElementFinder) { function getScaleX(el: protractor.ElementFinder) {