Skip to content

Commit 3441ebd

Browse files
committed
onlyoffice test fixes
1 parent ef5e1be commit 3441ebd

File tree

5 files changed

+35
-27
lines changed

5 files changed

+35
-27
lines changed

ctrf/ctrf.json

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,27 +10,30 @@
1010
"pending": 0,
1111
"skipped": 0,
1212
"other": 0,
13-
"start": 1767883064259,
14-
"stop": 1767883082958,
13+
"start": 1768306419444,
14+
"stop": 1768306470601,
1515
"suites": 0
1616
},
1717
"tests": [
1818
{
19-
"name": "screenshot loggedin - change team avatar",
19+
"name": "loggedin - sheet - import template",
2020
"status": "passed",
21-
"duration": 17966,
22-
"start": 1767883064,
23-
"stop": 1767883082,
21+
"duration": 49240,
22+
"start": 1768306420,
23+
"stop": 1768306469,
2424
"rawStatus": "passed",
2525
"tags": [],
2626
"type": "e2e",
27-
"filePath": "/home/zuzanna/e2e-test-suite/e2e-tests/teams_loggedin.spec.js",
27+
"filePath": "/home/zuzanna/e2e-test-suite/e2e-tests/sheet_loggedin.spec.js",
2828
"retries": 0,
2929
"flaky": false,
3030
"steps": [],
31-
"suite": "chrome > teams_loggedin.spec.js",
31+
"suite": "playwright-firefox > sheet_loggedin.spec.js",
3232
"attachments": [],
33-
"stdout": [],
33+
"stdout": [
34+
"\u001b[33m1\u001b[39m\n",
35+
"\u001b[33mfalse\u001b[39m\n"
36+
],
3437
"stderr": [],
3538
"extra": {
3639
"annotations": []

e2e-tests/doc_loggedin.spec.js

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,10 @@ test('loggedin - doc - import template', async ({ page, context }) => {
5555
await fileActions.createFile.click();
5656
await fileActions.importTemplate(mobile);
5757
await fileActions.templateSpan('example doc template').click();
58-
await page.waitForTimeout(5000)
58+
await page.waitForTimeout(5000);
59+
5960
await fileActions.fileSaved.waitFor();
61+
await fileActions.waitForSync.waitFor({state: "hidden"})
6062

6163
await fileActions.docEditor.click({force: true});
6264
await page.keyboard.press('Control+A');
@@ -128,23 +130,22 @@ test('screenshot loggedin - doc - insert image', async ({ page, context }) => {
128130

129131
try {
130132

131-
await expect(page).toHaveScreenshot( { maxDiffPixels: 6000 });
133+
await expect(page).toHaveScreenshot( { maxDiffPixels: 16120 });
132134

133135
await fileActions.insertTab.click({force: true});
134136
await fileActions.insertImg.click();
135137
await fileActions.imgFromFile.click();
136138

137139
const fileChooserPromise = page.waitForEvent('filechooser');
138-
await fileActions.uploadFile.click()
140+
await fileActions.uploadFileSecure.click()
139141

140142
const fileChooser = await fileChooserPromise;
141143
await fileChooser.setFiles('testdocuments/teamavatar.png');
142144

143-
await fileChooser.setFiles('testdocuments/test sheet.xlsx');
144145
await fileActions.okButtonSecure.click();
145146
await fileActions.mainFrame.getByText('Your file (teamavatar.png)').waitFor()
146147
await page.waitForTimeout(3000)
147-
await expect(page).toHaveScreenshot( { maxDiffPixels: 6000 });
148+
await expect(page).toHaveScreenshot( { maxDiffPixels: 16760 });
148149

149150
await fileActions.toSuccess( 'Can insert image into Document');
150151
} catch (e) {

e2e-tests/fileactions.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -383,7 +383,8 @@ export class FileActions {
383383
this.movedToTrash = this.mainFrame.getByText(/^That document has been moved to the trash/, { exact: true })
384384
this.lostConnection = this.mainFrame.getByText(/^Your connnection to CryptPad/)
385385
this.uploadFile = this.mainFrame.getByRole('button', { name: 'Upload a new file to your' })
386-
386+
this.uploadFileSecure = this.secureFrame.getByRole('button', { name: 'Upload a new file to your' })
387+
387388
}
388389

389390
async moveToTrash() {

e2e-tests/presentation_loggedin.spec.js

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,10 @@ test('loggedin - presentation - import template', async ({ page, context }) => {
5555
await fileActions.createFile.click();
5656
await fileActions.importTemplate(mobile);
5757
await fileActions.templateSpan('example presentation template').click();
58+
await page.waitForTimeout(5000);
59+
5860
await fileActions.fileSaved.waitFor();
59-
await page.waitForTimeout(5000)
61+
await fileActions.waitForSync.waitFor({state: "hidden"})
6062

6163
await fileActions.docEditor.click({force: true});
6264
await page.keyboard.press('Control+A');
@@ -220,23 +222,22 @@ test('screenshot loggedin - presentation - insert image', async ({ page, context
220222

221223
try {
222224

223-
await expect(page).toHaveScreenshot( { maxDiffPixels: 6000 });
224-
225+
await expect(page).toHaveScreenshot( { maxDiffPixels: 16120 });
226+
225227
await fileActions.insertTab.click({force: true});
226228
await fileActions.insertImg.click();
227229
await fileActions.imgFromFile.click();
228230

229231
const fileChooserPromise = page.waitForEvent('filechooser');
230-
await fileActions.uploadFile.click()
232+
await fileActions.uploadFileSecure.click()
231233

232234
const fileChooser = await fileChooserPromise;
233235
await fileChooser.setFiles('testdocuments/teamavatar.png');
234236

235-
await fileChooser.setFiles('testdocuments/test sheet.xlsx');
236237
await fileActions.okButtonSecure.click();
237238
await fileActions.mainFrame.getByText('Your file (teamavatar.png)').waitFor()
238239
await page.waitForTimeout(3000)
239-
await expect(page).toHaveScreenshot( { maxDiffPixels: 6000 });
240+
await expect(page).toHaveScreenshot( { maxDiffPixels: 17800 });
240241

241242
await fileActions.toSuccess( 'Can insert image into Presentation');
242243
} catch (e) {

e2e-tests/sheet_loggedin.spec.js

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,11 @@ test('loggedin - sheet - import template', async ({ page, context }) => {
5656
await fileActions.createFile.click();
5757
await fileActions.importTemplate(mobile);
5858
await fileActions.templateSpan('example sheet template').click();
59-
await fileActions.fileSaved.waitFor();
6059
await page.waitForTimeout(5000);
6160

61+
await fileActions.fileSaved.waitFor();
62+
await fileActions.waitForSync.waitFor({state: "hidden"})
63+
6264
await fileActions.docEditor.click({force: true});
6365
await page.keyboard.press('Control+A');
6466
await page.keyboard.press('Control+C');
@@ -183,22 +185,22 @@ test('screenshot loggedin - sheet - insert image', async ({ page, context }) =>
183185

184186
try {
185187

186-
await expect(page).toHaveScreenshot( { maxDiffPixels: 6000 });
187-
188+
await expect(page).toHaveScreenshot( { maxDiffPixels: 16120 });
189+
188190
await fileActions.insertTab.click({force: true});
189191
await fileActions.insertImg.click();
190192
await fileActions.imgFromFile.click();
191193

192194
const fileChooserPromise = page.waitForEvent('filechooser');
193-
await fileActions.uploadFile.click()
195+
await fileActions.uploadFileSecure.click()
196+
194197
const fileChooser = await fileChooserPromise;
195198
await fileChooser.setFiles('testdocuments/teamavatar.png');
196199

197-
await fileChooser.setFiles('testdocuments/test sheet.xlsx');
198200
await fileActions.okButtonSecure.click();
199201
await fileActions.mainFrame.getByText('Your file (teamavatar.png)').waitFor()
200202
await page.waitForTimeout(3000)
201-
await expect(page).toHaveScreenshot( { maxDiffPixels: 6000 });
203+
await expect(page).toHaveScreenshot( { maxDiffPixels: 17160 });
202204

203205
await fileActions.toSuccess( 'Can insert image into Sheet');
204206
} catch (e) {

0 commit comments

Comments
 (0)