Skip to content

Commit 51cea99

Browse files
authored
Merge pull request #171 from RedisInsight/e2e/bugfix/folders-renaming
E2e/bugfix/folders renaming
2 parents 4bc38cc + 3af0412 commit 51cea99

File tree

13 files changed

+83
-27
lines changed

13 files changed

+83
-27
lines changed

.circleci/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ jobs:
132132
APP_BUILD_TYPE="VSCode (Linux)" node ./.circleci/e2e-results.js
133133
# curl -H "Content-type: application/json" --data @e2e.report.json -H "Authorization: Bearer $SLACK_TEST_REPORT_KEY" -X POST https://slack.com/api/chat.postMessage
134134
- store_test_results:
135-
path: tests/e2e/results
135+
path: tests/e2e/mochawesome-report
136136
- store_artifacts:
137137
path: tests/e2e/mochawesome-report
138138
destination: tests/e2e/mochawesome-report

.circleci/e2e-results.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ if (totalNodes > 1) {
66
parallelNodeInfo = ` (node: ${parseInt(process.env.CIRCLE_NODE_INDEX, 10) + 1}/${totalNodes})`
77
}
88

9-
const file = 'tests/e2e/results/e2e.results.json'
10-
const appBuildType = process.env.APP_BUILD_TYPE || 'Web'
9+
const file = fs.readdirSync('tests/e2e/mochawesome-report').find(file => file.endsWith('-setup-report.json'))
10+
const appBuildType = process.env.APP_BUILD_TYPE || 'VSCode (Linux)'
1111
const results = {
1212
message: {
1313
text: `*E2ETest - ${appBuildType}${parallelNodeInfo}* (Branch: *${process.env.CIRCLE_BRANCH}*)` +
@@ -19,22 +19,22 @@ const results = {
1919
const result = JSON.parse(fs.readFileSync(file, 'utf-8'))
2020
const testRunResult = {
2121
color: '#36a64f',
22-
title: `Started at: *${result.startTime}`,
23-
text: `Executed ${result.total} in ${(new Date(result.endTime) - new Date(result.startTime)) / 1000}s`,
22+
title: `Started at: *${result.stats.start}`,
23+
text: `Executed ${result.stats.tests} in ${(new Date(result.stats.end) - new Date(result.stats.start)) / 1000}s`,
2424
fields: [
2525
{
2626
title: 'Passed',
27-
value: result.passed,
27+
value: result.stats.passes,
2828
short: true,
2929
},
3030
{
3131
title: 'Skipped',
32-
value: result.skipped,
32+
value: result.stats.skipped,
3333
short: true,
3434
},
3535
],
3636
};
37-
const failed = result.total - result.passed;
37+
const failed = result.stats.failures;
3838
if (failed) {
3939
results.passed = false;
4040
testRunResult.color = '#cc0000';

tests/e2e/.ci.env

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
COMMON_URL=http://localhost:5541
22
API_URL=http://127.0.0.1:5541/api
33
OSS_SENTINEL_PASSWORD=password
4-
RI_APP_FOLDER_NAME=.redis-insight-vsc-stage
4+
RI_APP_FOLDER_NAME=.redis-for-vscode-stage
55
EXTENSION_NAME=redis-for-vscode-extension-linux-x64.vsix
66
RI_TEST=true
77

tests/e2e/.env

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
API_URL=http://127.0.0.1:5541/api
22
RI_TEST=true
33
OSS_SENTINEL_PASSWORD=password
4-
RI_APP_FOLDER_NAME=.redis-insight-vsc-stage
4+
RI_APP_FOLDER_NAME=.redis-for-vscode-stage
55
VSCODE_VERSION=1.82.0
66
EXTENSION_NAME=redis-for-vscode-extension.vsix
77

tests/e2e/.mocharc.js

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,17 @@ module.exports = {
88
package: './package.json',
99
parallel: false,
1010
recursive: false,
11-
reporter: 'mochawesome',
11+
reporter: 'mocha-multi-reporters',
1212
reporterOptions: {
13-
reportFilename: '[status]_[datetime]-[name]-report',
14-
quiet: true,
13+
reporterEnabled: 'mochawesome, mocha-junit-reporter',
14+
mochawesomeReporterOptions: {
15+
reportFilename: '[status]_[datetime]-[name]-report',
16+
quiet: true,
17+
},
18+
mochaJunitReporterReporterOptions: {
19+
mochaFile: './mochawesome-report/junit-report.xml',
20+
toConsole: false,
21+
},
1522
},
1623
retries: 0,
1724
timeout: 100_000,

tests/e2e/package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@
3434
"eslint": "^7.5.0",
3535
"fs-extra": "^11.1.1",
3636
"mocha": "^10.2.0",
37+
"mocha-junit-reporter": "^2.2.1",
38+
"mocha-multi-reporters": "^1.5.1",
3739
"mochawesome": "^7.1.3",
3840
"redis": "^4.6.11",
3941
"rimraf": "^6.0.1",

tests/e2e/src/helpers/Conf.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export class Config {
1313

1414
static workingDirectory =
1515
process.env.APP_FOLDER_ABSOLUTE_PATH ||
16-
joinPath(os.homedir(), process.env.APP_FOLDER_NAME || '.redis-for-vscode')
16+
joinPath(os.homedir(), process.env.RI_APP_FOLDER_NAME || '.redis-for-vscode')
1717
static fileDownloadPath = joinPath(os.homedir(), 'Downloads')
1818
static uniqueId = chance.string({ length: 10 })
1919

tests/e2e/src/page-objects/components/bottom-bar/CliViewPanel.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -98,11 +98,10 @@ export class CliViewPanel extends WebView {
9898
}
9999

100100
/**
101-
* Get text from the last cli output, no formatting.
102-
* @param timeout optional maximum time to wait for completion in milliseconds, 0 for unlimited
101+
* Get text from the last cli output, no formatting
103102
* @returns Promise resolving to cli result text
104103
*/
105-
async getCliLastCommandResponse(timeout: number = 5000): Promise<string> {
104+
async getCliLastCommandResponse(): Promise<string> {
106105
await super.getElement(this.cliOutput)
107106
const commandsCount = await this.getNumberOfCommands()
108107
await super.getElement(this.cliOutput)

tests/e2e/src/page-objects/components/tree-view/TreeView.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,5 @@ export class TreeView extends WebView {
294294
*/
295295
async openCliByDatabaseName(databaseName: string): Promise<void> {
296296
await ButtonActions.clickElement(this.getCLIDatabaseBtnByName(databaseName))
297-
// TODO delete after fixing CLI issue with invalid db id
298-
await ButtonActions.clickElement(this.getCLIDatabaseBtnByName(databaseName))
299297
}
300298
}

tests/e2e/src/tests/cli/cli.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,17 +32,16 @@ describe('CLI critical', () => {
3232
)
3333
})
3434
beforeEach(async () => {
35-
await cliViewPanel.switchBack()
35+
await treeView.switchBack()
3636
await treeView.switchToInnerViewFrame(InnerViews.TreeInnerView)
3737
await treeView.openCliByDatabaseName(
3838
Config.ossStandaloneConfig.databaseName,
3939
)
4040
await treeView.switchBack()
41+
await CommonDriverExtension.driverSleep(1000)
4142
await cliViewPanel.switchToInnerViewFrame(InnerViews.CliInnerView)
4243
})
4344
afterEach(async () => {
44-
await cliViewPanel.switchBack()
45-
await bottomBar.openTerminalView()
4645
await KeyAPIRequests.deleteKeyIfExistsApi(
4746
keyName,
4847
Config.ossStandaloneConfig.databaseName,

0 commit comments

Comments
 (0)