1
+ import * as path from 'path' ;
2
+ import { BrowserPage , MyRedisDatabasePage , SettingsPage , WelcomePage } from '../../../pageObjects' ;
3
+ import { RecommendationIds , rte , env } from '../../../helpers/constants' ;
4
+ import { DatabaseHelper } from '../../../helpers/database' ;
5
+ import { commonUrl , ossStandaloneConfig , ossStandaloneV5Config } from '../../../helpers/conf' ;
6
+ import { DatabaseAPIRequests } from '../../../helpers/api/api-database' ;
7
+ import { deleteRowsFromTableInDB , getColumnValueFromTableInDB } from '../../../helpers/database-scripts' ;
8
+ import { modifyFeaturesConfigJson , refreshFeaturesTestData , updateControlNumber } from '../../../helpers/insights' ;
9
+ import { Common } from '../../../helpers/common' ;
10
+
11
+ const myRedisDatabasePage = new MyRedisDatabasePage ( ) ;
12
+ const browserPage = new BrowserPage ( ) ;
13
+ const settingsPage = new SettingsPage ( ) ;
14
+ const databaseHelper = new DatabaseHelper ( ) ;
15
+ const databaseAPIRequests = new DatabaseAPIRequests ( ) ;
16
+ const welcomePage = new WelcomePage ( ) ;
17
+
18
+ const featuresConfigTable = 'features_config' ;
19
+ const pathes = {
20
+ defaultRemote : path . join ( '.' , 'test-data' , 'features-configs' , 'insights-default-remote.json' ) ,
21
+ dockerConfig : path . join ( '.' , 'test-data' , 'features-configs' , 'sso-docker-build.json' ) ,
22
+ electronConfig : path . join ( '.' , 'test-data' , 'features-configs' , 'sso-electron-build.json' )
23
+ } ;
24
+
25
+ fixture `Cloud SSO`
26
+ . meta ( { type : 'regression' , rte : rte . standalone } )
27
+ . page ( commonUrl )
28
+ . beforeEach ( async ( ) => {
29
+ await databaseAPIRequests . deleteAllDatabasesApi ( ) ;
30
+ await databaseHelper . acceptLicenseTerms ( ) ;
31
+ // await myRedisDatabasePage.reloadPage();
32
+ } )
33
+ . afterEach ( async ( ) => {
34
+ // Delete database
35
+ 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 ) ;
41
+ } ) ;
42
+ test
43
+ . meta ( { env : env . web } )
44
+ . before ( async ( ) => {
45
+ await databaseAPIRequests . deleteAllDatabasesApi ( ) ;
46
+ await databaseHelper . acceptLicenseTerms ( ) ;
47
+
48
+ // await myRedisDatabasePage.reloadPage();
49
+ } )
50
+ . after ( async ( ) => {
51
+ 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 ) ;
57
+ } ) ( 'Verify that user can not see the import Cloud databases on the Welcome screen for docker build' , async t => {
58
+ // Update remote config .json to config with buildType filter excluding current app build
59
+ await modifyFeaturesConfigJson ( pathes . dockerConfig ) ;
60
+ await updateControlNumber ( 48.2 ) ;
61
+ await t . expect ( welcomePage . importCloudDbBtn . exists ) . notOk ( 'Import Cloud database button displayed for docker build' ) ;
62
+
63
+ // Verify that user can not see the import Cloud databases on the Auto-discovery flow for docker build
64
+ await t . click ( welcomePage . addDbAutoBtn ) ;
65
+ await t . expect ( myRedisDatabasePage . AddRedisDatabase . useCloudAccount . exists ) . notOk ( 'Use Cloud Account accordion displayed for docker build' ) ;
66
+ await t . expect ( myRedisDatabasePage . AddRedisDatabase . useCloudKeys . exists ) . notOk ( 'Use Cloud Keys accordion displayed for docker build' ) ;
67
+ } ) ;
0 commit comments