Skip to content

Commit 82c7fe3

Browse files
authored
Merge pull request #2472 from RedisInsight/e2e/feature/RI-4806-sso-feature-flag
E2e/feature/ri 4806 sso feature flag
2 parents fbef054 + 1df2090 commit 82c7fe3

File tree

7 files changed

+179
-4
lines changed

7 files changed

+179
-4
lines changed

tests/e2e/pageObjects/components/bottom-panel/cli.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ export class Cli {
167167
*/
168168
async getWarningMessageText(command: string): Promise<string> {
169169

170-
const executedCommand = await this.cliCommandExecuted.withExactText(command);
170+
const executedCommand = await this.cliCommandExecuted.withExactText(command);
171171
return await executedCommand.nextSibling(0).textContent;
172172
}
173173

@@ -176,6 +176,6 @@ export class Cli {
176176
* @param index index of the command in the CLI, by default is the last one
177177
*/
178178
async getExecutedCommandTextByIndex(index = -1): Promise<string> {
179-
return await this.cliCommandExecuted.nth(index).textContent;
179+
return await this.cliCommandExecuted.nth(index).textContent;
180180
}
181181
}

tests/e2e/pageObjects/components/myRedisDatabase/add-redis-database.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,8 @@ export class AddRedisDatabase {
5858
caCertField = Selector('[data-testid=select-ca-cert]', { timeout: 500 });
5959
clientCertField = Selector('[data-testid=select-cert]', { timeout: 500 });
6060
selectCompressor = Selector('[data-testid=select-compressor]', { timeout: 1000 });
61+
useCloudAccount = Selector('[data-testid=use-cloud-account-accordion]');
62+
useCloudKeys = Selector('[data-testid=use-cloud-keys-accordion]');
6163
// CHECKBOXES
6264
useSSHCheckbox = Selector('[data-testid=use-ssh]~div', { timeout: 500 });
6365
dataCompressorCheckbox = Selector('[data-testid=showCompressor] ~ label');
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
{
2+
"version": 11,
3+
"features": {
4+
"insightsRecommendations": {
5+
"flag": true,
6+
"perc": [[44,50]],
7+
"filters": [
8+
{
9+
"name": "agreements.analytics",
10+
"value": true,
11+
"cond": "eq"
12+
},
13+
{
14+
"name": "config.server.buildType",
15+
"value": "DOCKER_ON_PREMISE",
16+
"cond": "eq"
17+
}
18+
]
19+
},
20+
"cloudSso": {
21+
"flag": true,
22+
"perc": [[44,50]],
23+
"filters": [
24+
{
25+
"name": "agreements.analytics",
26+
"value": true,
27+
"cond": "eq"
28+
},
29+
{
30+
"name": "config.server.buildType",
31+
"value": "DOCKER_ON_PREMISE",
32+
"cond": "eq"
33+
}
34+
],
35+
"data": {
36+
"selectPlan": {
37+
"components": {
38+
"triggersAndFunctions": [
39+
{
40+
"provider": "AWS",
41+
"regions": ["ap-southeast-1"]
42+
},
43+
{
44+
"provider": "GCP",
45+
"regions": ["asia-northeast1"]
46+
}
47+
]
48+
}
49+
}
50+
}
51+
}
52+
}
53+
}
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
{
2+
"version": 20,
3+
"features": {
4+
"insightsRecommendations": {
5+
"flag": true,
6+
"perc": [[44,50]],
7+
"filters": [
8+
{
9+
"name": "config.server.buildType",
10+
"value": "ELECTRON",
11+
"cond": "eq"
12+
}
13+
]
14+
},
15+
"cloudSso": {
16+
"flag": true,
17+
"perc": [[44,50]],
18+
"filters": [
19+
{
20+
"name": "config.server.buildType",
21+
"value": "ELECTRON",
22+
"cond": "eq"
23+
}
24+
],
25+
"data": {
26+
"selectPlan": {
27+
"components": {
28+
"triggersAndFunctions": [
29+
{
30+
"provider": "AWS",
31+
"regions": ["ap-southeast-1"]
32+
},
33+
{
34+
"provider": "GCP",
35+
"regions": ["asia-northeast1"]
36+
}
37+
]
38+
}
39+
}
40+
}
41+
}
42+
}
43+
}

tests/e2e/tests/critical-path/triggers-and-functions/libraries.e2e.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import {
66
TriggersAndFunctionsLibrariesPage
77
} from '../../../pageObjects';
88
import { commonUrl, ossStandaloneRedisGears } from '../../../helpers/conf';
9-
import { rte } from '../../../helpers/constants';
9+
import { rte } from '../../../helpers/constants';
1010
import { DatabaseAPIRequests } from '../../../helpers/api/api-database';
1111
import { Common } from '../../../helpers/common';
1212

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
import * as path from 'path';
2+
import { MyRedisDatabasePage, WelcomePage } from '../../../pageObjects';
3+
import { rte, env } from '../../../helpers/constants';
4+
import { DatabaseHelper } from '../../../helpers/database';
5+
import { commonUrl } from '../../../helpers/conf';
6+
import { DatabaseAPIRequests } from '../../../helpers/api/api-database';
7+
import { deleteRowsFromTableInDB } from '../../../helpers/database-scripts';
8+
import { modifyFeaturesConfigJson, refreshFeaturesTestData, updateControlNumber } from '../../../helpers/insights';
9+
10+
const myRedisDatabasePage = new MyRedisDatabasePage();
11+
const databaseHelper = new DatabaseHelper();
12+
const databaseAPIRequests = new DatabaseAPIRequests();
13+
const welcomePage = new WelcomePage();
14+
15+
const featuresConfigTable = 'features_config';
16+
const pathes = {
17+
defaultRemote: path.join('.', 'test-data', 'features-configs', 'insights-default-remote.json'),
18+
dockerConfig: path.join('.', 'test-data', 'features-configs', 'sso-docker-build.json'),
19+
electronConfig: path.join('.', 'test-data', 'features-configs', 'sso-electron-build.json')
20+
};
21+
22+
fixture `Cloud SSO`
23+
.meta({ type: 'regression', rte: rte.standalone })
24+
.page(commonUrl)
25+
.beforeEach(async() => {
26+
await databaseAPIRequests.deleteAllDatabasesApi();
27+
await refreshFeaturesTestData();
28+
await databaseHelper.acceptLicenseTerms();
29+
})
30+
.afterEach(async() => {
31+
// Delete database
32+
await databaseAPIRequests.deleteAllDatabasesApi();
33+
await refreshFeaturesTestData();
34+
});
35+
test
36+
.meta({ env: env.web })('Verify that user can not see the import Cloud databases on the Welcome screen for docker build', async t => {
37+
// Update remote config .json to config with buildType filter excluding current app build
38+
await modifyFeaturesConfigJson(pathes.dockerConfig);
39+
await updateControlNumber(48.2);
40+
await t.expect(welcomePage.importCloudDbBtn.exists).notOk('Import Cloud database button displayed for docker build');
41+
42+
// Verify that user can not see the import Cloud databases on the Auto-discovery flow for docker build
43+
await t.click(welcomePage.addDbAutoBtn);
44+
// Verify that when SSO flag disabled - Use Cloud API Keys displayed not as dropdown
45+
await t.expect(myRedisDatabasePage.AddRedisDatabase.useCloudAccount.exists).notOk('Use Cloud Account accordion displayed for docker build');
46+
await t.expect(myRedisDatabasePage.AddRedisDatabase.useCloudKeys.exists).notOk('Use Cloud Keys accordion displayed for docker build');
47+
});
48+
test
49+
.meta({ env: env.desktop })
50+
.before(async() => {
51+
await databaseAPIRequests.deleteAllDatabasesApi();
52+
await databaseHelper.acceptLicenseTerms();
53+
})
54+
.after(async() => {
55+
await databaseAPIRequests.deleteAllDatabasesApi();
56+
await myRedisDatabasePage.reloadPage();
57+
// Update remote config .json to default
58+
await modifyFeaturesConfigJson(pathes.defaultRemote);
59+
// Clear features config table
60+
await deleteRowsFromTableInDB(featuresConfigTable);
61+
})('Verify that user can see SSO feature if it is enabled in feature config', async t => {
62+
// Update remote config .json to config with buildType filter excluding current app build
63+
await modifyFeaturesConfigJson(pathes.dockerConfig);
64+
await updateControlNumber(48.2);
65+
// Verify that user can't see SSO feature if it is disabled in feature config
66+
await t.expect(welcomePage.importCloudDbBtn.exists).notOk('Import Cloud database button displayed when SSO feature disabled');
67+
68+
// Update remote config .json to config with buildType filter including current app build
69+
await modifyFeaturesConfigJson(pathes.electronConfig);
70+
await updateControlNumber(48.2);
71+
await t.expect(welcomePage.importCloudDbBtn.exists).ok('Import Cloud database button not displayed when SSO feature enabled');
72+
73+
await t.click(welcomePage.addDbAutoBtn);
74+
// Verify that RE Cloud auto-discovery options Use Cloud Account and Use Cloud API Keys are displayed on Welcome screen
75+
await t.expect(myRedisDatabasePage.AddRedisDatabase.useCloudAccount.exists).ok('Use Cloud Account accordion not displayed when SSO feature enabled');
76+
await t.expect(myRedisDatabasePage.AddRedisDatabase.useCloudKeys.exists).ok('Use Cloud Keys accordion not displayed when SSO feature enabled');
77+
});

tests/e2e/tests/smoke/database/add-db-from-welcome-page.e2e.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,6 @@ test.skip
5252
await t.expect(getPageUrl()).eql(homebrewPage, 'Build from homebrew page is not valid');
5353
await t.switchToParentWindow();
5454
// Verify promo button link
55-
await t.click(welcomePage.tryRedisCloudButton);
55+
await t.click(welcomePage.tryRedisCloudBtn);
5656
await t.expect(getPageUrl()).eql(promoPage, 'Promotion link is not valid');
5757
});

0 commit comments

Comments
 (0)