Skip to content

Commit

Permalink
chore: remove screenshot testing (angular#12155)
Browse files Browse the repository at this point in the history
Removes the screenshot test tool since Angular Material is visually being tested inside of Google.
  • Loading branch information
devversion authored and jelbourn committed Jul 11, 2018
1 parent dc0732b commit afb0ee3
Show file tree
Hide file tree
Showing 70 changed files with 3 additions and 12,924 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
/dist
/tmp
/deploy
/screenshots
/bazel-out

# Example module file will be auto-generated.
Expand Down
2 changes: 0 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,6 @@ jobs:
if: type = push
- env: "DEPLOY_MODE=docs-content"
if: type = push
- env: "DEPLOY_MODE=screenshot-tool"
if: type = cron
- env: "DEPLOY_MODE=dashboard"
if: type = cron
# Closure Compiler CI check is temporarily disabled until a new version of
Expand Down
3 changes: 0 additions & 3 deletions DEV_ENVIRONMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,3 @@ To run lint, run `gulp lint`.

### Running benchmarks
Not yet implemented.

### Running screenshot diff tests
Not yet implemented.
13 changes: 0 additions & 13 deletions e2e/components/block-scroll-strategy-e2e.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import {browser, Key, element, by} from 'protractor';
import {screenshot} from '../screenshot';
import {getScrollPosition} from '../util/index';


Expand All @@ -18,8 +17,6 @@ describe('scroll blocking', () => {
clickOn('disable');
scrollPage(0, 300);
expect((await getScrollPosition()).y).toBe(300, 'Exected page to be scrollable again.');

screenshot();
});

it('should not be able to scroll programmatically along the y axis', async () => {
Expand All @@ -33,8 +30,6 @@ describe('scroll blocking', () => {
clickOn('disable');
scrollPage(300, 0);
expect((await getScrollPosition()).x).toBe(300, 'Exected page to be scrollable again.');

screenshot();
});

it('should not be able to scroll via the keyboard along the y axis', async () => {
Expand All @@ -55,8 +50,6 @@ describe('scroll blocking', () => {
await body.sendKeys(Key.ARROW_DOWN);
expect((await getScrollPosition()).y)
.toBeGreaterThan(100, 'Expected the page to be scrollable again.');

screenshot();
});

it('should not be able to scroll via the keyboard along the x axis', async () => {
Expand All @@ -77,8 +70,6 @@ describe('scroll blocking', () => {
await body.sendKeys(Key.ARROW_RIGHT);
expect((await getScrollPosition()).x)
.toBeGreaterThan(100, 'Expected the page to be scrollable again.');

screenshot();
});

it('should not be able to scroll the page after reaching the end of an element along the y axis',
Expand All @@ -94,8 +85,6 @@ describe('scroll blocking', () => {
scroller.sendKeys(Key.ARROW_DOWN);
scroller.sendKeys(Key.ARROW_DOWN);
expect((await getScrollPosition()).y).toBe(100, 'Expected the page not to have scrolled.');

screenshot();
});

it('should not be able to scroll the page after reaching the end of an element along the x axis',
Expand All @@ -111,8 +100,6 @@ describe('scroll blocking', () => {
scroller.sendKeys(Key.ARROW_RIGHT);
scroller.sendKeys(Key.ARROW_RIGHT);
expect((await getScrollPosition()).x).toBe(100, 'Expected the page not to have scrolled.');

screenshot();
});
});

Expand Down
4 changes: 0 additions & 4 deletions e2e/components/button-e2e.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
import {browser, by, element, ExpectedConditions} from 'protractor';
import {screenshot} from '../screenshot';


describe('button', () => {
describe('disabling behavior', () => {
Expand All @@ -12,15 +10,13 @@ describe('button', () => {

await browser.wait(ExpectedConditions.not(
ExpectedConditions.presenceOf(element(by.css('div.mat-ripple-element')))));
screenshot('clicked once');

element(by.id('disable-toggle')).click();
element(by.id('test-button')).click();
expect(await element(by.id('click-counter')).getText()).toEqual('1');

await browser.wait(ExpectedConditions.not(
ExpectedConditions.presenceOf(element(by.css('div.mat-ripple-element')))));
screenshot('click disabled');
});
});
});
2 changes: 0 additions & 2 deletions e2e/components/button-toggle-e2e.spec.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
import {browser, by, element} from 'protractor';
import {screenshot} from '../screenshot';

describe('button-toggle', () => {

beforeEach(() => browser.get('/button-toggle'));

it('should show a button-toggle', async () => {
expect(element(by.tagName('mat-button-toggle'))).toBeDefined();
screenshot();
});

});
3 changes: 0 additions & 3 deletions e2e/components/card-e2e.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import {browser, by, element} from 'protractor';
import {screenshot} from '../screenshot';

describe('mat-card', () => {

Expand All @@ -8,8 +7,6 @@ describe('mat-card', () => {
it('should show a card', async () => {
const card = element(by.tagName('mat-card'));
expect(card).toBeDefined();

screenshot('fancy card example');
});

});
5 changes: 0 additions & 5 deletions e2e/components/checkbox-e2e.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
import {browser, by, element, Key, ExpectedConditions} from 'protractor';
import {screenshot} from '../screenshot';


describe('checkbox', () => {

Expand All @@ -11,15 +9,13 @@ describe('checkbox', () => {
let checkboxEl = element(by.id('test-checkbox'));
let inputEl = element(by.css('input[id=test-checkbox-input]'));

screenshot('start');
checkboxEl.click();

expect(inputEl.getAttribute('checked'))
.toBeTruthy('Expect checkbox "checked" property to be true');

await browser.wait(ExpectedConditions.not(
ExpectedConditions.presenceOf(element(by.css('div.mat-ripple-element')))));
screenshot('checked');

checkboxEl.click();

Expand All @@ -28,7 +24,6 @@ describe('checkbox', () => {

await browser.wait(ExpectedConditions.not(
ExpectedConditions.presenceOf(element(by.css('div.mat-ripple-element')))));
screenshot('unchecked');
});

it('should toggle the checkbox when pressing space', () => {
Expand Down
3 changes: 0 additions & 3 deletions e2e/components/dialog-e2e.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,13 @@ import {
clickElementAtPoint,
waitForElement,
} from '../util/index';
import {screenshot} from '../screenshot';


describe('dialog', () => {
beforeEach(() => browser.get('/dialog'));

it('should open a dialog', () => {
element(by.id('default')).click();
expectToExist('mat-dialog-container');
screenshot('simple dialog opened');
});

it('should open a template dialog', () => {
Expand Down
3 changes: 0 additions & 3 deletions e2e/components/expansion-e2e.spec.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,15 @@
import {browser, by, element} from 'protractor';
import {screenshot} from '../screenshot';

describe('expansion', () => {

beforeEach(() => browser.get('/expansion'));

it('should show an accordion', async () => {
expect(element(by.css('.mat-accordion'))).toBeDefined();
screenshot();
});

it('should show two panels', async () => {
expect(await element.all(by.css('.mat-expansion-panel')).count()).toBe(2);
screenshot();
});

it('should hide contents of the expansion panel on click', async () => {
Expand Down
2 changes: 0 additions & 2 deletions e2e/components/grid-list-e2e.spec.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
import {browser} from 'protractor';
import {expectToExist} from '../util/index';
import {screenshot} from '../screenshot';

describe('grid-list', () => {
beforeEach(() => browser.get('/grid-list'));

it('should render a grid list container', () => {
expectToExist('mat-grid-list');
screenshot();
});

it('should render list items inside the grid list container', () => {
Expand Down
10 changes: 0 additions & 10 deletions e2e/components/input-e2e.spec.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,4 @@
import {browser, by, element} from 'protractor';
import {screenshot} from '../screenshot';


function blurAndScreenshot(msg: string) {
browser.executeScript(`document.activeElement && document.activeElement.blur();`);
screenshot(msg);
}


describe('input', () => {
describe('text input', () => {
Expand Down Expand Up @@ -67,7 +59,6 @@ describe('input', () => {
it('should resize correctly', () => {
let input = element(by.id('autosize-text-area'));
input.sendKeys('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa');
blurAndScreenshot('autosize multiple rows');
});

it('should enfore max rows', () => {
Expand All @@ -77,7 +68,6 @@ describe('input', () => {
'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa');
blurAndScreenshot('autosize more than max rows');
});
});
});
2 changes: 0 additions & 2 deletions e2e/components/list-e2e.spec.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
import {browser} from 'protractor';
import {expectToExist} from '../util/index';
import {screenshot} from '../screenshot';

describe('list', () => {
beforeEach(() => browser.get('/list'));

it('should render a list container', () => {
expectToExist('mat-list');
screenshot();
});

it('should render list items inside the list container', () => {
Expand Down
6 changes: 0 additions & 6 deletions e2e/components/menu-e2e.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import {Key, protractor, browser, by, element, ExpectedConditions} from 'protractor';
import {screenshot} from '../screenshot';
import {
expectToExist,
expectAlignedWith,
Expand All @@ -24,33 +23,28 @@ describe('menu', () => {

expectToExist(menuSelector);
expect(await page.menu().getText()).toEqual('One\nTwo\nThree\nFour');
screenshot();
});

it('should close menu when menu item is clicked', () => {
page.trigger().click();
page.items(0).click();
expectToExist(menuSelector, false);
screenshot();
});

it('should run click handlers on regular menu items', async () => {
page.trigger().click();
page.items(0).click();
expect(await page.getResultText()).toEqual('one');
screenshot('one');

page.trigger().click();
page.items(1).click();
expect(await page.getResultText()).toEqual('two');
screenshot('two');
});

it('should run not run click handlers on disabled menu items', async () => {
page.trigger().click();
page.items(2).click();
expect(await page.getResultText()).toEqual('');
screenshot();
});

it('should support multiple triggers opening the same menu', async () => {
Expand Down
5 changes: 0 additions & 5 deletions e2e/components/radio-e2e.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import {browser, by, element, ExpectedConditions} from 'protractor';
import {screenshot} from '../screenshot';


describe('radio', () => {
Expand All @@ -12,7 +11,6 @@ describe('radio', () => {
expect(element(by.id('water')).getAttribute('class')).toContain('mat-radio-checked');
await browser.wait(ExpectedConditions.not(
ExpectedConditions.presenceOf(element(by.css('div.mat-ripple-element')))));
screenshot('water');

expect(element(by.css('input[id=water-input]')).getAttribute('checked')).toBeTruthy();
expect(element(by.css('input[id=leaf-input]')).getAttribute('checked')).toBeFalsy();
Expand All @@ -22,7 +20,6 @@ describe('radio', () => {

await browser.wait(ExpectedConditions.not(
ExpectedConditions.presenceOf(element(by.css('div.mat-ripple-element')))));
screenshot('leaf');

expect(element(by.css('input[id=leaf-input]')).getAttribute('checked')).toBeTruthy();
expect(element(by.css('input[id=water-input]')).getAttribute('checked')).toBeFalsy();
Expand All @@ -35,7 +32,6 @@ describe('radio', () => {
expect(element(by.id('water')).getAttribute('class')).toContain('mat-radio-disabled');

await browser.wait(ExpectedConditions.presenceOf(element(by.css('.mat-radio-disabled'))));
screenshot('water');

expect(element(by.css('input[id=water-input]')).getAttribute('disabled')).toBeTruthy();

Expand All @@ -44,7 +40,6 @@ describe('radio', () => {

await browser.wait(ExpectedConditions.not(
ExpectedConditions.presenceOf(element(by.css('div.mat-ripple-element')))));
screenshot('leaf');

expect(element(by.css('input[id=leaf-input]')).getAttribute('disabled')).toBeTruthy();
});
Expand Down
6 changes: 0 additions & 6 deletions e2e/components/slide-toggle-e2e.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import {browser, element, by, Key, ExpectedConditions} from 'protractor';
import {expectToExist} from '../util/index';
import {screenshot} from '../screenshot';


describe('slide-toggle', () => {
Expand All @@ -11,7 +10,6 @@ describe('slide-toggle', () => {

it('should render a slide-toggle', () => {
expectToExist('mat-slide-toggle');
screenshot();
});

it('should change the checked state on click', async () => {
Expand All @@ -25,7 +23,6 @@ describe('slide-toggle', () => {

await browser.wait(ExpectedConditions.not(
ExpectedConditions.presenceOf(element(by.css('div.mat-ripple-element')))));
screenshot();
});

it('should change the checked state on click', async () => {
Expand All @@ -38,7 +35,6 @@ describe('slide-toggle', () => {
expect(inputEl.getAttribute('checked')).toBeTruthy('Expect slide-toggle to be checked');
await browser.wait(ExpectedConditions.not(
ExpectedConditions.presenceOf(element(by.css('div.mat-ripple-element')))));
screenshot();
});

it('should not change the checked state on click when disabled', async () => {
Expand All @@ -51,7 +47,6 @@ describe('slide-toggle', () => {
expect(inputEl.getAttribute('checked')).toBeFalsy('Expect slide-toggle to be unchecked');
await browser.wait(ExpectedConditions.not(
ExpectedConditions.presenceOf(element(by.css('div.mat-ripple-element')))));
screenshot();
});

it('should move the thumb on state change', async () => {
Expand All @@ -67,7 +62,6 @@ describe('slide-toggle', () => {

await browser.wait(ExpectedConditions.not(
ExpectedConditions.presenceOf(element(by.css('div.mat-ripple-element')))));
screenshot();
});

it('should toggle the slide-toggle on space key', () => {
Expand Down
Loading

0 comments on commit afb0ee3

Please sign in to comment.