Skip to content

test(progress-bar): add basic e2e tests #1895

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 28, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions e2e/components/progress-bar/progress-bar.e2e.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
describe('progress-bar', () => {
beforeEach(() => browser.get('/progress-bar'));

it('should render a determinate progress bar', () => {
shouldExist('md-progress-bar[mode="determinate"]');
});

it('should render a buffer progress bar', () => {
shouldExist('md-progress-bar[mode="buffer"]');
});

it('should render a query progress bar', () => {
shouldExist('md-progress-bar[mode="query"]');
});

it('should render a indeterminate progress bar', () => {
shouldExist('md-progress-bar[mode="indeterminate"]');
});

function shouldExist(selector: string): void {
expect(element(by.css(selector)).isPresent()).toBe(true);
}
});
2 changes: 2 additions & 0 deletions src/e2e-app/e2e-app-module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import {BasicTabs} from './tabs/tabs-e2e';
import {DialogE2E, TestDialog} from './dialog/dialog-e2e';
import {GridListE2E} from './grid-list/grid-list-e2e';
import {ListE2E} from './list/list-e2e';
import {ProgressBarE2E} from './progress-bar/progress-bar-e2e';
import {MaterialModule} from '@angular/material';
import {E2E_APP_ROUTES} from './e2e-app/routes';

Expand All @@ -34,6 +35,7 @@ import {E2E_APP_ROUTES} from './e2e-app/routes';
TestDialog,
GridListE2E,
ListE2E,
ProgressBarE2E,
],
bootstrap: [E2EApp],
providers: [
Expand Down
1 change: 1 addition & 0 deletions src/e2e-app/e2e-app/e2e-app.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
<a md-list-item [routerLink]="['icon']">Icon</a>
<a md-list-item [routerLink]="['list']">List</a>
<a md-list-item [routerLink]="['menu']">Menu</a>
<a md-list-item [routerLink]="['progress-bar']">Progress bar</a>
<a md-list-item [routerLink]="['radio']">Radios</a>
<a md-list-item [routerLink]="['tabs']">Tabs</a>

Expand Down
2 changes: 2 additions & 0 deletions src/e2e-app/e2e-app/routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import {SimpleCheckboxes} from '../checkbox/checkbox-e2e';
import {DialogE2E} from '../dialog/dialog-e2e';
import {GridListE2E} from '../grid-list/grid-list-e2e';
import {ListE2E} from '../list/list-e2e';
import {ProgressBarE2E} from '../progress-bar/progress-bar-e2e';

export const E2E_APP_ROUTES: Routes = [
{path: '', component: Home},
Expand All @@ -21,4 +22,5 @@ export const E2E_APP_ROUTES: Routes = [
{path: 'dialog', component: DialogE2E},
{path: 'grid-list', component: GridListE2E},
{path: 'list', component: ListE2E},
{path: 'progress-bar', component: ProgressBarE2E},
];
3 changes: 1 addition & 2 deletions src/e2e-app/menu/menu-e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ import {Component} from '@angular/core';
}

.bottom-row {
position: absolute;
top: 200px;
margin-top: 5px;
}
`]
})
Expand Down
4 changes: 4 additions & 0 deletions src/e2e-app/progress-bar/progress-bar-e2e.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<md-progress-bar mode="determinate" [value]="determinateValue"></md-progress-bar>
<md-progress-bar mode="buffer" [value]="bufferValue"></md-progress-bar>
<md-progress-bar mode="query"></md-progress-bar>
<md-progress-bar mode="indeterminate"></md-progress-bar>
17 changes: 17 additions & 0 deletions src/e2e-app/progress-bar/progress-bar-e2e.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import {Component} from '@angular/core';


@Component({
moduleId: module.id,
selector: 'progress-bar-e2e',
templateUrl: 'progress-bar-e2e.html',
styles: [`
md-progress-bar {
margin-bottom: 10px;
}
`]
})
export class ProgressBarE2E {
determinateValue: number = 57;
bufferValue: number = 35;
}