Skip to content

Commit 70009af

Browse files
authored
Merge pull request #4 from vOrigins/feature/initial-tests
fix: initial tests stabilization
2 parents 90e486c + 3860d2c commit 70009af

File tree

11 files changed

+117
-57
lines changed

11 files changed

+117
-57
lines changed

.github/workflows/e2e-tests.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: E2E Tests
2+
on:
3+
workflow_dispatch:
4+
inputs:
5+
base-url:
6+
description: 'Base URL'
7+
required: true
8+
cleanup:
9+
description: 'Cleaning up test data'
10+
required: false
11+
default: false
12+
type: boolean
13+
portal-e2e:
14+
description: 'Portal e2e'
15+
required: false
16+
default: true
17+
type: boolean
18+
env-vars:
19+
description: 'Environment variables (format: VAR1=1 VAR2=2)'
20+
env:
21+
BASE_URL: ${{ inputs.base-url }}
22+
TEST_USER_PASSWORD: 12345
23+
jobs:
24+
tests:
25+
timeout-minutes: 80
26+
runs-on: ubuntu-latest
27+
steps:
28+
- uses: actions/checkout@v4
29+
- uses: actions/setup-node@v4
30+
with:
31+
node-version: 22
32+
- name: Install dependencies
33+
run: npm ci
34+
- name: Install Playwright Browsers
35+
run: npx playwright install --with-deps chromium
36+
- name: Run Cleaning up test data
37+
run: ${{ inputs.env-vars }} npx playwright test --project=Cleanup
38+
if: ${{ inputs.cleanup }}
39+
- name: Run Portal e2e tests
40+
run: ${{ inputs.env-vars }} npx playwright test --project=Portal
41+
if: ${{ inputs.portal-e2e && success() }}
42+
- uses: actions/upload-artifact@v4
43+
if: ${{ !cancelled() }}
44+
with:
45+
name: reports
46+
path: reports/
47+
retention-days: 21

package-lock.json

