Skip to content

Commit e7b8351

Browse files
committed
test(progress-bar): add basic e2e tests
Adds basic e2e tests that assert that the different progress bars are being rendered. Referencing #559.
1 parent 4331b27 commit e7b8351

File tree

7 files changed

+50
-2
lines changed

7 files changed

+50
-2
lines changed
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
describe('progress-bar', () => {
2+
beforeEach(() => browser.get('/progress-bar'));
3+
4+
it('should render a determinate progress bar', () => {
5+
shouldExist('md-progress-bar[mode="determinate"]');
6+
});
7+
8+
it('should render a buffer progress bar', () => {
9+
shouldExist('md-progress-bar[mode="buffer"]');
10+
});
11+
12+
it('should render a query progress bar', () => {
13+
shouldExist('md-progress-bar[mode="query"]');
14+
});
15+
16+
it('should render a indeterminate progress bar', () => {
17+
shouldExist('md-progress-bar[mode="indeterminate"]');
18+
});
19+
20+
function shouldExist(selector: string): void {
21+
expect(element(by.css(selector)).isPresent()).toBe(true);
22+
}
23+
});

src/e2e-app/e2e-app-module.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import {BasicTabs} from './tabs/tabs-e2e';
1111
import {DialogE2E, TestDialog} from './dialog/dialog-e2e';
1212
import {GridListE2E} from './grid-list/grid-list-e2e';
1313
import {ListE2E} from './list/list-e2e';
14+
import {ProgressBarE2E} from './progress-bar/progress-bar-e2e';
1415
import {MaterialModule} from '@angular/material';
1516
import {E2E_APP_ROUTES} from './e2e-app/routes';
1617

@@ -34,6 +35,7 @@ import {E2E_APP_ROUTES} from './e2e-app/routes';
3435
TestDialog,
3536
GridListE2E,
3637
ListE2E,
38+
ProgressBarE2E,
3739
],
3840
bootstrap: [E2EApp],
3941
providers: [

src/e2e-app/e2e-app/e2e-app.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
<a md-list-item [routerLink]="['icon']">Icon</a>
66
<a md-list-item [routerLink]="['list']">List</a>
77
<a md-list-item [routerLink]="['menu']">Menu</a>
8+
<a md-list-item [routerLink]="['progress-bar']">Progress bar</a>
89
<a md-list-item [routerLink]="['radio']">Radios</a>
910
<a md-list-item [routerLink]="['tabs']">Tabs</a>
1011

src/e2e-app/e2e-app/routes.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import {SimpleCheckboxes} from '../checkbox/checkbox-e2e';
99
import {DialogE2E} from '../dialog/dialog-e2e';
1010
import {GridListE2E} from '../grid-list/grid-list-e2e';
1111
import {ListE2E} from '../list/list-e2e';
12+
import {ProgressBarE2E} from '../progress-bar/progress-bar-e2e';
1213

1314
export const E2E_APP_ROUTES: Routes = [
1415
{path: '', component: Home},
@@ -21,4 +22,5 @@ export const E2E_APP_ROUTES: Routes = [
2122
{path: 'dialog', component: DialogE2E},
2223
{path: 'grid-list', component: GridListE2E},
2324
{path: 'list', component: ListE2E},
25+
{path: 'progress-bar', component: ProgressBarE2E},
2426
];

src/e2e-app/menu/menu-e2e.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,7 @@ import {Component} from '@angular/core';
1212
}
1313
1414
.bottom-row {
15-
position: absolute;
16-
top: 200px;
15+
margin-top: 5px;
1716
}
1817
`]
1918
})
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<md-progress-bar mode="determinate" [value]="determinateValue"></md-progress-bar>
2+
<md-progress-bar mode="buffer" [value]="bufferValue"></md-progress-bar>
3+
<md-progress-bar mode="query"></md-progress-bar>
4+
<md-progress-bar mode="indeterminate"></md-progress-bar>
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import {Component} from '@angular/core';
2+
3+
4+
@Component({
5+
moduleId: module.id,
6+
selector: 'progress-bar-e2e',
7+
templateUrl: 'progress-bar-e2e.html',
8+
styles: [`
9+
md-progress-bar {
10+
margin-bottom: 10px;
11+
}
12+
`]
13+
})
14+
export class ProgressBarE2E {
15+
determinateValue: number = 57;
16+
bufferValue: number = 35;
17+
}

0 commit comments

Comments
 (0)