1
1
import * as path from 'path' ;
2
- import { BrowserPage , MyRedisDatabasePage , SettingsPage , WelcomePage } from '../../../pageObjects' ;
3
- import { RecommendationIds , rte , env } from '../../../helpers/constants' ;
2
+ import { MyRedisDatabasePage , WelcomePage } from '../../../pageObjects' ;
3
+ import { rte , env } from '../../../helpers/constants' ;
4
4
import { DatabaseHelper } from '../../../helpers/database' ;
5
- import { commonUrl , ossStandaloneConfig , ossStandaloneV5Config } from '../../../helpers/conf' ;
5
+ import { commonUrl } from '../../../helpers/conf' ;
6
6
import { DatabaseAPIRequests } from '../../../helpers/api/api-database' ;
7
- import { deleteRowsFromTableInDB , getColumnValueFromTableInDB } from '../../../helpers/database-scripts' ;
7
+ import { deleteRowsFromTableInDB } from '../../../helpers/database-scripts' ;
8
8
import { modifyFeaturesConfigJson , refreshFeaturesTestData , updateControlNumber } from '../../../helpers/insights' ;
9
- import { Common } from '../../../helpers/common' ;
10
9
11
10
const myRedisDatabasePage = new MyRedisDatabasePage ( ) ;
12
- const browserPage = new BrowserPage ( ) ;
13
- const settingsPage = new SettingsPage ( ) ;
14
11
const databaseHelper = new DatabaseHelper ( ) ;
15
12
const databaseAPIRequests = new DatabaseAPIRequests ( ) ;
16
13
const welcomePage = new WelcomePage ( ) ;
@@ -27,33 +24,24 @@ fixture `Cloud SSO`
27
24
. page ( commonUrl )
28
25
. beforeEach ( async ( ) => {
29
26
await databaseAPIRequests . deleteAllDatabasesApi ( ) ;
27
+ await refreshFeaturesTestData ( ) ;
30
28
await databaseHelper . acceptLicenseTerms ( ) ;
31
- // await myRedisDatabasePage.reloadPage();
32
29
} )
33
30
. afterEach ( async ( ) => {
34
31
// Delete database
35
32
await databaseAPIRequests . deleteAllDatabasesApi ( ) ;
36
- await myRedisDatabasePage . reloadPage ( ) ;
37
- // Update remote config .json to default
38
- await modifyFeaturesConfigJson ( pathes . defaultRemote ) ;
39
- // Clear features config table
40
- await deleteRowsFromTableInDB ( featuresConfigTable ) ;
33
+ await refreshFeaturesTestData ( ) ;
41
34
} ) ;
42
35
test
43
36
. meta ( { env : env . web } )
44
37
. before ( async ( ) => {
45
38
await databaseAPIRequests . deleteAllDatabasesApi ( ) ;
39
+ await refreshFeaturesTestData ( ) ;
46
40
await databaseHelper . acceptLicenseTerms ( ) ;
47
-
48
- // await myRedisDatabasePage.reloadPage();
49
41
} )
50
42
. after ( async ( ) => {
51
43
await databaseAPIRequests . deleteAllDatabasesApi ( ) ;
52
- await myRedisDatabasePage . reloadPage ( ) ;
53
- // Update remote config .json to default
54
- await modifyFeaturesConfigJson ( pathes . defaultRemote ) ;
55
- // Clear features config table
56
- await deleteRowsFromTableInDB ( featuresConfigTable ) ;
44
+ await refreshFeaturesTestData ( ) ;
57
45
} ) ( 'Verify that user can not see the import Cloud databases on the Welcome screen for docker build' , async t => {
58
46
// Update remote config .json to config with buildType filter excluding current app build
59
47
await modifyFeaturesConfigJson ( pathes . dockerConfig ) ;
64
52
await t . click ( welcomePage . addDbAutoBtn ) ;
65
53
await t . expect ( myRedisDatabasePage . AddRedisDatabase . useCloudAccount . exists ) . notOk ( 'Use Cloud Account accordion displayed for docker build' ) ;
66
54
await t . expect ( myRedisDatabasePage . AddRedisDatabase . useCloudKeys . exists ) . notOk ( 'Use Cloud Keys accordion displayed for docker build' ) ;
67
- } ) ;
55
+ } ) ;
56
+ test
57
+ . meta ( { env : env . desktop } )
58
+ . before ( async ( ) => {
59
+ await databaseAPIRequests . deleteAllDatabasesApi ( ) ;
60
+ await databaseHelper . acceptLicenseTerms ( ) ;
61
+ } )
62
+ . after ( async ( ) => {
63
+ await databaseAPIRequests . deleteAllDatabasesApi ( ) ;
64
+ await myRedisDatabasePage . reloadPage ( ) ;
65
+ // Update remote config .json to default
66
+ await modifyFeaturesConfigJson ( pathes . defaultRemote ) ;
67
+ // Clear features config table
68
+ await deleteRowsFromTableInDB ( featuresConfigTable ) ;
69
+ } ) ( 'Verify that user can see SSO feature if it is enabled in feature config' , async t => {
70
+ // Update remote config .json to config with buildType filter excluding current app build
71
+ await modifyFeaturesConfigJson ( pathes . dockerConfig ) ;
72
+ await updateControlNumber ( 48.2 ) ;
73
+ // Verify that user can't see SSO feature if it is disabled in feature config
74
+ await t . expect ( welcomePage . importCloudDbBtn . exists ) . notOk ( 'Import Cloud database button displayed when SSO feature disabled' ) ;
75
+
76
+ // Update remote config .json to config with buildType filter including current app build
77
+ await modifyFeaturesConfigJson ( pathes . electronConfig ) ;
78
+ await updateControlNumber ( 48.2 ) ;
79
+ await t . expect ( welcomePage . importCloudDbBtn . exists ) . ok ( 'Import Cloud database button not displayed when SSO feature enabled' ) ;
80
+
81
+ await t . click ( welcomePage . addDbAutoBtn ) ;
82
+ await t . expect ( myRedisDatabasePage . AddRedisDatabase . useCloudAccount . exists ) . ok ( 'Use Cloud Account accordion not displayed when SSO feature enabled' ) ;
83
+ await t . expect ( myRedisDatabasePage . AddRedisDatabase . useCloudKeys . exists ) . ok ( 'Use Cloud Keys accordion not displayed when SSO feature enabled' ) ;
84
+ } ) ;
0 commit comments