Lines changed: 24 additions & 24 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,16 @@
66
"pw-report": "playwright show-report reports/playwright",
77
"debug": "playwright test --headed --project=Portal --debug",
88
"lint": "eslint . --ext .ts,.tsx,.json --ignore-path .gitignore --max-warnings 0 --report-unused-disable-directives",
9-
"format": "npm run lint -- --fix",
9+
"format": "npm run lint --fix",
1010
"feature-start": "feature-start --featureName",
1111
"feature-finish": "feature-finish",
1212
"release-start": "release-start",
1313
"release-finish": "release-finish"
1414
},
1515
"devDependencies": {
1616
"@netcracker/qubership-apihub-npm-gitflow": "dev",
17-
"@playwright/test": "1.49.1",
18-
"@types/node": "22.8.7",
17+
"@playwright/test": "1.50.1",
18+
"@types/node": "22.13.1",
1919
"@typescript-eslint/eslint-plugin": "7.18.0",
2020
"@typescript-eslint/parser": "7.18.0",
2121
"@typescript-eslint/types": "7.18.0",
@@ -28,7 +28,7 @@
2828
"eslint-plugin-filenames": "1.3.2",
2929
"eslint-plugin-ui-testing": "2.0.1",
3030
"jszip": "3.10.1",
31-
"typescript": "5.7.2"
31+
"typescript": "5.7.3"
3232
},
3333
"eslintConfig": {
3434
"extends": ".eslintrc.json"

playwright.config.ts

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -81,9 +81,8 @@ export default defineConfig<Fixtures>({
8181
testDir: './src/tests/portal',
8282
use: {
8383
...devices['Desktop Chrome'],
84-
channel: process.env.CI ? 'chrome' : undefined,
84+
channel: 'chromium',
8585
launchOptions: {
86-
executablePath: process.env.CI ? './chrome-linux/chrome' : undefined,
8786
// slowMo: 150,
8887
},
8988
viewport: { width: 1320, height: 768 },
@@ -122,10 +121,7 @@ export default defineConfig<Fixtures>({
122121
timeout: 130_000,
123122
use: {
124123
...devices['Desktop Chrome'],
125-
channel: process.env.CI ? 'chrome' : undefined,
126-
launchOptions: {
127-
executablePath: process.env.CI ? './chrome-linux/chrome' : undefined,
128-
},
124+
channel: 'chromium',
129125
actionTimeout: 120_000,
130126
trace: 'off',
131127
screenshot: 'off',
@@ -138,10 +134,7 @@ export default defineConfig<Fixtures>({
138134
timeout: 190_000,
139135
use: {
140136
...devices['Desktop Chrome'],
141-
channel: process.env.CI ? 'chrome' : undefined,
142-
launchOptions: {
143-
executablePath: process.env.CI ? './chrome-linux/chrome' : undefined,
144-
},
137+
channel: 'chromium',
145138
actionTimeout: 180_000,
146139
trace: 'off',
147140
screenshot: 'off',

src/packages/portal/pages/PortalPage.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,10 @@ export class PortalPage extends MainPage {
4848
super(page)
4949
}
5050

51+
url(): string {
52+
return this.page.url()
53+
}
54+
5155
async goto(url?: string, options?: GotoOptions): Promise<void> {
5256
if (url) {
5357
await super.goto(url, options)

src/packages/shared/components/custom/views/RawView.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,6 @@ export class RawView extends BaseComponent {
2323
readonly yamlBtn = new Button(this.page.getByTestId('ModeButton-YAML'), 'YAML')
2424

2525
constructor(private readonly page: Page) {
26-
super(page.locator('.monaco-editor'), 'Raw view')
26+
super(page.locator('.monaco-editor').and(page.getByRole('code')), 'Raw view')
2727
}
2828
}

src/tests/portal/03-access-control/3.0-general.spec.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ test.describe('03.0 Access Control. General.', () => {
119119
await addUserDialog.fillForm(testUserName, 'Viewer')
120120
await addUserDialog.addBtn.click()
121121

122-
await expect(accessControlTab.getUserRow(testUserName)).toBeVisible()
122+
await expect(accessControlTab.getUserRow(testUserName).viewerChx).toBeChecked()
123123
})
124124

125125
await test.step(`Set "Editor" role for "${GRP_P_UAC_G1_N.name}" group`, async () => {
@@ -128,7 +128,7 @@ test.describe('03.0 Access Control. General.', () => {
128128
await addUserDialog.fillForm(testUserName, 'Editor')
129129
await addUserDialog.addBtn.click()
130130

131-
await expect(accessControlTab.getUserRow(testUserName)).toBeVisible()
131+
await expect(accessControlTab.getUserRow(testUserName).editorChx).toBeChecked()
132132
})
133133

134134
await test.step(`Set "Owner" role for "${GRP_P_UAC_G2_N.name}" group`, async () => {
@@ -137,16 +137,14 @@ test.describe('03.0 Access Control. General.', () => {
137137
await addUserDialog.fillForm(testUserName, 'Owner')
138138
await addUserDialog.addBtn.click()
139139

140-
await expect(accessControlTab.getUserRow(testUserName)).toBeVisible()
140+
await expect(accessControlTab.getUserRow(testUserName).ownerChx).toBeChecked()
141141
})
142142

143143
await test.step(`Set "Admin" role for "${PKG_P_UAC_G_INHER_N.name}" package`, async () => {
144144
await portalPage.gotoPackage(PKG_P_UAC_G_INHER_N, SETTINGS_TAB_USERS)
145145
await accessControlTab.addUserBtn.click()
146146
await addUserDialog.fillForm(testUserName, 'Admin')
147147
await addUserDialog.addBtn.click()
148-
149-
await expect(accessControlTab.getUserRow(testUserName)).toBeVisible()
150148
})
151149

152150
await test.step('Check checkboxes', async () => {

src/tests/portal/06-api-changes/6.1-api-changes-package.spec.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,10 @@ test.describe('6.1 API Changes (Package)', () => {
7474
test('[P-CHPOP-1.2] Opening the API Changes tab when the latest revision of previous version is published after current version',
7575
{
7676
tag: '@smoke',
77-
annotation: { type: 'Test Case', description: `${TICKET_BASE_URL}TestCase-A-5321` },
77+
annotation: [
78+
{ type: 'Test Case', description: `${TICKET_BASE_URL}TestCase-A-5321` },
79+
{ type: 'Flaky', description: 'Sometimes, the API Changes tab displays a placeholder "No changes" instead of a list of operations with changes.' },
80+
],
7881
},
7982
async ({ sysadminPage: page }) => {
8083

src/tests/portal/09-comparison/9.1-compare-package-versions.spec.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,10 @@ test.describe('09.1 Compare Package versions', () => {
156156

157157
test('[P-COPVOP-4] Opening a Compare Packages page for different packages after swapping',
158158
{
159-
annotation: { type: 'Test Case', description: `${TICKET_BASE_URL}TestCase-A-1730` },
159+
annotation: [
160+
{ type: 'Test Case', description: `${TICKET_BASE_URL}TestCase-A-1730` },
161+
{ type: 'Flaky', description: 'Sometimes, the "Previous Version" field suddenly clears itself.' },
162+
],
160163
},
161164
async ({ sysadminPage: page }) => {
162165

@@ -267,7 +270,10 @@ test.describe('09.1 Compare Package versions', () => {
267270

268271
test('[P-COPVOP-8] Opening a Compare Packages page from the Operation details page',
269272
{
270-
annotation: { type: 'Test Case', description: `${TICKET_BASE_URL}TestCase-A-4561` },
273+
annotation: [
274+
{ type: 'Test Case', description: `${TICKET_BASE_URL}TestCase-A-4561` },
275+
{ type: 'Flaky', description: 'Sometimes, the "Previous Version" field suddenly clears itself.' },
276+
],
271277
},
272278
async ({ sysadminPage: page }) => {
273279

src/tests/portal/09-comparison/9.4-compare-different-dashboards.spec.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -596,6 +596,10 @@ test.describe('09.4 Compare different Dashboards', () => {
596596
annotation: [
597597
{ type: 'Test Case', description: `${TICKET_BASE_URL}TestCase-A-10152` },
598598
{ type: 'Issue', description: `${TICKET_BASE_URL}TestCase-B-1437` },
599+
{
600+
type: 'Flaky',
601+
description: 'Sometimes, when clicking the "Edit" button, a dialog with only versions is displayed instead of the full dialog with Workspaces and Dashboards.',
602+
},
599603
],
600604
},
601605
async ({ sysadminPage: page }) => {

0 commit comments

Comments
 (0)