Skip to content

Commit 184f7c7

Browse files
authored
chore(e2e): create e2e test for uploading a file in cells group conversation [WPB-19920] (#19537)
* Finished uploadingFileInGroupConversation.spec.ts * Added a few .env templates for different environments and updated git actions jobs * Removed unnecessary steps from playwright-cells-crit-flow-tests.yml * Added ENV_NAME to env template files, finished playwright-cells-crit-flow-tests.yml, added workaround for imai and fulu envs (they don't have marketing consent pop up) * Updated precommit-crit-flows.yml with updated env template * Addressed Sonar Cube issues, removed one TODO and added refference ticket in another TODO * Removed empty line
1 parent 06bfa0e commit 184f7c7

18 files changed

+451
-9
lines changed
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
name: Playwright Cells Critical Flow Tests
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
environment:
7+
description: 'Select the environment'
8+
required: true
9+
type: choice
10+
options:
11+
- imai
12+
- fulu
13+
- staging
14+
default: staging
15+
16+
schedule:
17+
# runs on all three of the environments (in the morning, 9:00 Berlin summer time)
18+
- cron: '0 7 * * *'
19+
20+
jobs:
21+
smoke-tests:
22+
name: Run Playwright Cells Critical Flow Tests
23+
if: github.repository == 'wireapp/wire-webapp'
24+
runs-on: [self-hosted, Linux, X64, office]
25+
26+
# Strategy is only used for scheduled runs, for manual runs the selected environment is used
27+
strategy:
28+
matrix:
29+
environment: >-
30+
${{ github.event_name == 'schedule'
31+
&& fromJson('["imai","fulu","staging"]')
32+
|| fromJson(format('["{0}"]', github.event.inputs.environment)) }}
33+
34+
35+
steps:
36+
- name: Checkout repository
37+
uses: actions/checkout@v4
38+
39+
- name: Setup Node.js
40+
uses: actions/setup-node@v4
41+
with:
42+
node-version: 18.16.x
43+
cache: 'yarn'
44+
45+
- name: Install JS dependencies
46+
run: yarn --immutable
47+
48+
- name: Install Playwright browsers
49+
run: yarn playwright install --with-deps && yarn playwright install chrome
50+
51+
- name: Install 1Password
52+
uses: 1password/install-cli-action@143a85f84a90555d121cde2ff5872e393a47ab9f
53+
54+
- name: Generate env file
55+
run: op inject -i test/e2e_tests/.env.${{ github.event.inputs.environment }}.tpl -o test/e2e_tests/.env
56+
env:
57+
OP_SERVICE_ACCOUNT_TOKEN: ${{ secrets.OP_SERVICE_ACCOUNT_TOKEN }}
58+
59+
- name: Run critical flow tests
60+
run: yarn e2e-test --grep "@crit-flow-cells"
61+
62+
- name: Upload test report
63+
if: always()
64+
uses: actions/upload-artifact@v4
65+
with:
66+
name: playwright-report
67+
path: playwright-report/

.github/workflows/playwright-crit-flow-tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
uses: 1password/install-cli-action@v1
3232

3333
- name: Generate env file
34-
run: op inject -i test/e2e_tests/.env.tpl -o test/e2e_tests/.env
34+
run: op inject -i test/e2e_tests/.env.staging.tpl -o test/e2e_tests/.env
3535
env:
3636
OP_SERVICE_ACCOUNT_TOKEN: ${{ secrets.OP_SERVICE_ACCOUNT_TOKEN }}
3737

.github/workflows/playwright-regression-flow-tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232
uses: 1password/install-cli-action@v1
3333

3434
- name: Generate env file
35-
run: op inject -i test/e2e_tests/.env.tpl -o test/e2e_tests/.env
35+
run: op inject -i test/e2e_tests/.env.staging.tpl -o test/e2e_tests/.env
3636
env:
3737
OP_SERVICE_ACCOUNT_TOKEN: ${{ secrets.OP_SERVICE_ACCOUNT_TOKEN }}
3838

.github/workflows/playwright-smoke-tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
uses: 1password/install-cli-action@v1
3030

3131
- name: Generate env file
32-
run: op inject -i test/e2e_tests/.env.tpl -o test/e2e_tests/.env
32+
run: op inject -i test/e2e_tests/.env.staging.tpl -o test/e2e_tests/.env
3333
env:
3434
OP_SERVICE_ACCOUNT_TOKEN: ${{ secrets.OP_SERVICE_ACCOUNT_TOKEN }}
3535

.github/workflows/precommit-crit-flows.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ jobs:
146146
- uses: 1password/install-cli-action@143a85f84a90555d121cde2ff5872e393a47ab9f
147147

148148
- name: Generate env file
149-
run: op inject -i test/e2e_tests/.env.tpl -o test/e2e_tests/.env
149+
run: op inject -i test/e2e_tests/.env.staging.tpl -o test/e2e_tests/.env
150150
env:
151151
OP_SERVICE_ACCOUNT_TOKEN: ${{ secrets.OP_SERVICE_ACCOUNT_TOKEN }}
152152

test/e2e_tests/.env.fulu.tpl

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
//
2+
// Wire
3+
// Copyright (C) 2025 Wire Swiss GmbH
4+
//
5+
// This program is free software: you can redistribute it and/or modify
6+
// it under the terms of the GNU General Public License as published by
7+
// the Free Software Foundation, either version 3 of the License, or
8+
// (at your option) any later version.
9+
//
10+
// This program is distributed in the hope that it will be useful,
11+
// but WITHOUT ANY WARRANTY; without even the implied warranty of
12+
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13+
// GNU General Public License for more details.
14+
//
15+
// You should have received a copy of the GNU General Public License
16+
// along with this program. If not, see http://www.gnu.org/licenses/.
17+
//
18+
19+
# Playwright settings
20+
HEADLESS=true
21+
22+
# Test service
23+
TEST_SERVICE_URL=http://192.168.2.18:8080
24+
25+
# Calling service
26+
CALLING_SERVICE_URL=op://Test Automation/CALLINGSERVICE_BASIC_AUTH/website
27+
CALLING_SERVICE_BASIC_AUTH=op://Test Automation/CALLINGSERVICE_BASIC_AUTH/basicAuth
28+
29+
ENV_NAME=fulu
30+
INBUCKET_USERNAME=op://Test Automation/BackendConnection fulu/inbucketUsername
31+
INBUCKET_PASSWORD="{{ op://Test Automation/BackendConnection fulu/inbucketPassword }}"
32+
INBUCKET_URL=op://Test Automation/BackendConnection fulu/inbucketUrl
33+
BACKEND_URL=op://Test Automation/BackendConnection fulu/backendUrl
34+
WEBAPP_URL=op://Test Automation/BackendConnection fulu/webappUrl
35+
TEAM_MANAGEMENT_URL=op://Test Automation/BackendConnection fulu/teamManagementUrl
36+
DOMAIN=op://Test Automation/BackendConnection fulu/domain
37+
BASIC_AUTH=op://Test Automation/BackendConnection fulu/basicAuth

test/e2e_tests/.env.imai.tpl

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
//
2+
// Wire
3+
// Copyright (C) 2025 Wire Swiss GmbH
4+
//
5+
// This program is free software: you can redistribute it and/or modify
6+
// it under the terms of the GNU General Public License as published by
7+
// the Free Software Foundation, either version 3 of the License, or
8+
// (at your option) any later version.
9+
//
10+
// This program is distributed in the hope that it will be useful,
11+
// but WITHOUT ANY WARRANTY; without even the implied warranty of
12+
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13+
// GNU General Public License for more details.
14+
//
15+
// You should have received a copy of the GNU General Public License
16+
// along with this program. If not, see http://www.gnu.org/licenses/.
17+
//
18+
19+
# Playwright settings
20+
HEADLESS=true
21+
22+
# Test service
23+
TEST_SERVICE_URL=http://192.168.2.18:8080
24+
25+
# Calling service
26+
CALLING_SERVICE_URL=op://Test Automation/CALLINGSERVICE_BASIC_AUTH/website
27+
CALLING_SERVICE_BASIC_AUTH=op://Test Automation/CALLINGSERVICE_BASIC_AUTH/basicAuth
28+
29+
ENV_NAME=imai
30+
INBUCKET_USERNAME=op://Test Automation/BackendConnection imai/inbucketUsername
31+
INBUCKET_PASSWORD="{{ op://Test Automation/BackendConnection imai/inbucketPassword }}"
32+
INBUCKET_URL=op://Test Automation/BackendConnection imai/inbucketUrl
33+
BACKEND_URL=op://Test Automation/BackendConnection imai/backendUrl
34+
WEBAPP_URL=op://Test Automation/BackendConnection imai/webappUrl
35+
TEAM_MANAGEMENT_URL=op://Test Automation/BackendConnection imai/teamManagementUrl
36+
DOMAIN=op://Test Automation/BackendConnection imai/domain
37+
BASIC_AUTH=op://Test Automation/BackendConnection imai/basicAuth

test/e2e_tests/.env.tpl renamed to test/e2e_tests/.env.staging.tpl

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@
1616
// along with this program. If not, see http://www.gnu.org/licenses/.
1717
//
1818

19-
# Define browsers [chromium, firefox, webkit]
20-
BROWSERS=chromium
19+
# Playwright settings
2120
HEADLESS=true
2221

2322
# Test service
@@ -27,6 +26,8 @@ TEST_SERVICE_URL=http://192.168.2.18:8080
2726
CALLING_SERVICE_URL=op://Test Automation/CALLINGSERVICE_BASIC_AUTH/website
2827
CALLING_SERVICE_BASIC_AUTH=op://Test Automation/CALLINGSERVICE_BASIC_AUTH/basicAuth
2928

29+
ENV_NAME=staging
30+
3031
# SCIM user for e2e tests
3132
SCIM_USER_EMAIL=op://Test Automation/Staging SCIM user/okta username
3233
SCIM_USER_PASSWORD=op://Test Automation/Staging SCIM user/okta password

test/e2e_tests/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Have 1Password's cli installed (op)
77
Before running tests create the env file by
88

99
```
10-
op inject -i test/e2e_tests/.env.tpl -o test/e2e_tests/.env
10+
op inject -i test/e2e_tests/.env.staging.tpl -o test/e2e_tests/.env
1111
```
1212

1313
It will generate .env file with variables from 1Password

test/e2e_tests/backend/brigRepository.e2e.ts

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,4 +142,30 @@ export class BrigRepositoryE2E {
142142
},
143143
);
144144
}
145+
146+
public async unlockCellsFeature(teamId: string) {
147+
await this.axiosInstance.put(
148+
`i/teams/${teamId}/features/cells/unlocked`,
149+
{},
150+
{
151+
headers: {
152+
Authorization: `Basic ${BASIC_AUTH}`,
153+
},
154+
},
155+
);
156+
}
157+
158+
public async enableCells(teamId: string) {
159+
await this.axiosInstance.put(
160+
`i/teams/${teamId}/features/cells`,
161+
{
162+
status: 'enabled',
163+
},
164+
{
165+
headers: {
166+
Authorization: `Basic ${BASIC_AUTH}`,
167+
},
168+
},
169+
);
170+
}
145171
}

0 commit comments

Comments
 (0)