Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion tests/e2e/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"lint": "eslint . --ext .ts,.js,.tsx,.jsx",
"test:desktop:ci": "ts-node ./desktop.runner.ts",
"test:desktop:ci:win": "ts-node ./desktop.runner.win.ts",
"test:desktop": "testcafe electron tests/ --browser-init-timeout 180000 -e -r html:./report/desktop-report.html,spec -q attemptLimit=3,successThreshold=1"
"test:desktop": "testcafe electron tests/ --browser-init-timeout 180000 -e -r html:./report/desktop-report.html,spec"
},
"keywords": [],
"author": "",
Expand All @@ -27,11 +27,13 @@
},
"devDependencies": {
"@types/chance": "1.1.3",
"@types/edit-json-file": "1.7.0",
"@typescript-eslint/eslint-plugin": "4.28.2",
"@typescript-eslint/parser": "4.28.2",
"chance": "1.1.8",
"cross-env": "^7.0.3",
"dotenv-cli": "^5.0.0",
"edit-json-file": "1.7.0",
"eslint": "7.32.0",
"eslint-plugin-import": "2.24.2",
"testcafe": "1.14.2",
Expand Down
1 change: 1 addition & 0 deletions tests/e2e/pageObjects/my-redis-databases-page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ export class MyRedisDatabasePage {
editAliasButton = Selector('[data-testid=edit-alias-btn]');
applyButton = Selector('[data-testid=apply-btn]');
submitChangesButton = Selector('[data-testid=btn-submit]');
promoButton = Selector('[data-testid=promo-btn]');
//CHECKBOXES
selectAllCheckbox = Selector('[data-test-subj=checkboxSelectAll]');
//ICONS
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
import { acceptLicenseTerms } from '../../../helpers/database';
import { MyRedisDatabasePage } from '../../../pageObjects';
import { commonUrl } from '../../../helpers/conf';
import { rte, env } from '../../../helpers/constants';
import { Chance } from 'chance';
import { join } from 'path';
import * as os from 'os';
import * as editJsonFile from 'edit-json-file';

const myRedisDatabasePage = new MyRedisDatabasePage();
const chance = new Chance();

const workingDirectory = process.env.APP_FOLDER_ABSOLUTE_PATH
|| (join(os.homedir(), process.env.APP_FOLDER_NAME || '.redisinsight-v2'));
const buildPath = `${workingDirectory}/content/build.json`;
const createRedisPath = `${workingDirectory}/content/create-redis.json`;
const buildFilePath = editJsonFile(buildPath);
const createRedisFilePath = editJsonFile(createRedisPath);
const timestampBeforeUpdate = buildFilePath.get("timestamp");
const timestampForEdit = timestampBeforeUpdate - 1;
const cloudValueForEdit = chance.word({ length: 10 });

//Edit json file values
createRedisFilePath.set('cloud.title', cloudValueForEdit);
createRedisFilePath.set('cloud.description', cloudValueForEdit);
createRedisFilePath.save();
buildFilePath.set('timestamp', timestampForEdit);
buildFilePath.save();

fixture `Automatically update information`
.meta({type: 'critical_path'})
.page(commonUrl)
.beforeEach(async () => {
await acceptLicenseTerms();
})
test
.meta({ rte: rte.standalone, env: env.desktop })
('Verify that user has the ability to update "Create free database" button without changing the app', async t => {
//Create new file paths due to cacheability
const buildFilePathNew = editJsonFile(buildPath);
const createRedisFilePathNew = editJsonFile(createRedisPath);
//Check the promo button after the opening of app
await t.expect(myRedisDatabasePage.promoButton.textContent).notContains(cloudValueForEdit, 'Promo button text is updated');
//Get the values from build.json and create-redis.json files
const timestampAfterUpdate = await buildFilePathNew.get('timestamp');
const cloudTitle = await createRedisFilePathNew.get('cloud.title');
const cloudDescription = await createRedisFilePathNew.get('cloud.description');
//Check the json files are automatically updated
await t.expect(timestampAfterUpdate).notEql(timestampForEdit, 'The timestamp in the build.json file is automatically updated');
await t.expect(cloudTitle).notEql(cloudValueForEdit, 'The cloud title in the create-redis.json file is automatically updated');
await t.expect(cloudDescription).notEql(cloudValueForEdit, 'The cloud description in the create-redis.json file is automatically updated');
});
86 changes: 73 additions & 13 deletions tests/e2e/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1100,6 +1100,14 @@
resolved "https://registry.yarnpkg.com/@types/chance/-/chance-1.1.3.tgz#d19fe9391288d60fdccd87632bfc9ab2b4523fea"
integrity sha512-X6c6ghhe4/sQh4XzcZWSFaTAUOda38GQHmq9BUanYkOE/EO7ZrkazwKmtsj3xzTjkLWmwULE++23g3d3CCWaWw==

"@types/edit-json-file@1.7.0":
version "1.7.0"
resolved "https://registry.yarnpkg.com/@types/edit-json-file/-/edit-json-file-1.7.0.tgz#c3ab99b33ca8f018d412b2b6a1e3c7bf1a05f732"
integrity sha512-yZrbGD4Qp92s6xU80MWBdz9vJE8k8EbO+gLWYb4W1UL9WYVUMOtUr5zvKlKgbcc2veYmFLO9dPnYA9Mxul0lOw==
dependencies:
"@types/node" "*"
"@types/set-value" "*"

"@types/error-stack-parser@^1.3.18":
version "1.3.18"
resolved "https://registry.yarnpkg.com/@types/error-stack-parser/-/error-stack-parser-1.3.18.tgz#e01c9f8c85ca83b610320c62258b0c9026ade0f7"
Expand Down Expand Up @@ -1148,6 +1156,11 @@
resolved "https://registry.yarnpkg.com/@types/node/-/node-12.20.13.tgz#e743bae112bd779ac9650f907197dd2caa7f0364"
integrity sha512-1x8W5OpxPq+T85OUsHRP6BqXeosKmeXRtjoF39STcdf/UWLqUsoehstZKOi0CunhVqHG17AyZgpj20eRVooK6A==

"@types/set-value@*":
version "4.0.1"
resolved "https://registry.yarnpkg.com/@types/set-value/-/set-value-4.0.1.tgz#7caf185556a67c2d9051080931853047423c93bd"
integrity sha512-mP/CLy6pdrhsDVrz1+Yp5Ly6Tcel2IAEejhyI5NxY6WnBUdWN+AAfGa0HHsdgCdsPWWcd/4D5J2X2TrRYcYRag==

"@typescript-eslint/eslint-plugin@4.28.2":
version "4.28.2"
resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-4.28.2.tgz#7a8320f00141666813d0ae43b49ee8244f7cf92a"
Expand Down Expand Up @@ -2061,6 +2074,24 @@ easy-stack@^1.0.1:
resolved "https://registry.yarnpkg.com/easy-stack/-/easy-stack-1.0.1.tgz#8afe4264626988cabb11f3c704ccd0c835411066"
integrity sha512-wK2sCs4feiiJeFXn3zvY0p41mdU5VUgbgs1rNsc/y5ngFUijdWd+iIN8eoyuZHKB8xN6BL4PdWmzqFmxNg6V2w==

ecdsa-sig-formatter@1.0.11:
version "1.0.11"
resolved "https://registry.yarnpkg.com/ecdsa-sig-formatter/-/ecdsa-sig-formatter-1.0.11.tgz#ae0f0fa2d85045ef14a817daa3ce9acd0489e5bf"
integrity sha512-nagl3RYrbNv6kQkeJIpt6NJZy8twLB/2vtz6yN9Z4vRKHN4/QZJIEbqohALSgwKdnksuY3k5Addp5lg8sVoVcQ==
dependencies:
safe-buffer "^5.0.1"

edit-json-file@1.7.0:
version "1.7.0"
resolved "https://registry.yarnpkg.com/edit-json-file/-/edit-json-file-1.7.0.tgz#b0bfb626169890568c2668369a8e5202f5c49150"
integrity sha512-eIkLJ9i4ija7b2TbaLHy3scyjWFLzwM2Wa6kHbV4ppVLcCqn7FzqnO1vmCG3dLrkd+teWE3mvACfv166mO0VZg==
dependencies:
find-value "^1.0.12"
iterate-object "^1.3.4"
r-json "^1.2.10"
set-value "^4.1.0"
w-json "^1.3.10"

electron-to-chromium@^1.3.723:
version "1.3.743"
resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.743.tgz#fcec24d6d647cb84fd796b42caa1b4039a180894"
Expand Down Expand Up @@ -2533,6 +2564,11 @@ find-up@^3.0.0:
dependencies:
locate-path "^3.0.0"

find-value@^1.0.12:
version "1.0.12"
resolved "https://registry.yarnpkg.com/find-value/-/find-value-1.0.12.tgz#68b6cec84e5b2d51272965e0bf09b26c9159c26e"
integrity sha512-OCpo8LTk8eZ2sdDCwbU2Lc3ivYsdM6yod6jP2jHcNEFcjPhkgH0+POzTIol7xx1LZgtbI5rkO5jqxsG5MWtPjQ==

flat-cache@^3.0.4:
version "3.0.4"
resolved "https://registry.yarnpkg.com/flat-cache/-/flat-cache-3.0.4.tgz#61b0338302b2fe9f957dcc32fc2a87f1c3048b11"
Expand Down Expand Up @@ -3144,13 +3180,18 @@ is-path-inside@^3.0.1:
resolved "https://registry.yarnpkg.com/is-path-inside/-/is-path-inside-3.0.3.tgz#d231362e53a07ff2b0e0ea7fed049161ffd16283"
integrity sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==

is-plain-object@^2.0.3, is-plain-object@^2.0.4:
is-plain-object@^2.0.4:
version "2.0.4"
resolved "https://registry.yarnpkg.com/is-plain-object/-/is-plain-object-2.0.4.tgz#2c163b3fafb1b606d9d17928f05c2a1c38e07677"
integrity sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==
dependencies:
isobject "^3.0.1"

is-primitive@^3.0.1:
version "3.0.1"
resolved "https://registry.yarnpkg.com/is-primitive/-/is-primitive-3.0.1.tgz#98c4db1abff185485a657fc2905052b940524d05"
integrity sha512-GljRxhWvlCNRfZyORiH77FwdFwGcMO620o37EOYC0ORWdq+WYNVqW0w2Juzew4M+L81l6/QS3t5gkkihyRqv9w==

is-regex@^1.1.4:
version "1.1.4"
resolved "https://registry.yarnpkg.com/is-regex/-/is-regex-1.1.4.tgz#eef5663cd59fa4c0ae339505323df6854bb15958"
Expand Down Expand Up @@ -3217,10 +3258,16 @@ isexe@^2.0.0:
resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10"
integrity sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=

isobject@^2.0.0:
version "2.1.0"
resolved "https://registry.yarnpkg.com/isobject/-/isobject-2.1.0.tgz#f065561096a3f1da2ef46272f815c840d87e0c89"
integrity sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk=
isobject@^3.0.1:
version "3.0.1"
resolved "https://registry.yarnpkg.com/isobject/-/isobject-3.0.1.tgz#4e431e92b11a9731636aa1f9c8d1ccbcfdab78df"
integrity sha1-TkMekrEalzFjaqH5yNHMvP2reN8=

isomorphic-fetch@^3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/isomorphic-fetch/-/isomorphic-fetch-3.0.0.tgz#0267b005049046d2421207215d45d6a262b8b8b4"
integrity sha512-qvUtwJ3j6qwsF3jLxkZ72qCgjMysPzDfeV240JHiGZsANBYd+EEuu35v7dfrJ9Up0Ak07D7GGSkGhCHTqg/5wA==

dependencies:
isarray "1.0.0"

Expand All @@ -3229,6 +3276,11 @@ isobject@^3.0.0, isobject@^3.0.1:
resolved "https://registry.yarnpkg.com/isobject/-/isobject-3.0.1.tgz#4e431e92b11a9731636aa1f9c8d1ccbcfdab78df"
integrity sha1-TkMekrEalzFjaqH5yNHMvP2reN8=

iterate-object@^1.3.4:
version "1.3.4"
resolved "https://registry.yarnpkg.com/iterate-object/-/iterate-object-1.3.4.tgz#fa50b1d9e58e340a7dd6b4c98c8a5e182e790096"
integrity sha512-4dG1D1x/7g8PwHS9aK6QV5V94+ZvyP4+d19qDv43EzImmrndysIl4prmJ1hWWIGCqrZHyaHBm6BSEWHOLnpoNw==

js-message@1.0.7:
version "1.0.7"
resolved "https://registry.yarnpkg.com/js-message/-/js-message-1.0.7.tgz#fbddd053c7a47021871bb8b2c95397cc17c20e47"
Expand Down Expand Up @@ -4049,6 +4101,11 @@ queue-microtask@^1.2.2:
resolved "https://registry.yarnpkg.com/queue-microtask/-/queue-microtask-1.2.3.tgz#4929228bbc724dfac43e0efb058caf7b6cfb6243"
integrity sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==

r-json@^1.2.10:
version "1.2.10"
resolved "https://registry.yarnpkg.com/r-json/-/r-json-1.2.10.tgz#62a73d9cafa7eabf670e5c2812c27bdb220a968b"
integrity sha512-hu9vyLjSlHXT62NAS7DjI9WazDlvjN0lgp3n431dCVnirVcLkZIpzSwA3orhZEKzdDD2jqNYI+w0yG0aFf4kpA==

read-file-relative@^1.2.0:
version "1.2.0"
resolved "https://registry.yarnpkg.com/read-file-relative/-/read-file-relative-1.2.0.tgz#98f7d96eaa21d2b4c7a2febd63d2fc8cf35e9f9b"
Expand Down Expand Up @@ -4315,15 +4372,13 @@ semver@^7.2.1, semver@^7.3.5:
dependencies:
lru-cache "^6.0.0"

set-value@^2.0.0, set-value@^2.0.1:
version "2.0.1"
resolved "https://registry.yarnpkg.com/set-value/-/set-value-2.0.1.tgz#a18d40530e6f07de4228c7defe4227af8cad005b"
integrity sha512-JxHc1weCN68wRY0fhCoXpyK55m/XPHafOmK4UWD7m2CI14GMcFypt4w/0+NV5f/ZMby2F6S2wwA7fgynh9gWSw==
set-value@^4.1.0:
version "4.1.0"
resolved "https://registry.yarnpkg.com/set-value/-/set-value-4.1.0.tgz#aa433662d87081b75ad88a4743bd450f044e7d09"
integrity sha512-zTEg4HL0RwVrqcWs3ztF+x1vkxfm0lP+MQQFPiMJTKVceBwEV0A569Ou8l9IYQG8jOZdMVI1hGsc0tmeD2o/Lw==
dependencies:
extend-shallow "^2.0.1"
is-extendable "^0.1.1"
is-plain-object "^2.0.3"
split-string "^3.0.1"
is-plain-object "^2.0.4"
is-primitive "^3.0.1"

shebang-command@^2.0.0:
version "2.0.0"
Expand Down Expand Up @@ -5120,6 +5175,11 @@ validate-npm-package-license@^3.0.1:
spdx-correct "^3.0.0"
spdx-expression-parse "^3.0.0"

w-json@^1.3.10:
version "1.3.10"
resolved "https://registry.yarnpkg.com/w-json/-/w-json-1.3.10.tgz#ac448a19ca22376e2753a684b52369c7b1e83313"
integrity sha512-XadVyw0xE+oZ5FGApXsdswv96rOhStzKqL53uSe5UaTadABGkWIg1+DTx8kiZ/VqTZTBneoL0l65RcPe4W3ecw==

webauth@^1.1.0:
version "1.1.0"
resolved "https://registry.yarnpkg.com/webauth/-/webauth-1.1.0.tgz#64704f6b8026986605bc3ca629952e6e26fdd100"
Expand Down