Skip to content

Commit

Permalink
Merge pull request #232 from RedisInsight/e2e/bugfix/fix-github-actions
Browse files Browse the repository at this point in the history
e2e/bugfix/fix-e2e
  • Loading branch information
vlad-dargel authored Dec 18, 2024
2 parents be6f0c8 + abf1050 commit 2b80b96
Show file tree
Hide file tree
Showing 12 changed files with 32 additions and 23 deletions.
2 changes: 1 addition & 1 deletion tests/e2e/rte.docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ services:
# ssh
ssh:
logging: *logging
image: lscr.io/linuxserver/openssh-server:latest
image: lscr.io/linuxserver/openssh-server:9.7_p1-r4-ls172
environment:
- PASSWORD_ACCESS=true
- USER_PASSWORD=pass
Expand Down
2 changes: 1 addition & 1 deletion tests/e2e/src/helpers/common-actions/KeyActions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ export class Key {
case KeyTypesShort.Hash:
return { fields: [{ field, value }] }
case KeyTypesShort.List:
return { element: value }
return { destination: "TAIL", elements: [value] }
case KeyTypesShort.Set:
return { members: [value] }
case KeyTypesShort.ZSet:
Expand Down
2 changes: 1 addition & 1 deletion tests/e2e/src/helpers/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,6 @@ export enum Formatters {
}

export enum AddElementInList {
Head ,
Head,
Tail,
}
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export class KeyDetailsView extends WebView {
`//vscode-button[@data-testid='search-button']`,
)
addKeyValueItemsButton = By.xpath(
`//*[@data-testid = 'add-key-value-items-btn']`,
`//*[@data-testid='add-key-value-items-btn']`,
)
copyButton = By.xpath(
`//vscode-button[starts-with(@data-testid, 'copy-name-button')]`,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ export class ListKeyDetailsView extends DoubleColumnKeyDetailsView {
)
await ButtonActions.clickAndWaitForElement(this.fromHeadSelection, this.fromHeadSelection, false)
}
for (let i = 0; i < element.length; i ++){
for (let i = 0; i < element.length; i++){
await InputActions.typeText(this.getElementValueInput(i), element[i])

if (element.length > 1 && i < element.length - 1) {
Expand Down
3 changes: 1 addition & 2 deletions tests/e2e/src/page-objects/components/tree-view/TreeView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import {
DropdownActions,
InputActions,
} from '@e2eSrc/helpers/common-actions'
import { CommonDriverExtension, Config } from '@e2eSrc/helpers'

/**
* Tree list view with databases and keys
Expand Down Expand Up @@ -63,7 +62,7 @@ export class TreeView extends WebView {
keyMask = '//*[@data-testid="key-$name"]'
getItemDeleteButton = (keyName: string): Locator =>
By.xpath(
`//vscode-button[starts-with(@data-testid, 'remove-key-${keyName}')]`,
`//button[starts-with(@data-testid, 'remove-key-${keyName}')]`,
)
getTreeViewItemByIndex = (index: number): Locator =>
By.xpath(
Expand Down
2 changes: 1 addition & 1 deletion tests/e2e/src/tests/browser/filtering.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,7 @@ describe('Filtering per key name in DB with 10 millions of keys', () => {
for (let i = 0; i < keyTypes.length - 1; i++) {
await treeView.selectFilterGroupType(keyTypes[i].keyName)
// Waiting for long db loading
CommonDriverExtension.driverSleep(3000)
CommonDriverExtension.driverSleep(4000)
// Verify that all results have the same type as in filter
expect(
await treeView.getElementText(treeView.getTreeViewItemByIndex(i + 1)),
Expand Down
4 changes: 2 additions & 2 deletions tests/e2e/src/tests/browser/large-key-details-values.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ describe('Large key details verification', () => {
stringKeyDetailsView.editKeyValueButton,
'class',
),
).eql(true, 'Edit String key button not disabled')
).eql(true, 'Edit String key value button not disabled before loading all clicked')

// Verify that user can see String key value with only 5000 characters uploaded if length is more than 5000
// Verify that 3 dots after truncated big strings displayed
Expand Down Expand Up @@ -338,7 +338,7 @@ describe('Large key details verification', () => {
stringKeyDetailsView.editKeyValueButton,
'class',
),
).eql(false, 'Edit key value button not disabled')
).eql(false, 'Edit key value button disabled after loading all clicked')
// Verify that user can see not fully loaded String key with > 5000 characters after clicking on Refresh button
await ButtonActions.clickAndWaitForElement(
stringKeyDetailsView.refreshKeyButton,
Expand Down
14 changes: 9 additions & 5 deletions tests/e2e/src/tests/browser/list-key.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { Config } from '@e2eSrc/helpers/Conf'
import { ListKeyParameters } from '@e2eSrc/helpers/types/types'
import { InnerViews } from '@e2eSrc/page-objects/components/WebView'
import { AddElementInList, KeyTypesShort } from '@e2eSrc/helpers/constants'
import { CommonDriverExtension } from '@e2eSrc/helpers'

let keyName: string
const elements = [
Expand Down Expand Up @@ -36,6 +37,11 @@ describe('List Key verification', () => {
element: [elements[0], elements[1], elements[2]],
}

await KeyAPIRequests.addListKeyApi(
keyToAddParameters,
Config.ossStandaloneConfig.databaseName,
)

// Refresh database
await treeView.refreshDatabaseByName(
Config.ossStandaloneConfig.databaseName,
Expand Down Expand Up @@ -162,11 +168,9 @@ describe('List Key verification for db with version <6.2', () => {
// Add a few elements to the List key
await listKeyDetailsView.addListElement([elements[1]])
// Verify that user can add element to List
expect(
await listKeyDetailsView.isElementDisplayed(
listKeyDetailsView.getElementValueByText(elements[1]),
),
).eql(true, 'Element not added')
await listKeyDetailsView.getElement(
listKeyDetailsView.getElementValueByText(elements[1]),
)

await listKeyDetailsView.addListElement([elements[2]], AddElementInList.Head)
await listKeyDetailsView.getElement(
Expand Down
2 changes: 1 addition & 1 deletion tests/e2e/src/tests/browser/set-ttl-for-key.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ describe('Set TTL for Key', () => {
Config.ossStandaloneV7Config.databaseName,
)
await keyDetailsView.switchBack()
await keyDetailsView.switchToInnerViewFrame(InnerViews.TreeInnerView)
})

it('Verify that user can specify TTL for Key', async function () {
Expand Down Expand Up @@ -98,7 +99,6 @@ describe('Set TTL for Key', () => {
},
],
}
await keyDetailsView.switchToInnerViewFrame(InnerViews.TreeInnerView)
await addHashKeyView.addKey(hashKeyParameters, KeyTypesShort.Hash)
await CommonDriverExtension.driverSleep(1000)
await keyDetailsView.switchBack()
Expand Down
18 changes: 12 additions & 6 deletions tests/e2e/src/tests/database/edit-db.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,10 @@ describe('Edit Databases', () => {

it('Verify that user can edit DB alias of Standalone DB', async function () {
// Verify that timeout input is displayed for edit db window with default value when it wasn't specified
const timeoutValue = await editDatabaseView.getElementAttribute(editDatabaseView.timeoutInput, 'value')
const timeoutValue = await editDatabaseView.getElementAttribute(
editDatabaseView.timeoutInput,
'value',
)
expect(timeoutValue).eql('30', 'Timeout is not defaulted to 30')

await InputActions.typeText(editDatabaseView.aliasInput, newDatabaseName)
Expand All @@ -58,14 +61,17 @@ describe('Edit Databases', () => {

it('Verify that user can edit Standalone DB', async function () {
const connectionTimeout = '20'
const caCertFieldValue = await editDatabaseView.getElementAttribute(
editDatabaseView.caCertField, 'current-value'
const caCertFieldValue = await editDatabaseView.getElementText(
editDatabaseView.caCertField,
)
const clientCertFieldValue = await editDatabaseView.getElementAttribute(
editDatabaseView.clientCertField, 'current-value'
const clientCertFieldValue = await editDatabaseView.getElementText(
editDatabaseView.clientCertField,
)

expect(caCertFieldValue).not.contains('NO_CA_CERT', 'CA certificate is incorrect')
expect(caCertFieldValue).not.contains(
'NO_CA_CERT',
'CA certificate is incorrect',
)
expect(clientCertFieldValue).not.contains(
'ADD_NEW',
'Client certificate is incorrect',
Expand Down
2 changes: 1 addition & 1 deletion tests/e2e/src/tests/tree-view/tree-view-big-db.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ describe('Tree view verifications for big database', () => {
'Scanned',
'Scanned key is not correct',
)
expect(await treeView.isElementDisplayed(treeView.totalKeyNumber)).eql(
expect(await treeView.waitForElementVisibility(treeView.totalKeyNumber)).eql(
true,
'incorrect count is displayed',
)
Expand Down

0 comments on commit 2b80b96

Please sign in to comment.