Skip to content
This repository was archived by the owner on Apr 17, 2024. It is now read-only.

Commit 2caa90f

Browse files
authored
Feature: carbon-and-layout (#3)
* wip * add pages * fix lint * update shell * add e2e tests * speed up circle ci * update circle ci
1 parent d6484d6 commit 2caa90f

File tree

76 files changed

+2273
-1012
lines changed

Some content is hidden

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

76 files changed

+2273
-1012
lines changed

.circleci/config.yml

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
- v2-dependencies-
1313
- run:
1414
name: Install local dependencies
15-
command: npm clean-install
15+
command: npm install
1616
- save_cache:
1717
key: v2-dependencies-{{ .Branch }}-{{ checksum "package-lock.json" }}
1818
paths:
@@ -62,17 +62,20 @@ jobs:
6262
- v3-dependencies-
6363
- run:
6464
name: Install local dependencies
65-
command: npm clean-install
65+
command: npm install
6666
- save_cache:
6767
key: v3-dependencies-{{ .Branch }}-{{ checksum "package-lock.json" }}
6868
paths:
6969
- node_modules
7070
- run:
7171
name: Testing
72-
command: npm run test -- --no-watch --no-progress --browsers=ChromeHeadlessCI --reporters=junit
72+
command: npm run test -- --no-watch --no-progress --browsers=ChromeHeadlessCI --reporters=junit,coverage
7373
- store_test_results:
7474
name: Store test results
7575
path: ~/project/reports
76+
- store_artifacts:
77+
name: Store covarage report
78+
path: ~/project/coverage/bss-web
7679
e2e:
7780
working_directory: ~/project
7881
docker:
@@ -85,7 +88,7 @@ jobs:
8588
- v5-dependencies-
8689
- run:
8790
name: Install dependencies
88-
command: npm clean-install
91+
command: npm install
8992
- save_cache:
9093
key: v5-dependencies-{{ .Branch }}-{{ checksum "package-lock.json" }}
9194
paths:
@@ -105,7 +108,7 @@ jobs:
105108
path: ~/project/e2e/playwright-report
106109
workflows:
107110
version: 2
108-
build_and_test_and_lint:
111+
all:
109112
jobs:
110113
- lint
111114
- build

.prettierrc.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1-
{}
1+
{
2+
"printWidth": 120
3+
}

e2e/playwright.ci.config.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,7 @@ const config: PlaywrightTestConfig = {
55
use: {
66
baseURL: 'http://frontend:4000',
77
},
8-
reporter: [
9-
['dot'],
10-
['html', { open: 'never' }],
11-
['junit', { outputFile: 'reports/results.xml' }],
12-
],
8+
reporter: [['dot'], ['html', { open: 'never' }], ['junit', { outputFile: 'reports/results.xml' }]],
139
projects: defaultConfig.projects,
1410
};
1511
export default config;

e2e/playwright.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ const config: PlaywrightTestConfig = {
55
command: 'npm run build:ssr && npm run serve:ssr',
66
cwd: '../',
77
port: 4000,
8-
timeout: 2 * 60 * 1000,
8+
timeout: 4 * 60 * 1000,
99
reuseExistingServer: true,
1010
},
1111
use: {

e2e/pom/about-us-page.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import { DefaultShell } from './default-shell';
2+
import { Page } from '@playwright/test';
3+
4+
export class AboutUsPage extends DefaultShell {
5+
constructor(page: Page) {
6+
super(page);
7+
}
8+
}

e2e/pom/contact-page.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import { DefaultShell } from './default-shell';
2+
import { Page } from '@playwright/test';
3+
4+
export class ContactPage extends DefaultShell {
5+
constructor(page: Page) {
6+
super(page);
7+
}
8+
}

e2e/pom/courses-page.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import { DefaultShell } from './default-shell';
2+
import { Page } from '@playwright/test';
3+
4+
export class CoursesPage extends DefaultShell {
5+
constructor(page: Page) {
6+
super(page);
7+
}
8+
}

e2e/pom/default-shell.ts

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import { Page } from '@playwright/test';
2+
3+
export enum Destination {
4+
HOMEPAGE = 'homepage',
5+
VIDEO = 'video',
6+
EVENTS = 'events',
7+
LIVE = 'live',
8+
COURSES = 'courses',
9+
ABOUT_US = 'about-us',
10+
MEMBERS = 'members',
11+
CONTACT = 'contact',
12+
}
13+
14+
export class DefaultShell {
15+
readonly page: Page;
16+
17+
constructor(page: Page) {
18+
this.page = page;
19+
}
20+
}

e2e/pom/events-page.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import { DefaultShell } from './default-shell';
2+
import { Page } from '@playwright/test';
3+
4+
export class EventsPage extends DefaultShell {
5+
constructor(page: Page) {
6+
super(page);
7+
}
8+
}

e2e/pom/home-page.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import { Locator, Page } from '@playwright/test';
2+
import { DefaultShell } from './default-shell';
3+
4+
export class HomePage extends DefaultShell {
5+
readonly title: Locator;
6+
7+
constructor(page: Page) {
8+
super(page);
9+
this.title = page.locator('h1');
10+
}
11+
12+
goTo() {
13+
return this.page.goto('/');
14+
}
15+
}

0 commit comments

Comments
 (0)