Skip to content

Commit cb9fd0a

Browse files
committed
Merge remote-tracking branch 'origin/release/0.0.1' into feature/bugfix
2 parents 543357b + 3a8180c commit cb9fd0a

File tree

13 files changed

+87
-34
lines changed

13 files changed

+87
-34
lines changed

.circleci/config.yml

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -349,14 +349,14 @@ workflows:
349349

350350
e2e-tests:
351351
jobs:
352-
# - approve:
353-
# name: Start E2E Tests
354-
# type: approval
355-
# filters:
356-
# branches:
357-
# only:
358-
# - /^e2e/feature.*/
359-
# - /^e2e/bugfix.*/
352+
- approve:
353+
name: Start E2E Tests
354+
type: approval
355+
filters:
356+
branches:
357+
only:
358+
- /^e2e/feature.*/
359+
- /^e2e/bugfix.*/
360360

361361
- linux:
362362
name: Build extension - Linux (stage)
@@ -366,6 +366,8 @@ workflows:
366366
only:
367367
- /^e2e/feature.*/
368368
- /^e2e/bugfix.*/
369+
requires:
370+
- Start E2E Tests
369371

370372
- e2e-app-image:
371373
name: E2ETest (linux)
@@ -478,7 +480,7 @@ workflows:
478480
# e2e tests on linux build
479481
- e2e-app-image:
480482
name: E2ETest (linux)
481-
parallelism: 2
483+
parallelism: 1
482484
requires:
483485
- Build extension - Linux (stage)
484486

@@ -516,7 +518,7 @@ workflows:
516518
# e2e desktop tests on linux build
517519
- e2e-app-image:
518520
name: E2ETest (Linux)
519-
parallelism: 2
521+
parallelism: 1
520522
requires:
521523
- Build extension - Linux (prod)
522524

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "redis-for-vscode",
3-
"version": "0.0.3",
3+
"version": "0.0.1",
44
"displayName": "Redis for VS Code",
55
"description": "Visually interact with data and build queries in Redis",
66
"license": "SEE LICENSE IN LICENSE",

