Skip to content

Commit 846cf4c

Browse files
author
Zuzanna Ludzik
committed
cleaning
1 parent ad3a09c commit 846cf4c

10 files changed

Lines changed: 41 additions & 265 deletions

Readme.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,12 +118,13 @@ npx playwright test auth --workers=1 --project='chrome'
118118

119119
### Browserstack authentication and integration
120120

121-
To run the test suite using BrowserStack, add username and access key to the `.env` file.
121+
To run the test suite using BrowserStack, add username and access key, as well as a `BROWSERSTACK` variable set to `true`, to the `.env` file.
122122

123123
```
124124
BrowserStack_USERNAME=""
125125
BrowserStack_ACCESS_KEY=""
126-
```
126+
BROWSERSTACK=true
127+
``
127128
128129
## Running tests
129130

ctrf/ctrf.json

Lines changed: 5 additions & 227 deletions
Original file line numberDiff line numberDiff line change
@@ -4,237 +4,15 @@
44
"name": "playwright"
55
},
66
"summary": {
7-
"tests": 10,
8-
"passed": 10,
7+
"tests": 0,
8+
"passed": 0,
99
"failed": 0,
1010
"pending": 0,
1111
"skipped": 0,
1212
"other": 0,
13-
"start": 1777548073318,
14-
"stop": 1777548311164,
15-
"suites": 0
13+
"start": 1777896865098,
14+
"stop": 1777896865113
1615
},
17-
"tests": [
18-
{
19-
"name": "loggedin - can access public signing key",
20-
"status": "passed",
21-
"duration": 3628,
22-
"start": 1777548073,
23-
"stop": 1777548077,
24-
"rawStatus": "passed",
25-
"tags": [],
26-
"type": "e2e",
27-
"filePath": "/home/zuzanna/e2e-test-suite/e2e-tests/z_user_loggedin.spec.js",
28-
"retries": 0,
29-
"flaky": false,
30-
"steps": [],
31-
"suite": "chrome > z_user_loggedin.spec.js",
32-
"attachments": [],
33-
"stdout": [],
34-
"stderr": [],
35-
"extra": {
36-
"annotations": []
37-
}
38-
},
39-
{
40-
"name": "loggedin - add other user as contact and decline request",
41-
"status": "passed",
42-
"duration": 9757,
43-
"start": 1777548077,
44-
"stop": 1777548087,
45-
"rawStatus": "passed",
46-
"tags": [],
47-
"type": "e2e",
48-
"filePath": "/home/zuzanna/e2e-test-suite/e2e-tests/z_user_loggedin.spec.js",
49-
"retries": 0,
50-
"flaky": false,
51-
"steps": [],
52-
"suite": "chrome > z_user_loggedin.spec.js",
53-
"attachments": [],
54-
"stdout": [],
55-
"stderr": [],
56-
"extra": {
57-
"annotations": []
58-
}
59-
},
60-
{
61-
"name": "loggedin - add and remove other user as contact",
62-
"status": "passed",
63-
"duration": 16232,
64-
"start": 1777548177,
65-
"stop": 1777548193,
66-
"rawStatus": "passed",
67-
"tags": [],
68-
"type": "e2e",
69-
"filePath": "/home/zuzanna/e2e-test-suite/e2e-tests/z_user_loggedin.spec.js",
70-
"retries": 1,
71-
"flaky": true,
72-
"steps": [],
73-
"suite": "chrome > z_user_loggedin.spec.js",
74-
"attachments": [
75-
{
76-
"name": "trace",
77-
"contentType": "application/zip",
78-
"path": "/home/zuzanna/e2e-test-suite/test-results/z_user_loggedin-loggedin---17a86-emove-other-user-as-contact-chrome-retry1/trace.zip"
79-
}
80-
],
81-
"stdout": [],
82-
"stderr": [],
83-
"extra": {
84-
"annotations": []
85-
}
86-
},
87-
{
88-
"name": "loggedin - request and cancel to add user as contact",
89-
"status": "passed",
90-
"duration": 4908,
91-
"start": 1777548194,
92-
"stop": 1777548199,
93-
"rawStatus": "passed",
94-
"tags": [],
95-
"type": "e2e",
96-
"filePath": "/home/zuzanna/e2e-test-suite/e2e-tests/z_user_loggedin.spec.js",
97-
"retries": 0,
98-
"flaky": false,
99-
"steps": [],
100-
"suite": "chrome > z_user_loggedin.spec.js",
101-
"attachments": [],
102-
"stdout": [],
103-
"stderr": [],
104-
"extra": {
105-
"annotations": []
106-
}
107-
},
108-
{
109-
"name": "loggedin - chat with contacts and erase message history",
110-
"status": "passed",
111-
"duration": 4455,
112-
"start": 1777548199,
113-
"stop": 1777548203,
114-
"rawStatus": "passed",
115-
"tags": [],
116-
"type": "e2e",
117-
"filePath": "/home/zuzanna/e2e-test-suite/e2e-tests/z_user_loggedin.spec.js",
118-
"retries": 0,
119-
"flaky": false,
120-
"steps": [],
121-
"suite": "chrome > z_user_loggedin.spec.js",
122-
"attachments": [],
123-
"stdout": [],
124-
"stderr": [],
125-
"extra": {
126-
"annotations": []
127-
}
128-
},
129-
{
130-
"name": "loggedin - sign up and delete account",
131-
"status": "passed",
132-
"duration": 30577,
133-
"start": 1777548203,
134-
"stop": 1777548234,
135-
"rawStatus": "passed",
136-
"tags": [],
137-
"type": "e2e",
138-
"filePath": "/home/zuzanna/e2e-test-suite/e2e-tests/z_user_loggedin.spec.js",
139-
"retries": 0,
140-
"flaky": false,
141-
"steps": [],
142-
"suite": "chrome > z_user_loggedin.spec.js",
143-
"attachments": [],
144-
"stdout": [],
145-
"stderr": [],
146-
"extra": {
147-
"annotations": []
148-
}
149-
},
150-
{
151-
"name": "loggedin - can change display name",
152-
"status": "passed",
153-
"duration": 7756,
154-
"start": 1777548234,
155-
"stop": 1777548241,
156-
"rawStatus": "passed",
157-
"tags": [],
158-
"type": "e2e",
159-
"filePath": "/home/zuzanna/e2e-test-suite/e2e-tests/z_user_loggedin.spec.js",
160-
"retries": 0,
161-
"flaky": false,
162-
"steps": [],
163-
"suite": "chrome > z_user_loggedin.spec.js",
164-
"attachments": [],
165-
"stdout": [],
166-
"stderr": [],
167-
"extra": {
168-
"annotations": []
169-
}
170-
},
171-
{
172-
"name": "loggedin - enable 2FA login",
173-
"status": "passed",
174-
"duration": 19335,
175-
"start": 1777548241,
176-
"stop": 1777548261,
177-
"rawStatus": "passed",
178-
"tags": [],
179-
"type": "e2e",
180-
"filePath": "/home/zuzanna/e2e-test-suite/e2e-tests/z_user_loggedin.spec.js",
181-
"retries": 0,
182-
"flaky": false,
183-
"steps": [],
184-
"suite": "chrome > z_user_loggedin.spec.js",
185-
"attachments": [],
186-
"stdout": [
187-
"code 5ui1Reim2KvfD/zlpt1c9k9uztJFbdHA\n"
188-
],
189-
"stderr": [],
190-
"extra": {
191-
"annotations": []
192-
}
193-
},
194-
{
195-
"name": "loggedin - enable 2FA login and recover account",
196-
"status": "passed",
197-
"duration": 14936,
198-
"start": 1777548261,
199-
"stop": 1777548276,
200-
"rawStatus": "passed",
201-
"tags": [],
202-
"type": "e2e",
203-
"filePath": "/home/zuzanna/e2e-test-suite/e2e-tests/z_user_loggedin.spec.js",
204-
"retries": 0,
205-
"flaky": false,
206-
"steps": [],
207-
"suite": "chrome > z_user_loggedin.spec.js",
208-
"attachments": [],
209-
"stdout": [
210-
"code 9vvkqC3jh1O1lvct6W27TUGs8PbwzlpA\n"
211-
],
212-
"stderr": [],
213-
"extra": {
214-
"annotations": []
215-
}
216-
},
217-
{
218-
"name": "loggedin - can change password",
219-
"status": "passed",
220-
"duration": 34888,
221-
"start": 1777548276,
222-
"stop": 1777548311,
223-
"rawStatus": "passed",
224-
"tags": [],
225-
"type": "e2e",
226-
"filePath": "/home/zuzanna/e2e-test-suite/e2e-tests/z_user_loggedin.spec.js",
227-
"retries": 0,
228-
"flaky": false,
229-
"steps": [],
230-
"suite": "chrome > z_user_loggedin.spec.js",
231-
"attachments": [],
232-
"stdout": [],
233-
"stderr": [],
234-
"extra": {
235-
"annotations": []
236-
}
237-
}
238-
]
16+
"tests": []
23917
}
24018
}

