|
| 1 | +import { join } from 'path'; |
| 2 | +import * as os from 'os'; |
| 3 | +import { Chance } from 'chance'; |
| 4 | +import * as editJsonFile from 'edit-json-file'; |
1 | 5 | import { acceptLicenseTerms } from '../../../helpers/database';
|
2 | 6 | import { MyRedisDatabasePage } from '../../../pageObjects';
|
3 | 7 | import { commonUrl } from '../../../helpers/conf';
|
4 | 8 | 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'; |
9 | 9 |
|
10 | 10 | const myRedisDatabasePage = new MyRedisDatabasePage();
|
11 | 11 | const chance = new Chance();
|
12 | 12 |
|
13 | 13 | 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')); |
15 | 15 | const buildPath = `${workingDirectory}/content/build.json`;
|
16 | 16 | const createRedisPath = `${workingDirectory}/content/create-redis.json`;
|
17 | 17 | const buildFilePath = editJsonFile(buildPath);
|
18 | 18 | const createRedisFilePath = editJsonFile(createRedisPath);
|
19 |
| -const timestampBeforeUpdate = buildFilePath.get("timestamp"); |
| 19 | +const timestampBeforeUpdate = buildFilePath.get('timestamp'); |
20 | 20 | const timestampForEdit = timestampBeforeUpdate - 1;
|
21 | 21 | const cloudValueForEdit = chance.word({ length: 10 });
|
22 | 22 |
|
| 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 | + |
23 | 30 | fixture `Automatically update information`
|
24 | 31 | .meta({type: 'critical_path'})
|
25 | 32 | .page(commonUrl)
|
26 |
| - .beforeEach(async () => { |
| 33 | + .beforeEach(async() => { |
27 | 34 | 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 | + }); |
35 | 36 | 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 |
39 | 39 | const buildFilePathNew = editJsonFile(buildPath);
|
40 | 40 | const createRedisFilePathNew = editJsonFile(createRedisPath);
|
41 | 41 | //Check the promo button after the opening of app
|
|
0 commit comments