Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion tests/e2e/pageObjects/browser-page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ export class BrowserPage extends InstancePage {
listElementsList = Selector('[data-testid^=list-element-value-]');
jsonKeyValue = Selector('[data-testid=json-data]');
jsonError = Selector('[data-testid=edit-json-error]');
tooltip = Selector('[role=tooltip]');
tooltip = Selector('[role=tooltip]', { timeout: 500 });
noResultsFound = Selector('[data-test-subj=no-result-found]');
noResultsFoundOnly = Selector('[data-testid=no-result-found-only]');
searchAdvices = Selector('[data-test-subj=search-advices]');
Expand Down
66 changes: 66 additions & 0 deletions tests/e2e/tests/web/regression/url-handling/url-handling.e2e.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
import { commonUrl, ossStandaloneRedisGears } from '../../../../helpers/conf';
import { rte } from '../../../../helpers/constants';
import { DatabaseAPIRequests } from '../../../../helpers/api/api-database';
import { Common } from '../../../../helpers/common';
import { MyRedisDatabasePage } from '../../../../pageObjects';
import { DatabaseHelper } from '../../../../helpers/database';
import { BrowserActions } from '../../../../common-actions/browser-actions';

const myRedisDatabasePage = new MyRedisDatabasePage();
const browserActions = new BrowserActions();

const databaseAPIRequests = new DatabaseAPIRequests();
const databaseHelper = new DatabaseHelper();

let { host, port, databaseName, databaseUsername = '', databasePassword = '' } = ossStandaloneRedisGears;

function generateLink(params: Record<string, any>): string {
const params1 = Common.generateUrlTParams(params);
const from = encodeURIComponent(`${redisConnect}?${params1}`);
return (new URL(`?from=${from}`, commonUrl)).toString();
}

const redisConnect = 'redisinsight://databases/connect';

fixture `Add DB from SM`
.meta({ type: 'critical_path', rte: rte.none })
.afterEach(async() => {
// Delete all existing connections
await databaseAPIRequests.deleteAllDatabasesApi();
})
.beforeEach(async() => {
await databaseHelper.acceptLicenseTerms();
});
test
.page(commonUrl)('Tls dropdown', async t => {
const connectUrlParams = {
redisUrl: `redis://${databaseUsername}:${databasePassword}@${host}:${port}`,
databaseAlias: databaseName,
redirect: 'workbench',
requiredCaCert: 'true',
requiredClientCert: 'true'
};

const tooltipText = [
'CA Certificate Name',
'CA certificate',
'Client Certificate Name',
'Client Certificate',
'Private Key'
];

await t.navigateTo(generateLink(connectUrlParams));
await t.expect(myRedisDatabasePage.AddRedisDatabase.caCertField.textContent).contains('Add new CA certificate', 'add CA certificate is not shown');
await t.expect(myRedisDatabasePage.AddRedisDatabase.clientCertField.textContent).contains('Add new certificate', 'add client certificate is not shown');
await t.hover(myRedisDatabasePage.AddRedisDatabase.addRedisDatabaseButton);

for (const text of tooltipText) {
await browserActions.verifyTooltipContainsText(text, true);
}

// Verify that user can see the Test Connection button enabled/disabled with the same rules as the button to add/apply the changes
await t.hover(myRedisDatabasePage.AddRedisDatabase.testConnectionBtn);
for (const text of tooltipText) {
await browserActions.verifyTooltipContainsText(text, true);
}
});