Skip to content

Commit afb0ee3

Browse files
devversionjelbourn
authored andcommitted
chore: remove screenshot testing (#12155)
Removes the screenshot test tool since Angular Material is visually being tested inside of Google.
1 parent dc0732b commit afb0ee3

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

70 files changed

+3
-12924
lines changed

.gitignore

-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
/dist
55
/tmp
66
/deploy
7-
/screenshots
87
/bazel-out
98

109
# Example module file will be auto-generated.

.travis.yml

-2
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,6 @@ jobs:
4040
if: type = push
4141
- env: "DEPLOY_MODE=docs-content"
4242
if: type = push
43-
- env: "DEPLOY_MODE=screenshot-tool"
44-
if: type = cron
4543
- env: "DEPLOY_MODE=dashboard"
4644
if: type = cron
4745
# Closure Compiler CI check is temporarily disabled until a new version of

DEV_ENVIRONMENT.md

-3
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,3 @@ To run lint, run `gulp lint`.
2424

2525
### Running benchmarks
2626
Not yet implemented.
27-
28-
### Running screenshot diff tests
29-
Not yet implemented.

e2e/components/block-scroll-strategy-e2e.spec.ts

-13
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import {browser, Key, element, by} from 'protractor';
2-
import {screenshot} from '../screenshot';
32
import {getScrollPosition} from '../util/index';
43

54

@@ -18,8 +17,6 @@ describe('scroll blocking', () => {
1817
clickOn('disable');
1918
scrollPage(0, 300);
2019
expect((await getScrollPosition()).y).toBe(300, 'Exected page to be scrollable again.');
21-
22-
screenshot();
2320
});
2421

2522
it('should not be able to scroll programmatically along the y axis', async () => {
@@ -33,8 +30,6 @@ describe('scroll blocking', () => {
3330
clickOn('disable');
3431
scrollPage(300, 0);
3532
expect((await getScrollPosition()).x).toBe(300, 'Exected page to be scrollable again.');
36-
37-
screenshot();
3833
});
3934

4035
it('should not be able to scroll via the keyboard along the y axis', async () => {
@@ -55,8 +50,6 @@ describe('scroll blocking', () => {
5550
await body.sendKeys(Key.ARROW_DOWN);
5651
expect((await getScrollPosition()).y)
5752
.toBeGreaterThan(100, 'Expected the page to be scrollable again.');
58-
59-
screenshot();
6053
});
6154

6255
it('should not be able to scroll via the keyboard along the x axis', async () => {
@@ -77,8 +70,6 @@ describe('scroll blocking', () => {
7770
await body.sendKeys(Key.ARROW_RIGHT);
7871
expect((await getScrollPosition()).x)
7972
.toBeGreaterThan(100, 'Expected the page to be scrollable again.');
80-
81-
screenshot();
8273
});
8374

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

10190
it('should not be able to scroll the page after reaching the end of an element along the x axis',
@@ -111,8 +100,6 @@ describe('scroll blocking', () => {
111100
scroller.sendKeys(Key.ARROW_RIGHT);
112101
scroller.sendKeys(Key.ARROW_RIGHT);
113102
expect((await getScrollPosition()).x).toBe(100, 'Expected the page not to have scrolled.');
114-
115-
screenshot();
116103
});
117104
});
118105

e2e/components/button-e2e.spec.ts

-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
import {browser, by, element, ExpectedConditions} from 'protractor';
2-
import {screenshot} from '../screenshot';
3-
42

53
describe('button', () => {
64
describe('disabling behavior', () => {
@@ -12,15 +10,13 @@ describe('button', () => {
1210

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

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

2118
await browser.wait(ExpectedConditions.not(
2219
ExpectedConditions.presenceOf(element(by.css('div.mat-ripple-element')))));
23-
screenshot('click disabled');
2420
});
2521
});
2622
});
-2
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
11
import {browser, by, element} from 'protractor';
2-
import {screenshot} from '../screenshot';
32

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

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

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

1311
});

e2e/components/card-e2e.spec.ts

-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import {browser, by, element} from 'protractor';
2-
import {screenshot} from '../screenshot';
32

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

@@ -8,8 +7,6 @@ describe('mat-card', () => {
87
it('should show a card', async () => {
98
const card = element(by.tagName('mat-card'));
109
expect(card).toBeDefined();
11-
12-
screenshot('fancy card example');
1310
});
1411

1512
});

e2e/components/checkbox-e2e.spec.ts

-5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
import {browser, by, element, Key, ExpectedConditions} from 'protractor';
2-
import {screenshot} from '../screenshot';
3-
42

53
describe('checkbox', () => {
64

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

14-
screenshot('start');
1512
checkboxEl.click();
1613

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

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

2420
checkboxEl.click();
2521

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

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

3429
it('should toggle the checkbox when pressing space', () => {

e2e/components/dialog-e2e.spec.ts

-3
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,13 @@ import {
66
clickElementAtPoint,
77
waitForElement,
88
} from '../util/index';
9-
import {screenshot} from '../screenshot';
10-
119

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

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

2118
it('should open a template dialog', () => {

e2e/components/expansion-e2e.spec.ts

-3
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,15 @@
11
import {browser, by, element} from 'protractor';
2-
import {screenshot} from '../screenshot';
32

43
describe('expansion', () => {
54

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

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

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

1815
it('should hide contents of the expansion panel on click', async () => {

e2e/components/grid-list-e2e.spec.ts

-2
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
11
import {browser} from 'protractor';
22
import {expectToExist} from '../util/index';
3-
import {screenshot} from '../screenshot';
43

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

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

1311
it('should render list items inside the grid list container', () => {

e2e/components/input-e2e.spec.ts

-10
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,4 @@
11
import {browser, by, element} from 'protractor';
2-
import {screenshot} from '../screenshot';
3-
4-
5-
function blurAndScreenshot(msg: string) {
6-
browser.executeScript(`document.activeElement && document.activeElement.blur();`);
7-
screenshot(msg);
8-
}
9-
102

113
describe('input', () => {
124
describe('text input', () => {
@@ -67,7 +59,6 @@ describe('input', () => {
6759
it('should resize correctly', () => {
6860
let input = element(by.id('autosize-text-area'));
6961
input.sendKeys('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa');
70-
blurAndScreenshot('autosize multiple rows');
7162
});
7263

7364
it('should enfore max rows', () => {
@@ -77,7 +68,6 @@ describe('input', () => {
7768
'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
7869
'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +
7970
'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa');
80-
blurAndScreenshot('autosize more than max rows');
8171
});
8272
});
8373
});

e2e/components/list-e2e.spec.ts

-2
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
11
import {browser} from 'protractor';
22
import {expectToExist} from '../util/index';
3-
import {screenshot} from '../screenshot';
43

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

87
it('should render a list container', () => {
98
expectToExist('mat-list');
10-
screenshot();
119
});
1210

1311
it('should render list items inside the list container', () => {

e2e/components/menu-e2e.spec.ts

-6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import {Key, protractor, browser, by, element, ExpectedConditions} from 'protractor';
2-
import {screenshot} from '../screenshot';
32
import {
43
expectToExist,
54
expectAlignedWith,
@@ -24,33 +23,28 @@ describe('menu', () => {
2423

2524
expectToExist(menuSelector);
2625
expect(await page.menu().getText()).toEqual('One\nTwo\nThree\nFour');
27-
screenshot();
2826
});
2927

3028
it('should close menu when menu item is clicked', () => {
3129
page.trigger().click();
3230
page.items(0).click();
3331
expectToExist(menuSelector, false);
34-
screenshot();
3532
});
3633

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

4339
page.trigger().click();
4440
page.items(1).click();
4541
expect(await page.getResultText()).toEqual('two');
46-
screenshot('two');
4742
});
4843

4944
it('should run not run click handlers on disabled menu items', async () => {
5045
page.trigger().click();
5146
page.items(2).click();
5247
expect(await page.getResultText()).toEqual('');
53-
screenshot();
5448
});
5549

5650
it('should support multiple triggers opening the same menu', async () => {

e2e/components/radio-e2e.spec.ts

-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import {browser, by, element, ExpectedConditions} from 'protractor';
2-
import {screenshot} from '../screenshot';
32

43

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

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

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

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

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

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

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

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

4944
expect(element(by.css('input[id=leaf-input]')).getAttribute('disabled')).toBeTruthy();
5045
});

e2e/components/slide-toggle-e2e.spec.ts

-6
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import {browser, element, by, Key, ExpectedConditions} from 'protractor';
22
import {expectToExist} from '../util/index';
3-
import {screenshot} from '../screenshot';
43

54

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

1211
it('should render a slide-toggle', () => {
1312
expectToExist('mat-slide-toggle');
14-
screenshot();
1513
});
1614

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

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

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

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

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

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

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

0 commit comments

Comments
 (0)