Skip to content

Commit c5fb8dc

Browse files
YevheniiaMazurvalorkin
authored andcommitted
feat(tests): covering navigation feature with bdd (#3026)
1 parent 8761038 commit c5fb8dc

31 files changed

+514
-2
lines changed

.travis.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ stages:
2525
name: lint
2626
- <<: *stage
2727
name: test
28+
- <<: *stage
29+
name: bdd-tests
2830
- <<: *stage
2931
name: build
3032
- name: deploy
@@ -85,6 +87,17 @@ jobs:
8587
- <<: *test
8688
env: NGV=next
8789

90+
# test e2e-bdd
91+
- stage: bdd-tests
92+
before_script:
93+
- npm run build:dynamic
94+
- node ./demo/dist/server.js &
95+
- sleep 3
96+
script:
97+
- npm run lint-bdd
98+
- webdriver-manager update --standalone
99+
- protractor ./protractor.cucumber.js
100+
88101
# check prod build
89102
- &build
90103
stage: build
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
Feature: Page navigation
2+
Description: User should navigate thru pages by navigation buttons and menus
3+
4+
Scenario: Navigation from Landing page to Getting started page
5+
Description: User should navigate to Getting started page by clicking on Getting Started button on Landing page
6+
7+
Given I am on the Landing page
8+
When I click on Get Started button
9+
Then I am redirected to Getting Started page
10+
And I see Angular icon
11+
12+
Scenario: Navigation from Landing page to GitHub
13+
Description: Github button on Landing page should be clickable and contain link to ngx-bootstrap repo
14+
15+
Given I am on the Landing page
16+
When I can click on GitHub button
17+
Then It links to ngx-bootstrap repository
18+
19+
Scenario Outline: Navigation to Accordion page using left side menu
20+
Description: User should navigate thru component pages by clicking on links in left navigation menu
21+
22+
Given I am on the Getting Started page
23+
When I click on "<linkName>" link in left navigation menu
24+
Then I am redirected to <pageName> page
25+
And I see <contentName> demo content
26+
27+
Examples:
28+
|linkName |pageName |contentName|
29+
|Accordion |Accordion |Accordion |
30+
|Alerts |Alerts |Alerts |
31+
|Buttons |Buttons |Buttons |
32+
|Carousel |Carousel |Carousel |
33+
|Collapse |Collapse |Collapse |
34+
|Datepicker |Datepicker |Datepicker |
35+
|Dropdowns |Dropdowns |Dropdowns |
36+
|Modals |Modals |Modals |
37+
|Pagination |Pagination |Pagination |
38+
|Popover |Popover |Popover |
39+
|Progressbar|Progressbar|Progressbar|
40+
|Rating |Rating |Rating |
41+
|Sortable |Sortable |Sortable |
42+
|Tabs |Tabs |Tabs |
43+
|Timepicker |Timepicker |Timepicker |
44+
|Tooltip |Tooltip |Tooltip |
45+
|Typeahead |Typeahead |Typeahead |

demo/e2e-bdd/pages/accordion.po.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import { $, ElementFinder } from 'protractor';
2+
3+
import { BasePo } from '../shared/pages/basePage.po';
4+
5+
export class AccordionPo extends BasePo {
6+
templateUrl = 'accordion';
7+
contentTitle: ElementFinder = $('.content-header');
8+
pageContent: ElementFinder = $('.content-box');
9+
}

demo/e2e-bdd/pages/alert.po.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import { $, ElementFinder } from 'protractor';
2+
3+
import { BasePo } from '../shared/pages/basePage.po';
4+
5+
export class AlertPo extends BasePo {
6+
templateUrl = 'alerts';
7+
contentTitle: ElementFinder = $('.content-header');
8+
pageContent: ElementFinder = $('.content-box');
9+
}

demo/e2e-bdd/pages/buttons.po.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import { $, ElementFinder } from 'protractor';
2+
3+
import { BasePo } from '../shared/pages/basePage.po';
4+
5+
export class ButtonsPo extends BasePo {
6+
templateUrl = 'buttons';
7+
contentTitle: ElementFinder = $('.content-header');
8+
pageContent: ElementFinder = $('.content-box');
9+
}

demo/e2e-bdd/pages/carousel.po.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import { $, ElementFinder } from 'protractor';
2+
3+
import { BasePo } from '../shared/pages/basePage.po';
4+
5+
export class CarouselPo extends BasePo {
6+
templateUrl = 'carousel';
7+
contentTitle: ElementFinder = $('.content-header');
8+
pageContent: ElementFinder = $('.content-box');
9+
}

demo/e2e-bdd/pages/collapse.po.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import { $, ElementFinder } from 'protractor';
2+
3+
import { BasePo } from '../shared/pages/basePage.po';
4+
5+
export class CollapsePo extends BasePo {
6+
templateUrl = 'collapse';
7+
contentTitle: ElementFinder = $('.content-header');
8+
pageContent: ElementFinder = $('.content-box');
9+
}

demo/e2e-bdd/pages/datepicker.po.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import { $, ElementFinder } from 'protractor';
2+
3+
import { BasePo } from '../shared/pages/basePage.po';
4+
5+
export class DatepickerPo extends BasePo {
6+
templateUrl = 'datepicker';
7+
contentTitle: ElementFinder = $('.content-header');
8+
pageContent: ElementFinder = $('.content-box');
9+
}

demo/e2e-bdd/pages/dropdowns.po.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import { $, ElementFinder } from 'protractor';
2+
3+
import { BasePo } from '../shared/pages/basePage.po';
4+
5+
export class DropdownsPo extends BasePo {
6+
templateUrl = 'dropdowns';
7+
contentTitle: ElementFinder = $('.content-header');
8+
pageContent: ElementFinder = $('.content-box');
9+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import { $, ElementFinder } from 'protractor';
2+
3+
import { BasePo } from '../shared/pages/basePage.po';
4+
5+
export class GettingStartedPo extends BasePo {
6+
templateUrl = 'getting-started';
7+
angularLogo: ElementFinder = $('[alt*="angular logo"]');
8+
contentTitle: ElementFinder = $('.content h1');
9+
}

0 commit comments

Comments
 (0)