From 34850b009f6d7d0c7a9e51b455cab626c42f5524 Mon Sep 17 00:00:00 2001 From: Adina Parpalita Date: Wed, 23 Jan 2019 13:38:22 +0200 Subject: [PATCH 01/15] try new reporter --- package.json | 1 + protractor.conf.js | 27 +++++++++++++++++++-------- 2 files changed, 20 insertions(+), 8 deletions(-) diff --git a/package.json b/package.json index ec00e164fc..e0e616d827 100644 --- a/package.json +++ b/package.json @@ -94,6 +94,7 @@ "pre-commit": "^1.2.2", "prettier": "^1.16.0", "protractor": "^5.4.0", + "protractor-screenshoter-plugin": "0.10.3", "rimraf": "2.6.2", "rxjs-tslint-rules": "^4.11.0", "selenium-webdriver": "4.0.0-alpha.1", diff --git a/protractor.conf.js b/protractor.conf.js index c74000f537..e72990b4d8 100755 --- a/protractor.conf.js +++ b/protractor.conf.js @@ -79,15 +79,26 @@ exports.config = { print: function () {} }, + // plugins: [{ + // package: 'jasmine2-protractor-utils', + // disableHTMLReport: false, + // disableScreenshot: false, + // screenshotOnExpectFailure: true, + // screenshotOnSpecFailure: false, + // clearFoldersBeforeTest: true, + // htmlReportDir: `${projectRoot}/e2e-output/html-report/`, + // screenshotPath: `${projectRoot}/e2e-output/screenshots/` + // }], + plugins: [{ - package: 'jasmine2-protractor-utils', - disableHTMLReport: false, - disableScreenshot: false, - screenshotOnExpectFailure: true, - screenshotOnSpecFailure: false, - clearFoldersBeforeTest: true, - htmlReportDir: `${projectRoot}/e2e-output/html-report/`, - screenshotPath: `${projectRoot}/e2e-output/screenshots/` + package: 'protractor-screenshoter-plugin', + screenshotPath: `${projectRoot}/e2e-output/screenshots`, + screenshotOnExpect: 'failure+success', + screenshotOnSpec: 'none', + withLogs: true, + writeReportFreq: 'asap', + imageToAscii: 'none', + clearFoldersBeforeTest: true }], onPrepare() { From 108d3ede39f443636dadfe460dae333c53df9b23 Mon Sep 17 00:00:00 2001 From: Adina Parpalita Date: Wed, 23 Jan 2019 16:01:24 +0200 Subject: [PATCH 02/15] run specific suite for testing purposes --- e2e/suites/actions/mark-favorite.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/e2e/suites/actions/mark-favorite.test.ts b/e2e/suites/actions/mark-favorite.test.ts index 9019f240b5..409d823c28 100644 --- a/e2e/suites/actions/mark-favorite.test.ts +++ b/e2e/suites/actions/mark-favorite.test.ts @@ -28,7 +28,7 @@ import { SITE_VISIBILITY, SITE_ROLES } from '../../configs'; import { RepoClient } from '../../utilities/repo-client/repo-client'; import { Utils } from '../../utilities/utils'; -describe('Mark items as favorites', () => { +fdescribe('Mark items as favorites', () => { const username = `user-${Utils.random()}`; const parent = `parent-${Utils.random()}`; From 7ca6f6082d3344938dc22d1167b3fa86b8883f61 Mon Sep 17 00:00:00 2001 From: Adina Parpalita Date: Wed, 23 Jan 2019 16:07:21 +0200 Subject: [PATCH 03/15] change folder output for report --- protractor.conf.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/protractor.conf.js b/protractor.conf.js index e72990b4d8..eec64590cb 100755 --- a/protractor.conf.js +++ b/protractor.conf.js @@ -92,7 +92,7 @@ exports.config = { plugins: [{ package: 'protractor-screenshoter-plugin', - screenshotPath: `${projectRoot}/e2e-output/screenshots`, + screenshotPath: `${projectRoot}/e2e-output/report`, screenshotOnExpect: 'failure+success', screenshotOnSpec: 'none', withLogs: true, From 96c052d2ae3b648236d570893779e01367c67064 Mon Sep 17 00:00:00 2001 From: Adina Parpalita Date: Sun, 27 Jan 2019 22:53:45 +0200 Subject: [PATCH 04/15] more report settings --- protractor.conf.js | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/protractor.conf.js b/protractor.conf.js index eec64590cb..581cfb261f 100755 --- a/protractor.conf.js +++ b/protractor.conf.js @@ -79,25 +79,16 @@ exports.config = { print: function () {} }, - // plugins: [{ - // package: 'jasmine2-protractor-utils', - // disableHTMLReport: false, - // disableScreenshot: false, - // screenshotOnExpectFailure: true, - // screenshotOnSpecFailure: false, - // clearFoldersBeforeTest: true, - // htmlReportDir: `${projectRoot}/e2e-output/html-report/`, - // screenshotPath: `${projectRoot}/e2e-output/screenshots/` - // }], - plugins: [{ package: 'protractor-screenshoter-plugin', screenshotPath: `${projectRoot}/e2e-output/report`, - screenshotOnExpect: 'failure+success', + screenshotOnExpect: 'failure', screenshotOnSpec: 'none', withLogs: true, - writeReportFreq: 'asap', + writeReportFreq: 'end', imageToAscii: 'none', + htmlOnExpect: 'none', + htmlOnSpec: 'none', clearFoldersBeforeTest: true }], From 1f01f82e26ebeb47ce9256dba614cc7cbfb8b9cf Mon Sep 17 00:00:00 2001 From: Adina Parpalita Date: Mon, 28 Jan 2019 00:44:06 +0200 Subject: [PATCH 05/15] remove fdescribe --- e2e/suites/actions/mark-favorite.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/e2e/suites/actions/mark-favorite.test.ts b/e2e/suites/actions/mark-favorite.test.ts index 409d823c28..9019f240b5 100644 --- a/e2e/suites/actions/mark-favorite.test.ts +++ b/e2e/suites/actions/mark-favorite.test.ts @@ -28,7 +28,7 @@ import { SITE_VISIBILITY, SITE_ROLES } from '../../configs'; import { RepoClient } from '../../utilities/repo-client/repo-client'; import { Utils } from '../../utilities/utils'; -fdescribe('Mark items as favorites', () => { +describe('Mark items as favorites', () => { const username = `user-${Utils.random()}`; const parent = `parent-${Utils.random()}`; From 4c94bc5def711b942ebab823eb4938be29c19d6f Mon Sep 17 00:00:00 2001 From: Adina Parpalita Date: Mon, 28 Jan 2019 10:07:08 +0200 Subject: [PATCH 06/15] remove package and update package-lock --- package-lock.json | 97 +++++++++++++++++++++++++---------------------- package.json | 1 - 2 files changed, 52 insertions(+), 46 deletions(-) diff --git a/package-lock.json b/package-lock.json index 880c9e5d17..ea3cafa5c5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1569,7 +1569,7 @@ }, "load-json-file": { "version": "2.0.0", - "resolved": "http://registry.npmjs.org/load-json-file/-/load-json-file-2.0.0.tgz", + "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-2.0.0.tgz", "integrity": "sha1-eUfkIUmvgNaWy/eXvKq8/h/inKg=", "dev": true, "requires": { @@ -1607,7 +1607,7 @@ }, "pify": { "version": "2.3.0", - "resolved": "http://registry.npmjs.org/pify/-/pify-2.3.0.tgz", + "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=", "dev": true }, @@ -1847,7 +1847,7 @@ }, "supports-color": { "version": "2.0.0", - "resolved": "http://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=", "dev": true } @@ -8814,41 +8814,6 @@ "colors": "1.1.2" } }, - "jasmine2-protractor-utils": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/jasmine2-protractor-utils/-/jasmine2-protractor-utils-1.3.0.tgz", - "integrity": "sha1-lARqq7x0rQpLdGvNTcMFB1h7Z+M=", - "dev": true, - "requires": { - "fs-extra": "^0.26.5", - "mkdirp": "^0.5.1", - "q": "^1.4.1" - }, - "dependencies": { - "fs-extra": { - "version": "0.26.7", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-0.26.7.tgz", - "integrity": "sha1-muH92UiXeY7at20JGM9C0MMYT6k=", - "dev": true, - "requires": { - "graceful-fs": "^4.1.2", - "jsonfile": "^2.1.0", - "klaw": "^1.0.0", - "path-is-absolute": "^1.0.0", - "rimraf": "^2.2.8" - } - }, - "jsonfile": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-2.4.0.tgz", - "integrity": "sha1-NzaitCi4e72gzIO1P6PWM6NcKug=", - "dev": true, - "requires": { - "graceful-fs": "^4.1.6" - } - } - } - }, "jasminewd2": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/jasminewd2/-/jasminewd2-2.2.0.tgz", @@ -9543,13 +9508,13 @@ "is-buffer": "^1.1.5" } }, - "klaw": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/klaw/-/klaw-1.3.1.tgz", - "integrity": "sha1-QIhDO0azsbolnXh4XY6W9zugJDk=", + "klaw-sync": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/klaw-sync/-/klaw-sync-6.0.0.tgz", + "integrity": "sha512-nIeuVSzdCCs6TDPTqI8w1Yre34sSq7AkZ4B3sfOBbI2CgVSB4Du4aLQijFU2+lhAFCwt9+42Hel6lQNIv6AntQ==", "dev": true, "requires": { - "graceful-fs": "^4.1.9" + "graceful-fs": "^4.1.11" } }, "latest-version": { @@ -10169,7 +10134,7 @@ }, "supports-color": { "version": "2.0.0", - "resolved": "http://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=", "dev": true } @@ -12868,6 +12833,42 @@ } } }, + "protractor-screenshoter-plugin": { + "version": "0.10.3", + "resolved": "https://registry.npmjs.org/protractor-screenshoter-plugin/-/protractor-screenshoter-plugin-0.10.3.tgz", + "integrity": "sha512-OF9kGe1rMxBQY4uXzXQUFT14EB83rz8DlDcxmH5HcOHPBpUhGh+Nwo7+K87w1LoLcTuGdG7Bz+/hGwoGguDfsA==", + "dev": true, + "requires": { + "circular-json": "^0.5.1", + "fs-extra": "^7.0.0", + "klaw-sync": "^6.0.0", + "lodash": "^4.17.11", + "mkdirp": "^0.5.1", + "moment": "^2.20.1", + "q": "^1.5.1", + "screenshoter-report-analyzer": "^0.6", + "uuid": "^3.1.0" + }, + "dependencies": { + "fs-extra": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-7.0.1.tgz", + "integrity": "sha512-YJDaCJZEnBmcbw13fvdAM9AwNOJwOzrE4pqMqBq5nFiEqXUqHwlK4B+3pUw6JNvfSPtX05xFHtYy/1ni01eGCw==", + "dev": true, + "requires": { + "graceful-fs": "^4.1.2", + "jsonfile": "^4.0.0", + "universalify": "^0.1.0" + } + }, + "lodash": { + "version": "4.17.11", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.11.tgz", + "integrity": "sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg==", + "dev": true + } + } + }, "proxy-addr": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.4.tgz", @@ -13786,6 +13787,12 @@ "ajv-keywords": "^3.1.0" } }, + "screenshoter-report-analyzer": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/screenshoter-report-analyzer/-/screenshoter-report-analyzer-0.6.0.tgz", + "integrity": "sha1-Cm+I1fXRrBa2z3Ji7/ujH+5I7RI=", + "dev": true + }, "scss-tokenizer": { "version": "0.2.3", "resolved": "https://registry.npmjs.org/scss-tokenizer/-/scss-tokenizer-0.2.3.tgz", @@ -14108,7 +14115,7 @@ }, "slice-ansi": { "version": "0.0.4", - "resolved": "http://registry.npmjs.org/slice-ansi/-/slice-ansi-0.0.4.tgz", + "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-0.0.4.tgz", "integrity": "sha1-7b+JA/ZvfOL46v1s7tZeJkyDGzU=", "dev": true }, diff --git a/package.json b/package.json index e0e616d827..05e0b6a760 100644 --- a/package.json +++ b/package.json @@ -81,7 +81,6 @@ "jasmine-core": "~2.8.0", "jasmine-reporters": "^2.2.1", "jasmine-spec-reporter": "~4.2.1", - "jasmine2-protractor-utils": "^1.3.0", "jasminewd2": "^2.2.0", "karma": "^3.0.0", "karma-chrome-launcher": "~2.2.0", From df6ff85f6be6515c240fd3f00662988e6c270691 Mon Sep 17 00:00:00 2001 From: Adina Parpalita Date: Mon, 28 Jan 2019 13:43:51 +0200 Subject: [PATCH 07/15] remove disabled tests not needed by the new reporter --- e2e/suites/actions/context-menu-multiple-selection.test.ts | 2 -- e2e/suites/actions/context-menu-single-selection.test.ts | 2 -- e2e/suites/actions/copy.test.ts | 2 -- e2e/suites/actions/create-folder.test.ts | 1 - e2e/suites/actions/delete-undo-delete.test.ts | 2 -- e2e/suites/actions/mark-favorite.test.ts | 2 -- e2e/suites/actions/restore.test.ts | 2 -- e2e/suites/actions/share-file.test.ts | 2 -- .../actions/special-permissions-available-actions.test.ts | 2 -- e2e/suites/actions/toolbar-multiple-selection.test.ts | 2 -- e2e/suites/actions/toolbar-single-selection.test.ts | 2 -- e2e/suites/actions/unshare-file.test.ts | 1 - e2e/suites/application/general.test.ts | 1 - e2e/suites/application/page-titles.test.ts | 2 -- e2e/suites/authentication/login.test.ts | 2 -- e2e/suites/extensions/ext-info-drawer.test.ts | 2 -- e2e/suites/extensions/ext-viewer.test.ts | 2 -- e2e/suites/list-views/file-libraries.test.ts | 2 -- e2e/suites/list-views/permissions.test.ts | 2 -- e2e/suites/list-views/personal-files.test.ts | 2 -- e2e/suites/list-views/tooltips.test.ts | 2 -- e2e/suites/list-views/trash.test.ts | 2 -- e2e/suites/viewer/viewer-actions.test.ts | 2 -- 23 files changed, 43 deletions(-) diff --git a/e2e/suites/actions/context-menu-multiple-selection.test.ts b/e2e/suites/actions/context-menu-multiple-selection.test.ts index 19045b5d47..c818ef3372 100755 --- a/e2e/suites/actions/context-menu-multiple-selection.test.ts +++ b/e2e/suites/actions/context-menu-multiple-selection.test.ts @@ -98,8 +98,6 @@ describe('Context menu actions - multiple selection : ', () => { done(); }); - xit(''); - describe('Generic tests', () => { beforeEach(async (done) => { await Utils.pressEscape(); diff --git a/e2e/suites/actions/context-menu-single-selection.test.ts b/e2e/suites/actions/context-menu-single-selection.test.ts index 3e9c084a7d..df8eb9b423 100755 --- a/e2e/suites/actions/context-menu-single-selection.test.ts +++ b/e2e/suites/actions/context-menu-single-selection.test.ts @@ -102,8 +102,6 @@ describe('Context menu actions - single selection : ', () => { done(); }); - xit(''); - describe('Generic tests', () => { beforeEach(async (done) => { await Utils.pressEscape(); diff --git a/e2e/suites/actions/copy.test.ts b/e2e/suites/actions/copy.test.ts index 924bc7dc42..363d07fb7e 100755 --- a/e2e/suites/actions/copy.test.ts +++ b/e2e/suites/actions/copy.test.ts @@ -555,6 +555,4 @@ describe('Copy', () => { }); }); - xit(''); - }); diff --git a/e2e/suites/actions/create-folder.test.ts b/e2e/suites/actions/create-folder.test.ts index e609ddbecb..e5c46da2cf 100755 --- a/e2e/suites/actions/create-folder.test.ts +++ b/e2e/suites/actions/create-folder.test.ts @@ -263,5 +263,4 @@ describe('Create folder', () => { }); }); - xit(''); }); diff --git a/e2e/suites/actions/delete-undo-delete.test.ts b/e2e/suites/actions/delete-undo-delete.test.ts index 7e81f0ca62..03f2be9e9b 100755 --- a/e2e/suites/actions/delete-undo-delete.test.ts +++ b/e2e/suites/actions/delete-undo-delete.test.ts @@ -49,8 +49,6 @@ describe('Delete and undo delete', () => { done(); }); - xit(''); - describe('on Personal Files', () => { const file1 = `file1-${Utils.random()}.txt`; const file2 = `file2-${Utils.random()}.txt`; diff --git a/e2e/suites/actions/mark-favorite.test.ts b/e2e/suites/actions/mark-favorite.test.ts index 9019f240b5..82a5977803 100644 --- a/e2e/suites/actions/mark-favorite.test.ts +++ b/e2e/suites/actions/mark-favorite.test.ts @@ -89,8 +89,6 @@ describe('Mark items as favorites', () => { done(); }); - xit(''); - describe('on Personal Files', () => { afterAll(async (done) => { await apis.user.favorites.addFavoritesByIds('file', [ fileFavUIId, fileFav1Id, fileFav2Id, fileFav3Id, fileFav4Id ]); diff --git a/e2e/suites/actions/restore.test.ts b/e2e/suites/actions/restore.test.ts index 94b9c0a55a..13faf624e4 100755 --- a/e2e/suites/actions/restore.test.ts +++ b/e2e/suites/actions/restore.test.ts @@ -52,8 +52,6 @@ describe('Restore from Trash', () => { done(); }); - xit(''); - describe('successful restore', () => { const file = `file-${Utils.random()}.txt`; let fileId; const folder = `folder-${Utils.random()}`; let folderId; diff --git a/e2e/suites/actions/share-file.test.ts b/e2e/suites/actions/share-file.test.ts index df0444caf5..6b855baf1a 100755 --- a/e2e/suites/actions/share-file.test.ts +++ b/e2e/suites/actions/share-file.test.ts @@ -1011,6 +1011,4 @@ describe('Share a file', () => { }); }); - xit(''); - }); diff --git a/e2e/suites/actions/special-permissions-available-actions.test.ts b/e2e/suites/actions/special-permissions-available-actions.test.ts index 50de63aae4..082a366098 100755 --- a/e2e/suites/actions/special-permissions-available-actions.test.ts +++ b/e2e/suites/actions/special-permissions-available-actions.test.ts @@ -103,8 +103,6 @@ describe('Granular permissions available actions : ', () => { done(); }); - xit(''); - describe('toolbar displays correct actions when selecting multiple files with different granular permissions', () => { beforeEach(async (done) => { await Utils.pressEscape(); diff --git a/e2e/suites/actions/toolbar-multiple-selection.test.ts b/e2e/suites/actions/toolbar-multiple-selection.test.ts index 83142553a4..4969326760 100755 --- a/e2e/suites/actions/toolbar-multiple-selection.test.ts +++ b/e2e/suites/actions/toolbar-multiple-selection.test.ts @@ -111,8 +111,6 @@ describe('Toolbar actions - multiple selection : ', () => { done(); }); - xit(''); - describe('on Personal Files', () => { beforeEach(async (done) => { await Utils.pressEscape(); diff --git a/e2e/suites/actions/toolbar-single-selection.test.ts b/e2e/suites/actions/toolbar-single-selection.test.ts index 378da05101..57f10ba3fe 100755 --- a/e2e/suites/actions/toolbar-single-selection.test.ts +++ b/e2e/suites/actions/toolbar-single-selection.test.ts @@ -101,8 +101,6 @@ describe('Toolbar actions - single selection : ', () => { done(); }); - xit(''); - describe('on Personal Files', () => { beforeEach(async (done) => { await Utils.pressEscape(); diff --git a/e2e/suites/actions/unshare-file.test.ts b/e2e/suites/actions/unshare-file.test.ts index 84c0c57799..3e3b94c2e1 100755 --- a/e2e/suites/actions/unshare-file.test.ts +++ b/e2e/suites/actions/unshare-file.test.ts @@ -795,5 +795,4 @@ describe('Unshare a file', () => { }); }); - xit(''); }); diff --git a/e2e/suites/application/general.test.ts b/e2e/suites/application/general.test.ts index 7466acfe86..a5a9db244a 100644 --- a/e2e/suites/application/general.test.ts +++ b/e2e/suites/application/general.test.ts @@ -37,7 +37,6 @@ describe('General', () => { const { nodes: nodesApi, authentication: authApi } = adminApi; const folder = `folder-${Utils.random()}`; let folderId; - xit(''); describe('on session expire', () => { beforeAll(async (done) => { diff --git a/e2e/suites/application/page-titles.test.ts b/e2e/suites/application/page-titles.test.ts index 16fadbe0d6..f3167676c7 100755 --- a/e2e/suites/application/page-titles.test.ts +++ b/e2e/suites/application/page-titles.test.ts @@ -37,8 +37,6 @@ describe('Page titles', () => { const file = `file-${Utils.random()}.txt`; let fileId; const { searchInput } = page.header; - xit(''); - describe('on Login / Logout pages', () => { it('on Login page - [C217155]', async () => { await loginPage.load(); diff --git a/e2e/suites/authentication/login.test.ts b/e2e/suites/authentication/login.test.ts index 737d83f8ca..1547deadb1 100755 --- a/e2e/suites/authentication/login.test.ts +++ b/e2e/suites/authentication/login.test.ts @@ -74,8 +74,6 @@ describe('Login', () => { done(); }); - xit(''); - describe('general tests', () => { beforeEach(async (done) => { await loginPage.load(); diff --git a/e2e/suites/extensions/ext-info-drawer.test.ts b/e2e/suites/extensions/ext-info-drawer.test.ts index 6783597b74..72d0aa64a6 100755 --- a/e2e/suites/extensions/ext-info-drawer.test.ts +++ b/e2e/suites/extensions/ext-info-drawer.test.ts @@ -157,6 +157,4 @@ describe('Extensions - Info Drawer', () => { }); }); - xit(''); - }); diff --git a/e2e/suites/extensions/ext-viewer.test.ts b/e2e/suites/extensions/ext-viewer.test.ts index dadd5c7b8c..8043e853ab 100755 --- a/e2e/suites/extensions/ext-viewer.test.ts +++ b/e2e/suites/extensions/ext-viewer.test.ts @@ -103,8 +103,6 @@ describe('Extensions - Viewer', () => { done(); }); - xit(''); - describe('content', () => { it('Insert new component in a content viewer - [C284659]', async () => { await page.dataTable.doubleClickOnRowByName(pdfFile.file_name); diff --git a/e2e/suites/list-views/file-libraries.test.ts b/e2e/suites/list-views/file-libraries.test.ts index aea6e6be40..757b704e92 100755 --- a/e2e/suites/list-views/file-libraries.test.ts +++ b/e2e/suites/list-views/file-libraries.test.ts @@ -96,8 +96,6 @@ describe('File Libraries', () => { done(); }); - xit(''); - describe('My Libraries', () => { beforeEach(async (done) => { await page.goToMyLibrariesAndWait(); diff --git a/e2e/suites/list-views/permissions.test.ts b/e2e/suites/list-views/permissions.test.ts index b10e9d1f87..c7bd72cc02 100755 --- a/e2e/suites/list-views/permissions.test.ts +++ b/e2e/suites/list-views/permissions.test.ts @@ -41,8 +41,6 @@ describe('Special permissions', () => { const page = new BrowsingPage(); const { dataTable } = page; - xit(''); - beforeAll(async (done) => { await apis.admin.people.createUser({ username }); done(); diff --git a/e2e/suites/list-views/personal-files.test.ts b/e2e/suites/list-views/personal-files.test.ts index f2b1c188ae..e120114500 100755 --- a/e2e/suites/list-views/personal-files.test.ts +++ b/e2e/suites/list-views/personal-files.test.ts @@ -65,8 +65,6 @@ describe('Personal Files', () => { done(); }); - xit(''); - describe(`Admin user's personal files`, () => { beforeAll(async (done) => { await loginPage.loginWithAdmin(); diff --git a/e2e/suites/list-views/tooltips.test.ts b/e2e/suites/list-views/tooltips.test.ts index dfb60346be..c9ae1105b8 100755 --- a/e2e/suites/list-views/tooltips.test.ts +++ b/e2e/suites/list-views/tooltips.test.ts @@ -85,8 +85,6 @@ describe('File / folder tooltips', () => { done(); }); - xit(''); - describe('on Personal Files', () => { beforeAll(async (done) => { await page.clickPersonalFilesAndWait(); diff --git a/e2e/suites/list-views/trash.test.ts b/e2e/suites/list-views/trash.test.ts index 2286071bf2..329e6e784b 100755 --- a/e2e/suites/list-views/trash.test.ts +++ b/e2e/suites/list-views/trash.test.ts @@ -87,8 +87,6 @@ describe('Trash', () => { done(); }); - xit(''); - describe('as admin', () => { beforeAll(async (done) => { await loginPage.loginWithAdmin(); diff --git a/e2e/suites/viewer/viewer-actions.test.ts b/e2e/suites/viewer/viewer-actions.test.ts index a60585dc31..40fb5bacd1 100755 --- a/e2e/suites/viewer/viewer-actions.test.ts +++ b/e2e/suites/viewer/viewer-actions.test.ts @@ -58,8 +58,6 @@ describe('Viewer actions', () => { done(); }); - xit(''); - describe('on Personal Files', () => { const parent = `parentPF-${Utils.random()}`; let parentId; const destination = `destPF-${Utils.random()}`; let destinationId; From 8d845686739eb4484910e995000784a3852d2839 Mon Sep 17 00:00:00 2001 From: Adina Parpalita Date: Mon, 28 Jan 2019 15:23:27 +0200 Subject: [PATCH 08/15] try to identify cause of travis failure --- e2e/suites/actions/mark-favorite.test.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/e2e/suites/actions/mark-favorite.test.ts b/e2e/suites/actions/mark-favorite.test.ts index 82a5977803..ce2b8326f8 100644 --- a/e2e/suites/actions/mark-favorite.test.ts +++ b/e2e/suites/actions/mark-favorite.test.ts @@ -27,6 +27,7 @@ import { LoginPage, BrowsingPage } from '../../pages/pages'; import { SITE_VISIBILITY, SITE_ROLES } from '../../configs'; import { RepoClient } from '../../utilities/repo-client/repo-client'; import { Utils } from '../../utilities/utils'; +import { browser } from 'protractor'; describe('Mark items as favorites', () => { const username = `user-${Utils.random()}`; @@ -172,7 +173,7 @@ describe('Mark items as favorites', () => { }); }); - describe('on Recent Files', () => { + fdescribe('on Recent Files', () => { afterAll(async (done) => { await apis.user.favorites.addFavoritesByIds('file', [ fileFav1Id, fileFav2Id, fileFav3Id, fileFav4Id ]); await apis.user.favorites.removeFavoritesByIds([ fileNotFav1Id, fileNotFav2Id, fileNotFav3Id, fileNotFav4Id ]); @@ -189,6 +190,7 @@ describe('Mark items as favorites', () => { it('favorite a file - [C280352]', async () => { await dataTable.selectItem(fileNotFav1); await toolbar.clickMoreActionsFavorite(); + await browser.sleep(500); expect(await apis.user.favorites.isFavoriteWithRetry(fileNotFav1Id, { expect: true })).toBe(true, `${fileNotFav1} not marked as favorite`); }); @@ -196,6 +198,7 @@ describe('Mark items as favorites', () => { it('unfavorite an item - [C280353]', async () => { await dataTable.selectItem(fileFav1); await toolbar.clickMoreActionsFavorite(); + await browser.sleep(500); expect(await apis.user.favorites.isFavoriteWithRetry(fileFav1Id, { expect: false })).toBe(false, `${fileFav1} is marked as favorite`); }); @@ -203,6 +206,7 @@ describe('Mark items as favorites', () => { it('favorite multiple items - all unfavorite - [C280355]', async () => { await dataTable.selectMultipleItems([ fileNotFav2, fileNotFav3 ]); await toolbar.clickMoreActionsFavorite(); + await browser.sleep(500); expect(await apis.user.favorites.isFavoriteWithRetry(fileNotFav2Id, { expect: true })).toBe(true, `${fileNotFav2} not marked as favorite`); expect(await apis.user.favorites.isFavoriteWithRetry(fileNotFav3Id, { expect: true })).toBe(true, `${fileNotFav3} not marked as favorite`); @@ -211,6 +215,7 @@ describe('Mark items as favorites', () => { it('favorite multiple items - some favorite and some unfavorite - [C280357]', async () => { await dataTable.selectMultipleItems([ fileNotFav4, fileFav2 ]); await toolbar.clickMoreActionsFavorite(); + await browser.sleep(500); expect(await apis.user.favorites.isFavoriteWithRetry(fileNotFav4Id, { expect: true })).toBe(true, `${fileNotFav4} not marked as favorite`); expect(await apis.user.favorites.isFavoriteWithRetry(fileFav2Id, { expect: true })).toBe(true, `${fileFav2} not marked as favorite`); @@ -219,6 +224,7 @@ describe('Mark items as favorites', () => { it('unfavorite multiple items - [C280356]', async () => { await dataTable.selectMultipleItems([ fileFav3, fileFav4 ]); await toolbar.clickMoreActionsFavorite(); + await browser.sleep(500); expect(await apis.user.favorites.isFavoriteWithRetry(fileFav3Id, { expect: false })).toBe(false, `${fileFav3} marked as favorite`); expect(await apis.user.favorites.isFavoriteWithRetry(fileFav4Id, { expect: false })).toBe(false, `${fileFav4} marked as favorite`); From 4598f943f4b6b4c756ea755de0a13dd4b4aa4226 Mon Sep 17 00:00:00 2001 From: Adina Parpalita Date: Mon, 28 Jan 2019 15:25:37 +0200 Subject: [PATCH 09/15] run only specific tests for investigation purpose --- e2e/suites/actions/mark-favorite.test.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/e2e/suites/actions/mark-favorite.test.ts b/e2e/suites/actions/mark-favorite.test.ts index ce2b8326f8..ab304ce48d 100644 --- a/e2e/suites/actions/mark-favorite.test.ts +++ b/e2e/suites/actions/mark-favorite.test.ts @@ -173,7 +173,7 @@ describe('Mark items as favorites', () => { }); }); - fdescribe('on Recent Files', () => { + describe('on Recent Files', () => { afterAll(async (done) => { await apis.user.favorites.addFavoritesByIds('file', [ fileFav1Id, fileFav2Id, fileFav3Id, fileFav4Id ]); await apis.user.favorites.removeFavoritesByIds([ fileNotFav1Id, fileNotFav2Id, fileNotFav3Id, fileNotFav4Id ]); @@ -187,7 +187,7 @@ describe('Mark items as favorites', () => { done(); }); - it('favorite a file - [C280352]', async () => { + fit('favorite a file - [C280352]', async () => { await dataTable.selectItem(fileNotFav1); await toolbar.clickMoreActionsFavorite(); await browser.sleep(500); @@ -195,7 +195,7 @@ describe('Mark items as favorites', () => { expect(await apis.user.favorites.isFavoriteWithRetry(fileNotFav1Id, { expect: true })).toBe(true, `${fileNotFav1} not marked as favorite`); }); - it('unfavorite an item - [C280353]', async () => { + fit('unfavorite an item - [C280353]', async () => { await dataTable.selectItem(fileFav1); await toolbar.clickMoreActionsFavorite(); await browser.sleep(500); @@ -203,7 +203,7 @@ describe('Mark items as favorites', () => { expect(await apis.user.favorites.isFavoriteWithRetry(fileFav1Id, { expect: false })).toBe(false, `${fileFav1} is marked as favorite`); }); - it('favorite multiple items - all unfavorite - [C280355]', async () => { + fit('favorite multiple items - all unfavorite - [C280355]', async () => { await dataTable.selectMultipleItems([ fileNotFav2, fileNotFav3 ]); await toolbar.clickMoreActionsFavorite(); await browser.sleep(500); @@ -212,7 +212,7 @@ describe('Mark items as favorites', () => { expect(await apis.user.favorites.isFavoriteWithRetry(fileNotFav3Id, { expect: true })).toBe(true, `${fileNotFav3} not marked as favorite`); }); - it('favorite multiple items - some favorite and some unfavorite - [C280357]', async () => { + fit('favorite multiple items - some favorite and some unfavorite - [C280357]', async () => { await dataTable.selectMultipleItems([ fileNotFav4, fileFav2 ]); await toolbar.clickMoreActionsFavorite(); await browser.sleep(500); @@ -221,7 +221,7 @@ describe('Mark items as favorites', () => { expect(await apis.user.favorites.isFavoriteWithRetry(fileFav2Id, { expect: true })).toBe(true, `${fileFav2} not marked as favorite`); }); - it('unfavorite multiple items - [C280356]', async () => { + fit('unfavorite multiple items - [C280356]', async () => { await dataTable.selectMultipleItems([ fileFav3, fileFav4 ]); await toolbar.clickMoreActionsFavorite(); await browser.sleep(500); From 52d4f18492733c754797e471a96ce3734b529763 Mon Sep 17 00:00:00 2001 From: Adina Parpalita Date: Mon, 28 Jan 2019 15:57:37 +0200 Subject: [PATCH 10/15] remove sleep and increase retry delay --- e2e/suites/actions/mark-favorite.test.ts | 22 +++++++------------ .../apis/favorites/favorites-api.ts | 4 ++-- 2 files changed, 10 insertions(+), 16 deletions(-) diff --git a/e2e/suites/actions/mark-favorite.test.ts b/e2e/suites/actions/mark-favorite.test.ts index ab304ce48d..c30035a91b 100644 --- a/e2e/suites/actions/mark-favorite.test.ts +++ b/e2e/suites/actions/mark-favorite.test.ts @@ -27,7 +27,6 @@ import { LoginPage, BrowsingPage } from '../../pages/pages'; import { SITE_VISIBILITY, SITE_ROLES } from '../../configs'; import { RepoClient } from '../../utilities/repo-client/repo-client'; import { Utils } from '../../utilities/utils'; -import { browser } from 'protractor'; describe('Mark items as favorites', () => { const username = `user-${Utils.random()}`; @@ -190,44 +189,39 @@ describe('Mark items as favorites', () => { fit('favorite a file - [C280352]', async () => { await dataTable.selectItem(fileNotFav1); await toolbar.clickMoreActionsFavorite(); - await browser.sleep(500); - expect(await apis.user.favorites.isFavoriteWithRetry(fileNotFav1Id, { expect: true })).toBe(true, `${fileNotFav1} not marked as favorite`); + expect(await apis.user.favorites.isFavoriteWithRetry(fileNotFav1Id, { expect: true, delay: 1200 })).toBe(true, `${fileNotFav1} not marked as favorite`); }); fit('unfavorite an item - [C280353]', async () => { await dataTable.selectItem(fileFav1); await toolbar.clickMoreActionsFavorite(); - await browser.sleep(500); - expect(await apis.user.favorites.isFavoriteWithRetry(fileFav1Id, { expect: false })).toBe(false, `${fileFav1} is marked as favorite`); + expect(await apis.user.favorites.isFavoriteWithRetry(fileFav1Id, { expect: false, delay: 1200 })).toBe(false, `${fileFav1} is marked as favorite`); }); fit('favorite multiple items - all unfavorite - [C280355]', async () => { await dataTable.selectMultipleItems([ fileNotFav2, fileNotFav3 ]); await toolbar.clickMoreActionsFavorite(); - await browser.sleep(500); - expect(await apis.user.favorites.isFavoriteWithRetry(fileNotFav2Id, { expect: true })).toBe(true, `${fileNotFav2} not marked as favorite`); - expect(await apis.user.favorites.isFavoriteWithRetry(fileNotFav3Id, { expect: true })).toBe(true, `${fileNotFav3} not marked as favorite`); + expect(await apis.user.favorites.isFavoriteWithRetry(fileNotFav2Id, { expect: true, delay: 1200 })).toBe(true, `${fileNotFav2} not marked as favorite`); + expect(await apis.user.favorites.isFavoriteWithRetry(fileNotFav3Id, { expect: true, delay: 1200 })).toBe(true, `${fileNotFav3} not marked as favorite`); }); fit('favorite multiple items - some favorite and some unfavorite - [C280357]', async () => { await dataTable.selectMultipleItems([ fileNotFav4, fileFav2 ]); await toolbar.clickMoreActionsFavorite(); - await browser.sleep(500); - expect(await apis.user.favorites.isFavoriteWithRetry(fileNotFav4Id, { expect: true })).toBe(true, `${fileNotFav4} not marked as favorite`); - expect(await apis.user.favorites.isFavoriteWithRetry(fileFav2Id, { expect: true })).toBe(true, `${fileFav2} not marked as favorite`); + expect(await apis.user.favorites.isFavoriteWithRetry(fileNotFav4Id, { expect: true, delay: 1200 })).toBe(true, `${fileNotFav4} not marked as favorite`); + expect(await apis.user.favorites.isFavoriteWithRetry(fileFav2Id, { expect: true, delay: 1200 })).toBe(true, `${fileFav2} not marked as favorite`); }); fit('unfavorite multiple items - [C280356]', async () => { await dataTable.selectMultipleItems([ fileFav3, fileFav4 ]); await toolbar.clickMoreActionsFavorite(); - await browser.sleep(500); - expect(await apis.user.favorites.isFavoriteWithRetry(fileFav3Id, { expect: false })).toBe(false, `${fileFav3} marked as favorite`); - expect(await apis.user.favorites.isFavoriteWithRetry(fileFav4Id, { expect: false })).toBe(false, `${fileFav4} marked as favorite`); + expect(await apis.user.favorites.isFavoriteWithRetry(fileFav3Id, { expect: false, delay: 1200 })).toBe(false, `${fileFav3} marked as favorite`); + expect(await apis.user.favorites.isFavoriteWithRetry(fileFav4Id, { expect: false, delay: 1200 })).toBe(false, `${fileFav4} marked as favorite`); }); }); diff --git a/e2e/utilities/repo-client/apis/favorites/favorites-api.ts b/e2e/utilities/repo-client/apis/favorites/favorites-api.ts index d303139736..2830cda490 100755 --- a/e2e/utilities/repo-client/apis/favorites/favorites-api.ts +++ b/e2e/utilities/repo-client/apis/favorites/favorites-api.ts @@ -96,7 +96,7 @@ export class FavoritesApi extends RepoApi { let isFavorite; try { const favorite = async () => { - isFavorite = JSON.stringify((await this.getFavorites()).list.entries).includes(nodeId); + isFavorite = await this.isFavorite(nodeId); if ( isFavorite !== data.expect ) { return Promise.reject(isFavorite); } else { @@ -104,7 +104,7 @@ export class FavoritesApi extends RepoApi { } }; - return await Utils.retryCall(favorite); + return await Utils.retryCall(favorite, data.delay); } catch (error) { console.log('-----> catch isFavoriteWithRetry: ', error); } From 71a8b3cc4d7fa0a59331b0692957914d93a3abb8 Mon Sep 17 00:00:00 2001 From: Adina Parpalita Date: Mon, 28 Jan 2019 17:10:20 +0200 Subject: [PATCH 11/15] try a different fix --- e2e/suites/actions/mark-favorite.test.ts | 26 ++++++++++++------------ e2e/utilities/utils.ts | 2 +- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/e2e/suites/actions/mark-favorite.test.ts b/e2e/suites/actions/mark-favorite.test.ts index c30035a91b..82a5977803 100644 --- a/e2e/suites/actions/mark-favorite.test.ts +++ b/e2e/suites/actions/mark-favorite.test.ts @@ -186,42 +186,42 @@ describe('Mark items as favorites', () => { done(); }); - fit('favorite a file - [C280352]', async () => { + it('favorite a file - [C280352]', async () => { await dataTable.selectItem(fileNotFav1); await toolbar.clickMoreActionsFavorite(); - expect(await apis.user.favorites.isFavoriteWithRetry(fileNotFav1Id, { expect: true, delay: 1200 })).toBe(true, `${fileNotFav1} not marked as favorite`); + expect(await apis.user.favorites.isFavoriteWithRetry(fileNotFav1Id, { expect: true })).toBe(true, `${fileNotFav1} not marked as favorite`); }); - fit('unfavorite an item - [C280353]', async () => { + it('unfavorite an item - [C280353]', async () => { await dataTable.selectItem(fileFav1); await toolbar.clickMoreActionsFavorite(); - expect(await apis.user.favorites.isFavoriteWithRetry(fileFav1Id, { expect: false, delay: 1200 })).toBe(false, `${fileFav1} is marked as favorite`); + expect(await apis.user.favorites.isFavoriteWithRetry(fileFav1Id, { expect: false })).toBe(false, `${fileFav1} is marked as favorite`); }); - fit('favorite multiple items - all unfavorite - [C280355]', async () => { + it('favorite multiple items - all unfavorite - [C280355]', async () => { await dataTable.selectMultipleItems([ fileNotFav2, fileNotFav3 ]); await toolbar.clickMoreActionsFavorite(); - expect(await apis.user.favorites.isFavoriteWithRetry(fileNotFav2Id, { expect: true, delay: 1200 })).toBe(true, `${fileNotFav2} not marked as favorite`); - expect(await apis.user.favorites.isFavoriteWithRetry(fileNotFav3Id, { expect: true, delay: 1200 })).toBe(true, `${fileNotFav3} not marked as favorite`); + expect(await apis.user.favorites.isFavoriteWithRetry(fileNotFav2Id, { expect: true })).toBe(true, `${fileNotFav2} not marked as favorite`); + expect(await apis.user.favorites.isFavoriteWithRetry(fileNotFav3Id, { expect: true })).toBe(true, `${fileNotFav3} not marked as favorite`); }); - fit('favorite multiple items - some favorite and some unfavorite - [C280357]', async () => { + it('favorite multiple items - some favorite and some unfavorite - [C280357]', async () => { await dataTable.selectMultipleItems([ fileNotFav4, fileFav2 ]); await toolbar.clickMoreActionsFavorite(); - expect(await apis.user.favorites.isFavoriteWithRetry(fileNotFav4Id, { expect: true, delay: 1200 })).toBe(true, `${fileNotFav4} not marked as favorite`); - expect(await apis.user.favorites.isFavoriteWithRetry(fileFav2Id, { expect: true, delay: 1200 })).toBe(true, `${fileFav2} not marked as favorite`); + expect(await apis.user.favorites.isFavoriteWithRetry(fileNotFav4Id, { expect: true })).toBe(true, `${fileNotFav4} not marked as favorite`); + expect(await apis.user.favorites.isFavoriteWithRetry(fileFav2Id, { expect: true })).toBe(true, `${fileFav2} not marked as favorite`); }); - fit('unfavorite multiple items - [C280356]', async () => { + it('unfavorite multiple items - [C280356]', async () => { await dataTable.selectMultipleItems([ fileFav3, fileFav4 ]); await toolbar.clickMoreActionsFavorite(); - expect(await apis.user.favorites.isFavoriteWithRetry(fileFav3Id, { expect: false, delay: 1200 })).toBe(false, `${fileFav3} marked as favorite`); - expect(await apis.user.favorites.isFavoriteWithRetry(fileFav4Id, { expect: false, delay: 1200 })).toBe(false, `${fileFav4} marked as favorite`); + expect(await apis.user.favorites.isFavoriteWithRetry(fileFav3Id, { expect: false })).toBe(false, `${fileFav3} marked as favorite`); + expect(await apis.user.favorites.isFavoriteWithRetry(fileFav4Id, { expect: false })).toBe(false, `${fileFav4} marked as favorite`); }); }); diff --git a/e2e/utilities/utils.ts b/e2e/utilities/utils.ts index ec2c4c9929..98b0d92aa3 100755 --- a/e2e/utilities/utils.ts +++ b/e2e/utilities/utils.ts @@ -69,7 +69,7 @@ export class Utils { return this.setSessionStorageFromConfig(defConfig); } - static retryCall(fn: () => Promise, retry: number = 30, delay: number = 1000): Promise { + static retryCall(fn: () => Promise, retry: number = 30, delay: number = 1100): Promise { const pause = duration => new Promise(res => setTimeout(res, duration)); const run = retries => fn().catch(err => (retries > 1 ? pause(delay).then(() => run(retries - 1)) : Promise.reject(err))); From 5cec9f3584c3878a55ef5ef457f186448124a4f8 Mon Sep 17 00:00:00 2001 From: Adina Parpalita Date: Mon, 28 Jan 2019 17:57:53 +0200 Subject: [PATCH 12/15] revert to previous fix --- e2e/suites/actions/mark-favorite.test.ts | 16 ++++++++-------- e2e/utilities/utils.ts | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/e2e/suites/actions/mark-favorite.test.ts b/e2e/suites/actions/mark-favorite.test.ts index 82a5977803..5b8ab81d24 100644 --- a/e2e/suites/actions/mark-favorite.test.ts +++ b/e2e/suites/actions/mark-favorite.test.ts @@ -190,38 +190,38 @@ describe('Mark items as favorites', () => { await dataTable.selectItem(fileNotFav1); await toolbar.clickMoreActionsFavorite(); - expect(await apis.user.favorites.isFavoriteWithRetry(fileNotFav1Id, { expect: true })).toBe(true, `${fileNotFav1} not marked as favorite`); + expect(await apis.user.favorites.isFavoriteWithRetry(fileNotFav1Id, { expect: true, delay: 1200 })).toBe(true, `${fileNotFav1} not marked as favorite`); }); it('unfavorite an item - [C280353]', async () => { await dataTable.selectItem(fileFav1); await toolbar.clickMoreActionsFavorite(); - expect(await apis.user.favorites.isFavoriteWithRetry(fileFav1Id, { expect: false })).toBe(false, `${fileFav1} is marked as favorite`); + expect(await apis.user.favorites.isFavoriteWithRetry(fileFav1Id, { expect: false, delay: 1200 })).toBe(false, `${fileFav1} is marked as favorite`); }); it('favorite multiple items - all unfavorite - [C280355]', async () => { await dataTable.selectMultipleItems([ fileNotFav2, fileNotFav3 ]); await toolbar.clickMoreActionsFavorite(); - expect(await apis.user.favorites.isFavoriteWithRetry(fileNotFav2Id, { expect: true })).toBe(true, `${fileNotFav2} not marked as favorite`); - expect(await apis.user.favorites.isFavoriteWithRetry(fileNotFav3Id, { expect: true })).toBe(true, `${fileNotFav3} not marked as favorite`); + expect(await apis.user.favorites.isFavoriteWithRetry(fileNotFav2Id, { expect: true, delay: 1200 })).toBe(true, `${fileNotFav2} not marked as favorite`); + expect(await apis.user.favorites.isFavoriteWithRetry(fileNotFav3Id, { expect: true, delay: 1200 })).toBe(true, `${fileNotFav3} not marked as favorite`); }); it('favorite multiple items - some favorite and some unfavorite - [C280357]', async () => { await dataTable.selectMultipleItems([ fileNotFav4, fileFav2 ]); await toolbar.clickMoreActionsFavorite(); - expect(await apis.user.favorites.isFavoriteWithRetry(fileNotFav4Id, { expect: true })).toBe(true, `${fileNotFav4} not marked as favorite`); - expect(await apis.user.favorites.isFavoriteWithRetry(fileFav2Id, { expect: true })).toBe(true, `${fileFav2} not marked as favorite`); + expect(await apis.user.favorites.isFavoriteWithRetry(fileNotFav4Id, { expect: true, delay: 1200 })).toBe(true, `${fileNotFav4} not marked as favorite`); + expect(await apis.user.favorites.isFavoriteWithRetry(fileFav2Id, { expect: true, delay: 1200 })).toBe(true, `${fileFav2} not marked as favorite`); }); it('unfavorite multiple items - [C280356]', async () => { await dataTable.selectMultipleItems([ fileFav3, fileFav4 ]); await toolbar.clickMoreActionsFavorite(); - expect(await apis.user.favorites.isFavoriteWithRetry(fileFav3Id, { expect: false })).toBe(false, `${fileFav3} marked as favorite`); - expect(await apis.user.favorites.isFavoriteWithRetry(fileFav4Id, { expect: false })).toBe(false, `${fileFav4} marked as favorite`); + expect(await apis.user.favorites.isFavoriteWithRetry(fileFav3Id, { expect: false, delay: 1200 })).toBe(false, `${fileFav3} marked as favorite`); + expect(await apis.user.favorites.isFavoriteWithRetry(fileFav4Id, { expect: false, delay: 1200 })).toBe(false, `${fileFav4} marked as favorite`); }); }); diff --git a/e2e/utilities/utils.ts b/e2e/utilities/utils.ts index 98b0d92aa3..ec2c4c9929 100755 --- a/e2e/utilities/utils.ts +++ b/e2e/utilities/utils.ts @@ -69,7 +69,7 @@ export class Utils { return this.setSessionStorageFromConfig(defConfig); } - static retryCall(fn: () => Promise, retry: number = 30, delay: number = 1100): Promise { + static retryCall(fn: () => Promise, retry: number = 30, delay: number = 1000): Promise { const pause = duration => new Promise(res => setTimeout(res, duration)); const run = retries => fn().catch(err => (retries > 1 ? pause(delay).then(() => run(retries - 1)) : Promise.reject(err))); From 10be744cc74a26df8ac5d1a49d65fb15ded487a1 Mon Sep 17 00:00:00 2001 From: Adina Parpalita Date: Tue, 29 Jan 2019 00:26:17 +0200 Subject: [PATCH 13/15] try different expects --- e2e/suites/actions/mark-favorite.test.ts | 29 +++++++++++++++++------- 1 file changed, 21 insertions(+), 8 deletions(-) diff --git a/e2e/suites/actions/mark-favorite.test.ts b/e2e/suites/actions/mark-favorite.test.ts index 5b8ab81d24..db436b6857 100644 --- a/e2e/suites/actions/mark-favorite.test.ts +++ b/e2e/suites/actions/mark-favorite.test.ts @@ -190,38 +190,51 @@ describe('Mark items as favorites', () => { await dataTable.selectItem(fileNotFav1); await toolbar.clickMoreActionsFavorite(); - expect(await apis.user.favorites.isFavoriteWithRetry(fileNotFav1Id, { expect: true, delay: 1200 })).toBe(true, `${fileNotFav1} not marked as favorite`); + await page.clickFavoritesAndWait(); + expect(await dataTable.isItemPresent(fileNotFav1)).toBe(true, `${fileNotFav1} not marked as favorite`); + // expect(await apis.user.favorites.isFavoriteWithRetry(fileNotFav1Id, { expect: true, delay: 1200 })).toBe(true, `${fileNotFav1} not marked as favorite`); }); it('unfavorite an item - [C280353]', async () => { await dataTable.selectItem(fileFav1); await toolbar.clickMoreActionsFavorite(); - expect(await apis.user.favorites.isFavoriteWithRetry(fileFav1Id, { expect: false, delay: 1200 })).toBe(false, `${fileFav1} is marked as favorite`); + await page.clickFavoritesAndWait(); + expect(await dataTable.isItemPresent(fileFav1)).toBe(false, `${fileFav1} is marked as favorite`); + // expect(await apis.user.favorites.isFavoriteWithRetry(fileFav1Id, { expect: false, delay: 1200 })).toBe(false, `${fileFav1} is marked as favorite`); }); it('favorite multiple items - all unfavorite - [C280355]', async () => { await dataTable.selectMultipleItems([ fileNotFav2, fileNotFav3 ]); await toolbar.clickMoreActionsFavorite(); - expect(await apis.user.favorites.isFavoriteWithRetry(fileNotFav2Id, { expect: true, delay: 1200 })).toBe(true, `${fileNotFav2} not marked as favorite`); - expect(await apis.user.favorites.isFavoriteWithRetry(fileNotFav3Id, { expect: true, delay: 1200 })).toBe(true, `${fileNotFav3} not marked as favorite`); + await page.clickFavoritesAndWait(); + expect(await dataTable.isItemPresent(fileNotFav2)).toBe(true, `${fileNotFav2} not marked as favorite`); + expect(await dataTable.isItemPresent(fileNotFav3)).toBe(true, `${fileNotFav3} not marked as favorite`); + // expect(await apis.user.favorites.isFavoriteWithRetry(fileNotFav2Id, { expect: true, delay: 1200 })).toBe(true, `${fileNotFav2} not marked as favorite`); + // expect(await apis.user.favorites.isFavoriteWithRetry(fileNotFav3Id, { expect: true, delay: 1200 })).toBe(true, `${fileNotFav3} not marked as favorite`); }); it('favorite multiple items - some favorite and some unfavorite - [C280357]', async () => { await dataTable.selectMultipleItems([ fileNotFav4, fileFav2 ]); await toolbar.clickMoreActionsFavorite(); - expect(await apis.user.favorites.isFavoriteWithRetry(fileNotFav4Id, { expect: true, delay: 1200 })).toBe(true, `${fileNotFav4} not marked as favorite`); - expect(await apis.user.favorites.isFavoriteWithRetry(fileFav2Id, { expect: true, delay: 1200 })).toBe(true, `${fileFav2} not marked as favorite`); + await page.clickFavoritesAndWait(); + expect(await dataTable.isItemPresent(fileNotFav4)).toBe(true, `${fileNotFav4} not marked as favorite`); + expect(await dataTable.isItemPresent(fileFav2)).toBe(true, `${fileFav2} not marked as favorite`); + // expect(await apis.user.favorites.isFavoriteWithRetry(fileNotFav4Id, { expect: true, delay: 1200 })).toBe(true, `${fileNotFav4} not marked as favorite`); + // expect(await apis.user.favorites.isFavoriteWithRetry(fileFav2Id, { expect: true, delay: 1200 })).toBe(true, `${fileFav2} not marked as favorite`); }); it('unfavorite multiple items - [C280356]', async () => { await dataTable.selectMultipleItems([ fileFav3, fileFav4 ]); await toolbar.clickMoreActionsFavorite(); - expect(await apis.user.favorites.isFavoriteWithRetry(fileFav3Id, { expect: false, delay: 1200 })).toBe(false, `${fileFav3} marked as favorite`); - expect(await apis.user.favorites.isFavoriteWithRetry(fileFav4Id, { expect: false, delay: 1200 })).toBe(false, `${fileFav4} marked as favorite`); + await page.clickFavoritesAndWait(); + expect(await dataTable.isItemPresent(fileFav3)).toBe(false, `${fileFav3} marked as favorite`); + expect(await dataTable.isItemPresent(fileFav4)).toBe(false, `${fileFav4} marked as favorite`); + // expect(await apis.user.favorites.isFavoriteWithRetry(fileFav3Id, { expect: false, delay: 1200 })).toBe(false, `${fileFav3} marked as favorite`); + // expect(await apis.user.favorites.isFavoriteWithRetry(fileFav4Id, { expect: false, delay: 1200 })).toBe(false, `${fileFav4} marked as favorite`); }); }); From 7c4093e30e835cd0c20d61f421c358593733dbd5 Mon Sep 17 00:00:00 2001 From: Adina Parpalita Date: Tue, 29 Jan 2019 10:38:57 +0200 Subject: [PATCH 14/15] call different js-api method --- e2e/suites/actions/mark-favorite.test.ts | 29 +++++-------------- .../apis/favorites/favorites-api.ts | 2 +- 2 files changed, 9 insertions(+), 22 deletions(-) diff --git a/e2e/suites/actions/mark-favorite.test.ts b/e2e/suites/actions/mark-favorite.test.ts index db436b6857..82a5977803 100644 --- a/e2e/suites/actions/mark-favorite.test.ts +++ b/e2e/suites/actions/mark-favorite.test.ts @@ -190,51 +190,38 @@ describe('Mark items as favorites', () => { await dataTable.selectItem(fileNotFav1); await toolbar.clickMoreActionsFavorite(); - await page.clickFavoritesAndWait(); - expect(await dataTable.isItemPresent(fileNotFav1)).toBe(true, `${fileNotFav1} not marked as favorite`); - // expect(await apis.user.favorites.isFavoriteWithRetry(fileNotFav1Id, { expect: true, delay: 1200 })).toBe(true, `${fileNotFav1} not marked as favorite`); + expect(await apis.user.favorites.isFavoriteWithRetry(fileNotFav1Id, { expect: true })).toBe(true, `${fileNotFav1} not marked as favorite`); }); it('unfavorite an item - [C280353]', async () => { await dataTable.selectItem(fileFav1); await toolbar.clickMoreActionsFavorite(); - await page.clickFavoritesAndWait(); - expect(await dataTable.isItemPresent(fileFav1)).toBe(false, `${fileFav1} is marked as favorite`); - // expect(await apis.user.favorites.isFavoriteWithRetry(fileFav1Id, { expect: false, delay: 1200 })).toBe(false, `${fileFav1} is marked as favorite`); + expect(await apis.user.favorites.isFavoriteWithRetry(fileFav1Id, { expect: false })).toBe(false, `${fileFav1} is marked as favorite`); }); it('favorite multiple items - all unfavorite - [C280355]', async () => { await dataTable.selectMultipleItems([ fileNotFav2, fileNotFav3 ]); await toolbar.clickMoreActionsFavorite(); - await page.clickFavoritesAndWait(); - expect(await dataTable.isItemPresent(fileNotFav2)).toBe(true, `${fileNotFav2} not marked as favorite`); - expect(await dataTable.isItemPresent(fileNotFav3)).toBe(true, `${fileNotFav3} not marked as favorite`); - // expect(await apis.user.favorites.isFavoriteWithRetry(fileNotFav2Id, { expect: true, delay: 1200 })).toBe(true, `${fileNotFav2} not marked as favorite`); - // expect(await apis.user.favorites.isFavoriteWithRetry(fileNotFav3Id, { expect: true, delay: 1200 })).toBe(true, `${fileNotFav3} not marked as favorite`); + expect(await apis.user.favorites.isFavoriteWithRetry(fileNotFav2Id, { expect: true })).toBe(true, `${fileNotFav2} not marked as favorite`); + expect(await apis.user.favorites.isFavoriteWithRetry(fileNotFav3Id, { expect: true })).toBe(true, `${fileNotFav3} not marked as favorite`); }); it('favorite multiple items - some favorite and some unfavorite - [C280357]', async () => { await dataTable.selectMultipleItems([ fileNotFav4, fileFav2 ]); await toolbar.clickMoreActionsFavorite(); - await page.clickFavoritesAndWait(); - expect(await dataTable.isItemPresent(fileNotFav4)).toBe(true, `${fileNotFav4} not marked as favorite`); - expect(await dataTable.isItemPresent(fileFav2)).toBe(true, `${fileFav2} not marked as favorite`); - // expect(await apis.user.favorites.isFavoriteWithRetry(fileNotFav4Id, { expect: true, delay: 1200 })).toBe(true, `${fileNotFav4} not marked as favorite`); - // expect(await apis.user.favorites.isFavoriteWithRetry(fileFav2Id, { expect: true, delay: 1200 })).toBe(true, `${fileFav2} not marked as favorite`); + expect(await apis.user.favorites.isFavoriteWithRetry(fileNotFav4Id, { expect: true })).toBe(true, `${fileNotFav4} not marked as favorite`); + expect(await apis.user.favorites.isFavoriteWithRetry(fileFav2Id, { expect: true })).toBe(true, `${fileFav2} not marked as favorite`); }); it('unfavorite multiple items - [C280356]', async () => { await dataTable.selectMultipleItems([ fileFav3, fileFav4 ]); await toolbar.clickMoreActionsFavorite(); - await page.clickFavoritesAndWait(); - expect(await dataTable.isItemPresent(fileFav3)).toBe(false, `${fileFav3} marked as favorite`); - expect(await dataTable.isItemPresent(fileFav4)).toBe(false, `${fileFav4} marked as favorite`); - // expect(await apis.user.favorites.isFavoriteWithRetry(fileFav3Id, { expect: false, delay: 1200 })).toBe(false, `${fileFav3} marked as favorite`); - // expect(await apis.user.favorites.isFavoriteWithRetry(fileFav4Id, { expect: false, delay: 1200 })).toBe(false, `${fileFav4} marked as favorite`); + expect(await apis.user.favorites.isFavoriteWithRetry(fileFav3Id, { expect: false })).toBe(false, `${fileFav3} marked as favorite`); + expect(await apis.user.favorites.isFavoriteWithRetry(fileFav4Id, { expect: false })).toBe(false, `${fileFav4} marked as favorite`); }); }); diff --git a/e2e/utilities/repo-client/apis/favorites/favorites-api.ts b/e2e/utilities/repo-client/apis/favorites/favorites-api.ts index 2830cda490..0d08f41507 100755 --- a/e2e/utilities/repo-client/apis/favorites/favorites-api.ts +++ b/e2e/utilities/repo-client/apis/favorites/favorites-api.ts @@ -114,7 +114,7 @@ export class FavoritesApi extends RepoApi { async removeFavoriteById(nodeId: string) { await this.apiAuth(); try { - return await this.favoritesApi.deleteSiteFavorite('-me-', nodeId); + return await this.favoritesApi.deleteFavorite('-me-', nodeId); } catch (error) { // console.log('--- remove favorite by id catch '); } From 1b851b6553e4ab83924238566969ce8b08cd46e5 Mon Sep 17 00:00:00 2001 From: Adina Parpalita Date: Tue, 29 Jan 2019 11:56:59 +0200 Subject: [PATCH 15/15] remove parameter not needed anymore --- e2e/utilities/repo-client/apis/favorites/favorites-api.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/e2e/utilities/repo-client/apis/favorites/favorites-api.ts b/e2e/utilities/repo-client/apis/favorites/favorites-api.ts index 0d08f41507..5ffb89fef6 100755 --- a/e2e/utilities/repo-client/apis/favorites/favorites-api.ts +++ b/e2e/utilities/repo-client/apis/favorites/favorites-api.ts @@ -104,7 +104,7 @@ export class FavoritesApi extends RepoApi { } }; - return await Utils.retryCall(favorite, data.delay); + return await Utils.retryCall(favorite); } catch (error) { console.log('-----> catch isFavoriteWithRetry: ', error); }