Skip to content

Commit 42ad43e

Browse files
fix autoupdate test
1 parent 655efa4 commit 42ad43e

File tree

1 file changed

+17
-17
lines changed

1 file changed

+17
-17
lines changed

tests/e2e/tests/critical-path/database/autoupdate-of-json.e2e.ts

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,41 @@
1+
import { join } from 'path';
2+
import * as os from 'os';
3+
import { Chance } from 'chance';
4+
import * as editJsonFile from 'edit-json-file';
15
import { acceptLicenseTerms } from '../../../helpers/database';
26
import { MyRedisDatabasePage } from '../../../pageObjects';
37
import { commonUrl } from '../../../helpers/conf';
48
import { rte, env } from '../../../helpers/constants';
5-
import { Chance } from 'chance';
6-
import { join } from 'path';
7-
import * as os from 'os';
8-
import * as editJsonFile from 'edit-json-file';
99

1010
const myRedisDatabasePage = new MyRedisDatabasePage();
1111
const chance = new Chance();
1212

1313
const workingDirectory = process.env.APP_FOLDER_ABSOLUTE_PATH
14-
|| (join(os.homedir(), process.env.APP_FOLDER_NAME || '.redisinsight-v2'));
14+
|| (join(os.homedir(), process.env.APP_FOLDER_NAME || '.redisinsight-v2-stage'));
1515
const buildPath = `${workingDirectory}/content/build.json`;
1616
const createRedisPath = `${workingDirectory}/content/create-redis.json`;
1717
const buildFilePath = editJsonFile(buildPath);
1818
const createRedisFilePath = editJsonFile(createRedisPath);
19-
const timestampBeforeUpdate = buildFilePath.get("timestamp");
19+
const timestampBeforeUpdate = buildFilePath.get('timestamp');
2020
const timestampForEdit = timestampBeforeUpdate - 1;
2121
const cloudValueForEdit = chance.word({ length: 10 });
2222

23+
//Edit json file values
24+
createRedisFilePath.set('cloud.title', cloudValueForEdit);
25+
createRedisFilePath.set('cloud.description', cloudValueForEdit);
26+
createRedisFilePath.save();
27+
buildFilePath.set('timestamp', timestampForEdit);
28+
buildFilePath.save();
29+
2330
fixture `Automatically update information`
2431
.meta({type: 'critical_path'})
2532
.page(commonUrl)
26-
.beforeEach(async () => {
33+
.beforeEach(async() => {
2734
await acceptLicenseTerms();
28-
//Edit json file values
29-
createRedisFilePath.set('cloud.title', cloudValueForEdit);
30-
createRedisFilePath.set('cloud.description', cloudValueForEdit);
31-
createRedisFilePath.save();
32-
buildFilePath.set('timestamp', timestampForEdit);
33-
buildFilePath.save();
34-
})
35+
});
3536
test
36-
.meta({ rte: rte.standalone, env: env.desktop })
37-
('Verify that user has the ability to update "Create free database" button without changing the app', async t => {
38-
//Create new file paths due to cacheability
37+
.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 => {
38+
//Create new file paths due to cache-ability
3939
const buildFilePathNew = editJsonFile(buildPath);
4040
const createRedisFilePathNew = editJsonFile(createRedisPath);
4141
//Check the promo button after the opening of app

0 commit comments

Comments
 (0)