tests/e2e/src/helpers/common-actions/actions/ButtonActions.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ export class ButtonActions extends BaseActions{
5555
*/
5656
static async clickElement(
5757
locatorToClick: Locator,
58-
timeout: number = 3000,
58+
timeout: number = 5000,
5959
): Promise<void> {
6060
ButtonActions.initializeDriver()
6161
const elementToClick = await ButtonActions.driver.wait(

tests/e2e/src/page-objects/components/editor-view/DoubleColumnKeyDetailsView.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { By } from 'selenium-webdriver'
22
import { ButtonActions, InputActions } from '@e2eSrc/helpers/common-actions'
33
import { KeyDetailsView } from './KeyDetailsView'
4+
import { CommonDriverExtension } from '@e2eSrc/helpers'
45

56
/**
67
* Base view for all keyTypes that have 2 columns value
@@ -13,8 +14,6 @@ export class DoubleColumnKeyDetailsView extends KeyDetailsView {
1314
By.xpath(
1415
`//*[contains(@data-testid, "edit-${keyType}-button-${name}")] | //*[contains(@data-testid, "${keyType}_edit-btn-${name}")]`,
1516
)
16-
getValueInput = (keyType: string, name: string): By =>
17-
By.xpath(`//*[contains(@data-testid, "${keyType}_content-value-${name}")]`)
1817
getWrapperOfValueInput = (keyType: string, name: string): By =>
1918
By.xpath(`//*[contains(@data-testid, "${keyType}_content-value-${name}")]/parent::*`)
2019

@@ -36,6 +35,7 @@ export class DoubleColumnKeyDetailsView extends KeyDetailsView {
3635
await ButtonActions.clickElement(editLocator)
3736
await InputActions.typeText(editorLocator, value)
3837
await ButtonActions.clickElement(this.applyButton)
38+
await CommonDriverExtension.driverSleep(300)
3939
}
4040

4141
/**
@@ -56,5 +56,6 @@ export class DoubleColumnKeyDetailsView extends KeyDetailsView {
5656
await ButtonActions.clickElement(editLocator)
5757
await InputActions.slowType(editorLocator, value)
5858
await ButtonActions.clickElement(this.applyButton)
59+
await CommonDriverExtension.driverSleep(300)
5960
}
6061
}

tests/e2e/src/page-objects/components/editor-view/HashKeyDetailsView.ts

Lines changed: 22 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,16 @@ import { Key } from 'vscode-extension-tester'
99
* Hash Key details view
1010
*/
1111
export class HashKeyDetailsView extends DoubleColumnKeyDetailsView {
12-
hashFieldValueEditor = By.xpath(`//*[contains(@data-testid, 'hash_value-editor')]`)
12+
hashFieldValueEditor = By.xpath(
13+
`//*[contains(@data-testid, 'hash_value-editor')]`,
14+
)
1315
hashFieldTtlEditor = By.xpath(`//*[@data-testid = 'inline-item-editor']`)
1416
hashFieldsList = By.xpath(
1517
`//*[contains(@data-testid, 'hash-field-') and not(contains(@data-testid,'value'))]/div`,
1618
)
17-
hashValuesList = By.xpath(`//*[contains(@data-testid, 'hash_content-value-')]`)
19+
hashValuesList = By.xpath(
20+
`//*[contains(@data-testid, 'hash_content-value-')]`,
21+
)
1822
truncatedValue = By.xpath(
1923
`//*[contains(@data-testid, 'hash_content-value-')]//*[@class = 'truncate']`,
2024
)
@@ -26,7 +30,9 @@ export class HashKeyDetailsView extends DoubleColumnKeyDetailsView {
2630
`//*[@data-testid = 'add-hash-field-panel']//*[contains(@data-testid, 'hash-value-')]`,
2731
)
2832
saveHashFieldButton = By.xpath(`//*[@data-testid = 'save-fields-btn']`)
29-
showTtlCheckbox = By.xpath(`//*[@data-testid = 'show-ttl-column-checkbox']/parent::*/parent::*`)
33+
showTtlCheckbox = By.xpath(
34+
`//*[@data-testid = 'show-ttl-column-checkbox']/parent::*/parent::*`,
35+
)
3036

3137
getFieldTtlInputByField = (field: string): By =>
3238
By.xpath(`//div[@data-testid="hash-ttl_content-value-${field}"]`)
@@ -46,6 +52,8 @@ export class HashKeyDetailsView extends DoubleColumnKeyDetailsView {
4652
this.hashFieldValueEditor,
4753
KeyTypesShort.Hash,
4854
)
55+
// Wait until value changes
56+
await CommonDriverExtension.driverSleep(300)
4957
}
5058

5159
/**
@@ -65,16 +73,23 @@ export class HashKeyDetailsView extends DoubleColumnKeyDetailsView {
6573
* @param fieldName The field name
6674
* @param fieldTtl The hash field ttl value for Redis databases 7.3.4 and higher
6775
*/
68-
async editHashKeyTtl(fieldName: string, fieldTtl: string = ''): Promise<void> {
76+
async editHashKeyTtl(
77+
fieldName: string,
78+
fieldTtl: string = '',
79+
): Promise<void> {
6980
const enteredText = await this.getElementText(
70-
this.getFieldTtlInputByField(fieldName))
81+
this.getFieldTtlInputByField(fieldName),
82+
)
7183
const count = enteredText.length
7284

73-
await InputActions.hoverElement(this.getFieldTtlInputByField(fieldName),1000)
85+
await InputActions.hoverElement(
86+
this.getFieldTtlInputByField(fieldName),
87+
1000,
88+
)
7489
await ButtonActions.clickElement(this.getEditFieldByField(fieldName))
7590

7691
// clear the input
77-
for(let i = 0; i < count; i++){
92+
for (let i = 0; i < count; i++) {
7893
await InputActions.pressKey(this.hashFieldTtlEditor, Key.BACK_SPACE)
7994
}
8095
await InputActions.typeText(this.hashFieldTtlEditor, fieldTtl)

tests/e2e/src/page-objects/components/editor-view/KeyDetailsView.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ export class KeyDetailsView extends WebView {
7878
By.xpath(`//*[@data-testid[starts-with(., '${keyName.split('-')[0]}') and contains(., '${columnName}')]]//*[@data-testid='value-as-json']
7979
| //*[@data-testid[starts-with(., '${keyName.split('-')[0]}-field-') and contains(., '${columnName}')]]//*[@data-testid='value-as-json']`)
8080
getEditBtnByKeyName = (keyName: string): By =>
81-
By.xpath(`//vscode-button[contains(@data-testid, 'edit_') and contains(@data-testid, '${keyName}')]`)
81+
By.xpath(`//vscode-button[contains(@data-testid, 'edit') and contains(@data-testid, '${keyName}')]`)
8282
/**
8383
* get key size
8484
*/

tests/e2e/src/page-objects/components/editor-view/SortedSetKeyDetailsView.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export class SortedSetKeyDetailsView extends DoubleColumnKeyDetailsView {
1212
`//*[contains(@data-testid, 'zset-member-value-')]`,
1313
)
1414
truncatedValue = By.xpath(
15-
`//*[contains(@data-testid, 'zset-member-value-')]//*[contains(@aria-describedby, 'popup')]`,
15+
`//*[contains(@data-testid, 'zset-score-value-')]//*[@class = 'truncate']`,
1616
)
1717
scoreSortedSetFieldsList = By.xpath(
1818
`//*[contains(@data-testid, 'zset_content-value-')]`,

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,8 @@ export class TreeView extends WebView {
260260
value,
261261
)
262262
await ButtonActions.clickElement(this.keyTreeFilterApplyBtn)
263-
await this.waitForElementVisibility(this.loadingIndicator, 1000, false)
263+
await this.waitForElementVisibility(this.loadingIndicator, 2000, true)
264+
await this.waitForElementVisibility(this.loadingIndicator, 5000, false)
264265
}
265266

266267
/**

tests/e2e/src/tests/browser/filtering.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ import {
2323
KeyTypesShort,
2424
} from '@e2eSrc/helpers/constants'
2525
import { InnerViews } from '@e2eSrc/page-objects/components/WebView'
26+
import { CommonDriverExtension } from '@e2eSrc/helpers'
2627

2728
let keyName = `KeyForSearch*?[]789${Common.generateWord(10)}`
2829
let keyName2 = Common.generateWord(10)
@@ -426,10 +427,12 @@ describe('Filtering per key name in DB with 10 millions of keys', () => {
426427
await treeView.clearFilter()
427428
for (let i = 0; i < keyTypes.length - 1; i++) {
428429
await treeView.selectFilterGroupType(keyTypes[i].keyName)
430+
// Waiting for long db loading
431+
CommonDriverExtension.driverSleep(1000)
429432
// Verify that all results have the same type as in filter
430433
expect(
431434
await treeView.getElementText(treeView.getTreeViewItemByIndex(i + 1)),
432-
).contains(keyTypes[i].keyName, 'Keys filtered incorrectly by key type')
435+
).contains(keyTypes[i].keyName, 'Keys filtered incorrectly by key type after scanning more')
433436
}
434437
})
435438
})

tests/e2e/src/tests/browser/formatters.ts

Lines changed: 37 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
import { expect } from 'chai'
22
import { describe, it } from 'mocha'
3-
import { before, beforeEach, after, afterEach, Locator } from 'vscode-extension-tester'
3+
import {
4+
before,
5+
beforeEach,
6+
after,
7+
afterEach,
8+
Locator,
9+
} from 'vscode-extension-tester'
410
import {
511
CliAPIRequests,
612
DatabaseAPIRequests,
@@ -16,7 +22,8 @@ import {
1622
} from '@e2eSrc/page-objects/components'
1723
import {
1824
ButtonActions,
19-
DatabasesActions, InputActions,
25+
DatabasesActions,
26+
InputActions,
2027
KeyDetailsActions,
2128
} from '@e2eSrc/helpers/common-actions'
2229
import { formatters, phpData } from '../../test-data/formatters-data'
@@ -224,6 +231,7 @@ describe('Formatters', () => {
224231
await keyDetailsView.selectFormatter(formatter.format)
225232
await hashKeyDetailsView.editHashKeyValue(invalidText)
226233
await ButtonActions.clickElement(keyDetailsView.saveButton)
234+
await CommonDriverExtension.driverSleep(500)
227235
// Verify that invalid value can be saved
228236
expect(
229237
await hashKeyDetailsView.getElementText(
@@ -487,7 +495,7 @@ describe('Formatters', () => {
487495
keysData,
488496
Config.ossStandaloneConfig.databaseName,
489497
value,
490-
value
498+
value,
491499
)
492500
// Refresh database
493501
await treeView.refreshDatabaseByName(
@@ -512,8 +520,26 @@ describe('Formatters', () => {
512520
await KeyDetailsActions.openKeyDetailsByKeyNameInIframe(key.keyName)
513521
await keyDetailsView.selectFormatter(formatter.format)
514522
await CommonDriverExtension.driverSleep(300)
523+
// Hover over value to see edit button for hash and list
524+
if (key.keyType === KeyTypesShort.Hash) {
525+
await InputActions.hoverElement(
526+
doubleColumnKeyDetailsView.getWrapperOfValueInput(
527+
key.keyType,
528+
value,
529+
),
530+
1000,
531+
)
532+
}
533+
if (key.keyType === KeyTypesShort.List) {
534+
await InputActions.hoverElement(
535+
doubleColumnKeyDetailsView.getWrapperOfValueInput(
536+
key.keyType,
537+
'0',
538+
),
539+
1000,
540+
)
541+
}
515542
// Verify that edit button disabled for Hash, List, String keys
516-
await InputActions.hoverElement(doubleColumnKeyDetailsView.getWrapperOfValueInput(key.keyName, value),1000)
517543
expect(await keyDetailsView.isElementDisabled(editBtn, 'class')).eql(
518544
true,
519545
`Key ${key.keyType} is enabled for ${formatter.format} formatter`,
@@ -530,6 +556,13 @@ describe('Formatters', () => {
530556
await KeyDetailsActions.openKeyDetailsByKeyNameInIframe(key.keyName)
531557
await keyDetailsView.selectFormatter(formatter.format)
532558
// Verify that edit button enabled for ZSet
559+
await InputActions.hoverElement(
560+
doubleColumnKeyDetailsView.getWrapperOfValueInput(
561+
key.keyType,
562+
'0',
563+
),
564+
1000,
565+
)
533566
expect(
534567
await keyDetailsView.isElementDisabled(editBtnLocator, 'class'),
535568
).eql(

0 commit comments

Comments
 (0)