Skip to content

Commit 18b5a6f

Browse files
tests: migrate buttons page tests (#6593)
* Migrate buttons page tests * Add method for getting page tab selector + fix artifacts naming
1 parent e2958bf commit 18b5a6f

File tree

12 files changed

+458
-286
lines changed

12 files changed

+458
-286
lines changed

.github/workflows/on-push-or-pull.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -154,8 +154,8 @@ jobs:
154154
- uses: actions/upload-artifact@v3
155155
if: always()
156156
with:
157-
name: playwright-report-${{ matrix.shard }}_${{ strategy.job-total }}
158-
path: playwright-report
157+
name: playwright-report-smoke-${{ matrix.shard }}_${{ strategy.job-total }}
158+
path: apps/ngx-bootstrap-docs-e2e/playwright-report
159159
retention-days: 30
160160

161161
e2e_full:
@@ -196,6 +196,6 @@ jobs:
196196
- uses: actions/upload-artifact@v3
197197
if: always()
198198
with:
199-
name: playwright-report-${{ matrix.shard }}_${{ strategy.job-total }}
200-
path: playwright-report
199+
name: playwright-report-full-${{ matrix.shard }}_${{ strategy.job-total }}
200+
path: apps/ngx-bootstrap-docs-e2e/playwright-report
201201
retention-days: 30

apps/ngx-bootstrap-docs-e2e/src/full/accordion_page.spec.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,10 @@ const test = base.extend<{ accordionPo: AccordionPo }>({
99
});
1010

1111
test.describe('Accordion page testing suite', () => {
12-
let tabName: string;
1312
let tabSelector: string;
1413

1514
test.beforeEach(async ({ accordionPo }) => {
16-
tabName = 'Overview';
17-
tabSelector = `tab[heading="${tabName}"]`;
15+
tabSelector = accordionPo.getTabSelector('Overview');
1816
await accordionPo.navigateTo();
1917
});
2018

apps/ngx-bootstrap-docs-e2e/src/full/alerts_page.spec.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,10 @@ const test = base.extend<{ alertsPo: AlertsPo }>({
99
});
1010

1111
test.describe('Alerts page testing suite', () => {
12-
let tabName: string;
1312
let tabSelector: string;
1413

1514
test.beforeEach(async ({ alertsPo }) => {
16-
tabName = 'Overview';
17-
tabSelector = `tab[heading="${tabName}"]`;
15+
tabSelector = alertsPo.getTabSelector('Overview');
1816
await alertsPo.navigateTo();
1917
});
2018

apps/ngx-bootstrap-docs-e2e/src/full/buttons_page.spec.ts

Lines changed: 341 additions & 0 deletions
Large diffs are not rendered by default.

apps/ngx-bootstrap-docs-e2e/src/full/buttons_page_spec.ts

Lines changed: 0 additions & 224 deletions
This file was deleted.

apps/ngx-bootstrap-docs-e2e/src/integration/accordion_page.spec.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,10 @@ const test = base.extend<{ accordionPo: AccordionPo }>({
99
});
1010

1111
test.describe('Accordion page testing suite', () => {
12-
let tabName: string;
1312
let tabSelector: string;
1413

1514
test.beforeEach(async ({ accordionPo }) => {
16-
tabName = 'Overview';
17-
tabSelector = `tab[heading="${tabName}"]`;
15+
tabSelector = accordionPo.getTabSelector('Overview');
1816
await accordionPo.navigateTo();
1917
});
2018

apps/ngx-bootstrap-docs-e2e/src/integration/alerts_page.spec.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,10 @@ const test = base.extend<{ alertsPo: AlertsPo }>({
99
});
1010

1111
test.describe('Alerts page testing suite', () => {
12-
let tabName: string;
1312
let tabSelector: string;
1413

1514
test.beforeEach(async ({ alertsPo }) => {
16-
tabName = 'Overview';
17-
tabSelector = `tab[heading="${tabName}"]`;
15+
tabSelector = alertsPo.getTabSelector('Overview');
1816
await alertsPo.navigateTo();
1917
});
2018

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
import { test as base } from '@playwright/test';
2+
import { ButtonsPo } from '../support/buttons.po';
3+
4+
const test = base.extend<{ buttonsPo: ButtonsPo }>({
5+
buttonsPo: async ({ page }, use) => {
6+
const buttonsPo = new ButtonsPo(page);
7+
await use(buttonsPo);
8+
},
9+
});
10+
11+
test.describe('Buttons page testing suite', () => {
12+
let tabSelector: string;
13+
14+
test.beforeEach(async ({ buttonsPo }) => {
15+
tabSelector = buttonsPo.getTabSelector('Overview');
16+
await buttonsPo.navigateTo();
17+
});
18+
19+
test.describe('Basic', () => {
20+
let basicBtn: string;
21+
22+
test.beforeEach(async ({ buttonsPo }) => {
23+
basicBtn = tabSelector + buttonsPo.exampleDemosArr.basic;
24+
});
25+
26+
test('example contains only enabled button with text on it', async ({ buttonsPo }) => {
27+
await buttonsPo.expectBtnVisible(basicBtn, 'button', 'Single Button');
28+
await buttonsPo.expectBtnEnabled(basicBtn, 'Single Button');
29+
await buttonsPo.clickOnBtn(basicBtn);
30+
await buttonsPo.expectBtnTxtEqual(basicBtn, ' Single Button\n');
31+
});
32+
});
33+
});

apps/ngx-bootstrap-docs-e2e/src/integration/buttons_page_spec.ts

Lines changed: 0 additions & 17 deletions
This file was deleted.

0 commit comments

Comments
 (0)