e2e-tests/doc_loggedin.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ test('screenshot loggedin - doc - insert image', async ({ page, context }) => {
132132

133133
await fileActions.okButtonSecure.click();
134134
await fileActions.mainFrame.getByText('Your file (teamavatar.png)').waitFor();
135-
await fileActions.mainFrame.getByText('Your file (teamavatar.png)').waitFor({state: 'hidden'});
135+
await fileActions.mainFrame.getByText('Your file (teamavatar.png)').waitFor({ state: 'hidden' });
136136
await page.waitForTimeout(3000);
137137
await expect(page).toHaveScreenshot({ maxDiffPixels: 16760 });
138138

e2e-tests/genericfile_loggedin.spec.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ test.beforeEach(async ({ page, isMobile }, testInfo) => {
3232
});
3333

3434
const docNames = ['pad', 'code', 'slide', 'kanban', 'whiteboard', 'form', 'diagram', 'sheet', 'doc', 'presentation'];
35-
// const docNames = [ 'code', 'kanban'];
3635

3736
docNames.forEach(function (name) {
3837
test(`loggedin - ${name} - create without owner`, async ({ page }) => {

e2e-tests/kanban_loggedin.spec.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ const { Cleanup } = require('./cleanup.js');
33
const { FileActions } = require('./fileactions.js');
44
const { StoreModal } = require('./genericfile_po.js');
55

6-
76
const { expect } = require('@playwright/test');
87
require('dotenv').config();
98

e2e-tests/presentation_loggedin.spec.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,9 @@ test('screenshot loggedin - presentation - insert image', async ({ page, context
203203
test.skip(mobile, '#2093');
204204

205205
try {
206+
if (await fileActions.dismissButton.isVisible()) {
207+
await fileActions.dismissButton.click();
208+
}
206209
await expect(page).toHaveScreenshot({ maxDiffPixels: 16120 });
207210

208211
await fileActions.insertTab.click({ force: true });
@@ -218,6 +221,8 @@ test('screenshot loggedin - presentation - insert image', async ({ page, context
218221
await fileActions.okButtonSecure.click();
219222
await fileActions.mainFrame.getByText('Your file (teamavatar.png)').waitFor();
220223
await page.waitForTimeout(3000);
224+
await fileActions.mainFrame.getByText('Your file (teamavatar.png)').waitFor({ state: 'hidden' });
225+
221226
await expect(page).toHaveScreenshot({ maxDiffPixels: 17800 });
222227

223228
await fileActions.toSuccess('Can insert image into Presentation');

e2e-tests/sheet_loggedin.spec.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,9 @@ test('screenshot loggedin - sheet - insert image', async ({ page, context }) =>
191191
test.skip(mobile, '#2093');
192192

193193
try {
194+
if (await fileActions.dismissButton.isVisible()) {
195+
await fileActions.dismissButton.click();
196+
}
194197
await expect(page).toHaveScreenshot({ maxDiffPixels: 16120 });
195198

196199
await fileActions.insertTab.click({ force: true });
@@ -206,6 +209,8 @@ test('screenshot loggedin - sheet - insert image', async ({ page, context }) =>
206209
await fileActions.okButtonSecure.click();
207210
await fileActions.mainFrame.getByText('Your file (teamavatar.png)').waitFor();
208211
await page.waitForTimeout(3000);
212+
await fileActions.mainFrame.getByText('Your file (teamavatar.png)').waitFor({ state: 'hidden' });
213+
209214
await expect(page).toHaveScreenshot({ maxDiffPixels: 17160 });
210215

211216
await fileActions.toSuccess('Can insert image into Sheet');

e2e-tests/whiteboard_anon.spec.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ require('dotenv').config();
44
const { FileActions } = require('./fileactions.js');
55
const { StoreModal } = require('./genericfile_po.js');
66

7-
87
let page1;
98
let mobile;
109
let fileActions;
@@ -53,7 +52,7 @@ test('screenshot anon - whiteboard - can draw (default settings)', async ({ page
5352
if (await (new StoreModal(fileActions)).dismissButton.isVisible()) {
5453
await (new StoreModal(fileActions)).dismissButton.click();
5554
}
56-
55+
5756
if (mobile) {
5857
await expect(page).toHaveScreenshot({ maxDiffPixels: 14000 });
5958
} else {

global-setup.js

Lines changed: 11 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,20 @@
11
// global-setup.js
22
const { bsLocal, BS_LOCAL_ARGS } = require('./browserstack.config');
3-
const { promisify } = require('util');
4-
const sleep = promisify(setTimeout);
53
const redColour = '\x1b[31m';
64
const whiteColour = '\x1b[0m';
75

8-
/* eslint-disable no-unused-vars */
9-
10-
module.exports = async () => {
6+
module.exports = async (name, title) => {
117
console.log('Starting test run...');
128
// Starts the Local instance with the required arguments
13-
let localResponseReceived = false;
14-
bsLocal.start(BS_LOCAL_ARGS, (err) => {
15-
if (err) {
16-
console.error(err,
17-
`${redColour}Error starting BrowserStackLocal${whiteColour}`
18-
);
19-
} else {
20-
console.log('BrowserStackLocal Started');
21-
}
22-
localResponseReceived = true;
23-
});
24-
while (!localResponseReceived) {
25-
await sleep(1800);
9+
if (!!process.env.BROWSERSTACK && !!process.env.PW_URL.includes('localhost')) {
10+
bsLocal.start(BS_LOCAL_ARGS, (err) => {
11+
if (err) {
12+
console.error(err,
13+
`${redColour}Error starting BrowserStackLocal${whiteColour}`
14+
);
15+
} else {
16+
console.log('BrowserStackLocal Started');
17+
}
18+
});
2619
}
2720
};
28-
29-
/* eslint-enable no-unused-vars */
30-

0 commit comments

Comments
 (0)