Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 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/common-actions/workbench-actions.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {t, Selector} from 'testcafe';
import { t, Selector } from 'testcafe';
import { WorkbenchPage } from '../pageObjects';

const workbenchPage = new WorkbenchPage();
Expand Down
8 changes: 4 additions & 4 deletions tests/e2e/desktop.runner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,16 @@ import testcafe from 'testcafe';
return t
.createRunner()
.compilerOptions({
"typescript": {
'typescript': {
configPath: 'tsconfig.testcafe.json',
experimentalDecorators: true
}})
} })
.src((process.env.TEST_FILES || 'tests/electron/**/*.e2e.ts').split('\n'))
.browsers(['electron'])
.screenshots({
path: './report/screenshots/',
takeOnFails: true,
pathPattern: '${USERAGENT}/${DATE}_${TIME}/${FIXTURE}_${TEST}_${FILE_INDEX}.png',
pathPattern: '${USERAGENT}/${DATE}_${TIME}/${FIXTURE}_${TEST}_${FILE_INDEX}.png'
})
.reporter([
'spec',
Expand Down Expand Up @@ -46,7 +46,7 @@ import testcafe from 'testcafe';
process.exit(failedCount);
})
.catch((e) => {
console.error(e)
console.error(e);
process.exit(1);
});
})();
6 changes: 3 additions & 3 deletions tests/e2e/desktop.runner.win.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,16 @@ import testcafe from 'testcafe';
return t
.createRunner()
.compilerOptions({
"typescript": {
'typescript': {
configPath: 'tsconfig.testcafe.json',
experimentalDecorators: true
}})
} })
.src((process.env.TEST_FILES || 'tests/electron/**/*.e2e.ts').split('\n'))
.browsers(['electron'])
.screenshots({
path: 'report/screenshots/',
takeOnFails: true,
pathPattern: '${USERAGENT}/${DATE}_${TIME}/${FIXTURE}_${TEST}_${FILE_INDEX}.png',
pathPattern: '${USERAGENT}/${DATE}_${TIME}/${FIXTURE}_${TEST}_${FILE_INDEX}.png'
})
.reporter([
'spec',
Expand Down
30 changes: 15 additions & 15 deletions tests/e2e/helpers/api/api-database.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,28 +27,28 @@ export class DatabaseAPIRequests {
): Promise<void> {
const uniqueId = chance.string({ length: 10 });
const requestBody: {
name?: string;
host: string;
port: number;
username?: string;
password?: string;
tls?: boolean;
verifyServerCert?: boolean;
name?: string,
host: string,
port: number,
username?: string,
password?: string,
tls?: boolean,
verifyServerCert?: boolean,
caCert?: {
name: string;
certificate?: string;
};
name: string,
certificate?: string
},
clientCert?: {
name: string;
certificate?: string;
key?: string;
};
name: string,
certificate?: string,
key?: string
}
} = {
name: databaseParameters.databaseName,
host: databaseParameters.host,
port: Number(databaseParameters.port),
username: databaseParameters.databaseUsername,
password: databaseParameters.databasePassword,
password: databaseParameters.databasePassword
};

if (databaseParameters.caCert) {
Expand Down
2 changes: 1 addition & 1 deletion tests/e2e/helpers/api/api-info.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { t } from 'testcafe';
import { sendPostRequest } from './api-common';
import { ResourcePath } from '../constants';
import { sendPostRequest } from './api-common';

/**
* Synchronize features
Expand Down
3 changes: 1 addition & 2 deletions tests/e2e/helpers/common.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as path from 'path';
import * as archiver from 'archiver';
import * as fs from 'fs';
import * as archiver from 'archiver';
import { ClientFunction, RequestMock, t } from 'testcafe';
import { Chance } from 'chance';
import { apiUrl, commonUrl } from './conf';
Expand All @@ -13,7 +13,6 @@ declare global {
}
}


const settingsApiUrl = `${commonUrl}/api/settings`;
process.env.NODE_TLS_REJECT_UNAUTHORIZED = '0'; // lgtm[js/disabling-certificate-validation]
const mockedSettingsResponse = {
Expand Down
12 changes: 7 additions & 5 deletions tests/e2e/helpers/database-scripts.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { workingDirectory } from '../helpers/conf';
import * as sqlite3 from 'sqlite3';
import { workingDirectory } from '../helpers/conf';

const dbPath = `${workingDirectory}/redisinsight.db`;

Expand All @@ -17,7 +17,8 @@ export async function updateColumnValueInDBTable(tableName: string, columnName:
db.run(query, (err: { message: string }) => {
if (err) {
reject(new Error(`Error during changing ${columnName} column value: ${err.message}`));
} else {
}
else {
db.close();
resolve();
}
Expand All @@ -38,7 +39,8 @@ export async function getColumnValueFromTableInDB(tableName: string, columnName:
db.get(query, (err: { message: string }, row: any) => {
if (err) {
reject(new Error(`Error during getting ${columnName} column value: ${err.message}`));
} else {
}
else {
const columnValue = row[columnName];
db.close();
resolve(columnValue);
Expand All @@ -57,11 +59,11 @@ export async function deleteRowsFromTableInDB(tableName: string): Promise<void>

return new Promise<void>((resolve, reject) => {


db.run(query, (err: { message: string }) => {
if (err) {
reject(new Error(`Error during ${tableName} table rows deletion: ${err.message}`));
} else {
}
else {
db.close();
resolve();
}
Expand Down
2 changes: 1 addition & 1 deletion tests/e2e/helpers/insights.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as fs from 'fs-extra';
import * as path from 'path';
import * as fs from 'fs-extra';
import { BasePage } from '../pageObjects';
import { deleteRowsFromTableInDB, updateColumnValueInDBTable } from './database-scripts';
import { syncFeaturesApi } from './api/api-info';
Expand Down
2 changes: 1 addition & 1 deletion tests/e2e/helpers/notifications.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { workingDirectory} from '../helpers/conf';
import { workingDirectory } from '../helpers/conf';
import { NotificationParameters } from '../pageObjects/components/navigation/notification-panel';

const dbPath = `${workingDirectory}/redisinsight.db`;
Expand Down
2 changes: 1 addition & 1 deletion tests/e2e/pageObjects/components/browser/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ import { TreeView } from './tree-view';

export {
BulkActions,
TreeView,
TreeView
};
Original file line number Diff line number Diff line change
Expand Up @@ -266,9 +266,8 @@ export class AddRedisDatabase {
/**
* set copressor value in dropdown
* @param compressor - compressor value
* @param value - checkbox value
*/
async setCompressorValue(compressor: string){
async setCompressorValue(compressor: string): Promise<void> {

if(!await this.selectCompressor.exists) {
await t.click(this.dataCompressorLabel);
Expand Down
2 changes: 1 addition & 1 deletion tests/e2e/pageObjects/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,5 @@ export {
InstancePage,
TriggersAndFunctionsLibrariesPage,
TriggersAndFunctionsFunctionsPage,
WelcomePage,
WelcomePage
};
2 changes: 1 addition & 1 deletion tests/e2e/pageObjects/workbench-page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,6 @@ export class WorkbenchPage extends InstancePage {
do {
imageHeight = await selector.getStyleProperty('height');
}
while ((imageHeight == '0px') && Date.now() - startTime < searchTimeout);
while ((imageHeight === '0px') && Date.now() - startTime < searchTimeout);
}
}
2 changes: 2 additions & 0 deletions tests/e2e/tests/web/critical-path/browser/formatters.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,8 @@ notEditableFormattersSet.forEach(formatter => {
await t.hover(editBtn);
// Verify tooltip content
await t.expect(browserPage.tooltip.textContent).contains('Cannot edit the value in this format', 'Tooltip has wrong text');
await t.click(editBtn);
await t.expect(browserPage.applyButton.exists).notOk('Edit field is displayed even if disabled');
}
}
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ fixture `Allow to change database index`
});
test('Switching between indexed databases', async t => {
const command = `HSET ${logicalDbKey} "name" "Gillford School" "description" "Gillford School is a centre" "class" "private" "type" "democratic; waldorf" "address_city" "Goudhurst" "address_street" "Goudhurst" "students" 721 "location" "51.112685, 0.451076"`;
const rememberedConnectedClients = await browserPage.overviewConnectedClients.textContent;
// const rememberedConnectedClients = await browserPage.overviewConnectedClients.textContent;

// Change index to logical db
// Verify that database index switcher displayed for Standalone db
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import {
} from '../../../../helpers/conf';
import { DatabaseAPIRequests } from '../../../../helpers/api/api-database';


const myRedisDatabasePage = new MyRedisDatabasePage();
const browserPage = new BrowserPage();
const chance = new Chance();
Expand Down Expand Up @@ -47,8 +46,8 @@ test
await databaseAPIRequests.deleteStandaloneDatabaseApi(ossStandaloneConfig);
await databaseAPIRequests.deleteStandaloneDatabaseApi(ossStandaloneRedisearch);
})('Verify that user can see the list of Modules updated each time when he connects to the database', async t => {
let firstDatabaseModules: string[] = [];
let secondDatabaseModules: string[] = [];
const firstDatabaseModules: string[] = [];
const secondDatabaseModules: string[] = [];
//Remember modules
await t.click(browserPage.OverviewPanel.overviewMoreInfo);
const moduleIcons = Selector('div').find('[data-testid^=Redi]');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ test('Certificates import with/without path', async t => {
});
test('Import SSH parameters', async t => {
const sshAgentsResult = 'SSH Agents are not supported';
const sshPrivateKey = '-----BEGIN OPENSSH PRIVATE KEY-----';
// const sshPrivateKey = '-----BEGIN OPENSSH PRIVATE KEY-----';

await databasesActions.importDatabase(racompSSHData);
// Fully imported table with SSH
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ fixture `Memory Efficiency Recommendations`
// Go to Analysis Tools page
await t.click(myRedisDatabasePage.NavigationPanel.analysisPageButton);
})
.afterEach(async t => {
.afterEach(async() => {
// Clear and delete database
await apiKeyRequests.deleteKeyByNameApi(keyName, ossStandaloneConfig.databaseName);
await databaseAPIRequests.deleteStandaloneDatabaseApi(ossStandaloneConfig);
Expand Down Expand Up @@ -174,7 +174,7 @@ test.skip
// Go to Recommendations tab
await t.click(memoryEfficiencyPage.recommendationsTab);
})
.after(async t => {
.after(async() => {
// Clear and delete database
await apiKeyRequests.deleteKeyByNameApi(keyName, ossStandaloneConfig.databaseName);
await databaseAPIRequests.deleteStandaloneDatabaseApi(ossStandaloneConfig);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Selector } from 'testcafe';
import { MyRedisDatabasePage, MemoryEfficiencyPage, BrowserPage } from '../../../../pageObjects';
import { rte } from '../../../../helpers/constants';
import { DatabaseHelper } from '../../../../helpers/database';
import { commonUrl, ossStandaloneConfig, ossStandaloneRedisearch } from '../../../../helpers/conf';
import { commonUrl, ossStandaloneRedisearch } from '../../../../helpers/conf';
import { DatabaseAPIRequests } from '../../../../helpers/api/api-database';
import { deleteAllKeysFromDB, populateDBWithHashes, populateHashWithFields } from '../../../../helpers/keys';
import { Common } from '../../../../helpers/common';
Expand Down Expand Up @@ -80,7 +80,7 @@ test
// Go to Analysis Tools page
await t.click(myRedisDatabasePage.NavigationPanel.analysisPageButton);
})
.after(async t => {
.after(async() => {
await apiKeyRequests.deleteKeyByNameApi(keyName, ossStandaloneRedisearch.databaseName);
await databaseAPIRequests.deleteStandaloneDatabaseApi(ossStandaloneRedisearch);
})('Big highlighted key tooltip', async t => {
Expand Down
2 changes: 1 addition & 1 deletion tests/e2e/tests/web/critical-path/workbench/cypher.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const databaseHelper = new DatabaseHelper();
const databaseAPIRequests = new DatabaseAPIRequests();

fixture `Cypher syntax at Workbench`
.meta({type: 'critical_path', rte: rte.standalone})
.meta({ type: 'critical_path', rte: rte.standalone })
.page(commonUrl)
.beforeEach(async t => {
await databaseHelper.acceptLicenseTermsAndAddDatabaseApi(ossStandaloneConfig);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const expectedProperties = [
];

fixture `Default scripts area at Workbench`
.meta({type: 'critical_path', rte: rte.standalone})
.meta({ type: 'critical_path', rte: rte.standalone })
.page(commonUrl)
.beforeEach(async t => {
await databaseHelper.acceptLicenseTermsAndAddDatabaseApi(ossStandaloneRedisearch);
Expand Down
1 change: 0 additions & 1 deletion tests/e2e/tests/web/regression/browser/add-keys.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import { commonUrl, ossStandaloneBigConfig, ossStandaloneConfig } from '../../..
import { DatabaseAPIRequests } from '../../../../helpers/api/api-database';
import { Common } from '../../../../helpers/common';
import { BrowserActions } from '../../../../common-actions/browser-actions';
import { verifyKeysDisplayingInTheList } from '../../../../helpers/keys';

const browserPage = new BrowserPage();
const browserActions = new BrowserActions();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import { rte } from '../../../../helpers/constants';
import { commonUrl, ossStandaloneConfig } from '../../../../helpers/conf';
import { DatabaseAPIRequests } from '../../../../helpers/api/api-database';
import { Common } from '../../../../helpers/common';
import { t } from 'testcafe';

const myRedisDatabasePage = new MyRedisDatabasePage();
const browserPage = new BrowserPage();
Expand Down
2 changes: 1 addition & 1 deletion tests/e2e/tests/web/regression/browser/scan-keys.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const explicitErrorHandler = (): void => {
};

fixture `Browser - Specify Keys to Scan`
.meta({type: 'regression', rte: rte.none})
.meta({ type: 'regression', rte: rte.none })
.page(commonUrl)
.clientScripts({ content: `(${explicitErrorHandler.toString()})()` })
.beforeEach(async() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const databaseHelper = new DatabaseHelper();
const databaseAPIRequests = new DatabaseAPIRequests();

fixture `Autocomplete for entered commands`
.meta({type: 'regression', rte: rte.standalone})
.meta({ type: 'regression', rte: rte.standalone })
.page(commonUrl)
.beforeEach(async t => {
await databaseHelper.acceptLicenseTermsAndAddDatabaseApi(ossStandaloneConfig);
Expand Down
2 changes: 1 addition & 1 deletion tests/e2e/tests/web/regression/workbench/context.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ test('Verify that user can see saved CLI size when navigates away to any other p
test('Verify that user can see all the information removed when reloads the page', async t => {
const command = 'FT._LIST';
// Create context modificaions and navigate to Browser
await t.typeText(workbenchPage.queryInput, command, { replace: true, speed: speed});
await t.typeText(workbenchPage.queryInput, command, { replace: true, speed: speed });
await t.click(workbenchPage.Cli.cliExpandButton);
await t.click(myRedisDatabasePage.NavigationPanel.browserButton);
// Open Workbench page and verify context
Expand Down
2 changes: 1 addition & 1 deletion tests/e2e/tests/web/regression/workbench/cypher.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const databaseAPIRequests = new DatabaseAPIRequests();
const command = 'GRAPH.QUERY graph';

fixture `Cypher syntax at Workbench`
.meta({type: 'regression', rte: rte.standalone})
.meta({ type: 'regression', rte: rte.standalone })
.page(commonUrl)
.beforeEach(async t => {
await databaseHelper.acceptLicenseTermsAndAddDatabaseApi(ossStandaloneConfig);
Expand Down
Loading