Skip to content

Commit 7e0816c

Browse files
ArtemHoruzhenkovalkirilov
authored andcommitted
E2e/feature/ri 7744 fix e2e tests (#5270)
* RI-7744: fix key tests + change e2e trigger temporary * RI-7744: fix keys list tests * RI-7744: fix pub-sub tests * RI-7744: fix add key tests * RI-7744: fix keys list/tree tests * RI-7744: fix keys list full screen tests * RI-7744: fix keys list scroll + streams tests * RI-7744: fix keys list scroll + streams tests * RI-7744: fix dbsize test fix * RI-7744: fix db sorting test * RI-7744: fix navigation tests * RI-7744: fix shortcuts tests * RI-7744: fix confirm popover test * RI-7744: fix db info tooltip * RI-7744: skip pubsub tests * RI-7744: fix search capabilities * RI-7744: fix pub sub tests * RI-7744: fix browser context tests * RI-7744: fix cli helper tests * RI-7744: fix key filter tests * RI-7744: fix key filter 2 tests * RI-7744: fix typo
1 parent 8c65e21 commit 7e0816c

File tree

25 files changed

+102
-44
lines changed

25 files changed

+102
-44
lines changed

.github/workflows/tests-e2e.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
name: ✅ E2E Tests
22

33
on:
4+
push:
5+
branches:
6+
- 'e2e/**'
47
workflow_dispatch:
58
inputs:
69
debug:

redisinsight/ui/src/pages/pub-sub/components/messages-list/MessagesListTable/MessagesListTable.tsx

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,11 +60,18 @@ const MessagesListTable = () => {
6060

6161
<Row align="center" gap="s">
6262
<Text>Messages:</Text>
63-
<Text>{messages.length}</Text>
63+
<Text data-testid="pub-sub-messages-count">
64+
{messages.length}
65+
</Text>
6466
</Row>
6567
</Row>
6668

67-
<Row align="center" justify="end" gap="s">
69+
<Row
70+
align="center"
71+
justify="end"
72+
gap="s"
73+
data-testid="pub-sub-status"
74+
>
6875
<Text>Status:</Text>
6976
{isSubscribed ? (
7077
<RiBadge label="Subscribed" variant="success" />

redisinsight/ui/src/pages/pub-sub/components/publish-message/PublishMessage.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,11 @@ const PublishMessage = () => {
112112
</Row>
113113

114114
{isShowBadge && (
115-
<ResultWrapper grow={false} align="center">
115+
<ResultWrapper
116+
grow={false}
117+
align="center"
118+
data-testid="publish-result"
119+
>
116120
<Icon icon={ToastCheckIcon} color="success500" />
117121
<Text color="success">
118122
{getClientsText(

tests/e2e/pageObjects/browser-page.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -215,10 +215,11 @@ export class BrowserPage extends InstancePage {
215215
keysSummary = Selector('[data-testid=keys-summary]');
216216
multiSearchArea = Selector(this.cssFilteringLabel);
217217
keyDetailsHeader = Selector('[data-testid=key-details-header]');
218+
keysContainer = Selector('[id=keys]');
218219
keyListTable = Selector('[data-testid=keyList-table]');
219220
keyListMessage = Selector('[data-testid=no-result-found-msg]');
220221
keyDetailsTable = Selector('[data-testid=key-details]');
221-
keyNameFormDetails = Selector('[data-testid=key-name-text]');
222+
keyNameFormDetails = Selector('p[data-testid=edit-key-input]');
222223
keyDetailsTTL = Selector('[data-testid=key-ttl-text]');
223224
progressLine = Selector('div.euiProgress');
224225
progressKeyList = Selector('[data-testid=progress-key-list]');
@@ -244,7 +245,7 @@ export class BrowserPage extends InstancePage {
244245
jsonValue = Selector('[data-testid=value-as-json]');
245246
stringValueAsJson = Selector(this.cssJsonValue);
246247
// POPUPS
247-
changeValueWarning = Selector('[data-testid=approve-popover]');
248+
changeValueWarning = Selector('[data-testid=confirm-popover]');
248249
// TABLE
249250
keyListItem = Selector('[role=rowgroup] [role=row]');
250251
// Dialog

tests/e2e/pageObjects/components/bottom-panel/command-helper.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export class CommandHelper {
1919
returnToList = Selector('[data-testid=cli-helper-back-to-list-btn]');
2020
filterGroupTypeButton = Selector('[data-testid=select-filter-group-type]');
2121
filterOptionGroupType = Selector('[data-test-subj^=filter-option-group-type-]');
22-
clearAllGroupFilters = Selector('[data-testid=select-filter-group-type] button title').withExactText('Clear All').parent('button');
22+
clearAllGroupFilters = Selector('[data-testid=cli-helper] button[title="Clear All"]');
2323

2424
//TEXT ELEMENTS
2525
cliHelper = Selector('[data-testid=cli-helper]');

tests/e2e/pageObjects/components/navigation/navigation-header.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ export class NavigationHeader {
66
cloudSignInButton = Selector('[data-testid=cloud-sign-in-btn]');
77
copilotButton = Selector('[data-testid=copilot-trigger]');
88
dbName = Selector('[data-testid=nav-instance-popover-btn]');
9-
dbNameExactText = Selector('[data-testid=nav-instance-popover-btn] b');
9+
dbNameExactText = Selector('[data-testid=nav-instance-popover-btn] p');
1010
homeLinkNavigation = Selector('[class*=homePageLink]');
1111
dbListInstance = Selector('[data-testid^=instance-item-]');
1212
rdiNavigationTab = Selector('[role=tab][id*="Redis Data Integration"]');

tests/e2e/pageObjects/components/shortcuts-panel.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ export class ShortcutsPanel {
88
//*The following categories are ordered alphabetically (Alerts, Buttons, Checkboxes, etc.).
99
//-------------------------------------------------------------------------------------------
1010
//BUTTONS
11-
shortcutsCloseButton = Selector('[role=dialog][title=Shortcuts] button title').withText('Cancel');
11+
shortcutsCloseButton = Selector('[role=dialog][title=Shortcuts] button[title=Close]');
1212
//TEXT ELEMENTS
13-
shortcutsTitle = Selector('[role=dialog][title=Shortcuts] h3');
13+
shortcutsTitle = Selector('[role=dialog][title=Shortcuts] [data-role="drawer-heading"]');
1414
shortcutsDesktopApplicationSection = Selector('[data-test-subj="shortcuts-section-Desktop application"]');
1515
shortcutsCLISection = Selector('[data-test-subj=shortcuts-section-CLI]');
1616
shortcutsWorkbenchSection = Selector('[data-test-subj=shortcuts-section-Workbench]');

tests/e2e/pageObjects/my-redis-databases-page.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,9 @@ export class MyRedisDatabasePage extends BaseOverviewPage {
3535
popoverHeader = Selector('#formModalHeader');
3636
submitChangesButton = Selector('[data-testid=btn-submit]');
3737
promoButton = Selector('[data-testid=promo-btn]');
38-
sortByDatabaseAlias = Selector('span').withAttribute('title', 'Database Alias');
39-
sortByHostAndPort = Selector('span').withAttribute('title', 'Host:Port');
40-
sortByConnectionType = Selector('span').withAttribute('title', 'Connection Type');
38+
sortByDatabaseAlias = Selector('table th').withText('Database Alias');
39+
sortByHostAndPort = Selector('table th').withText('Host:Port');
40+
sortByConnectionType = Selector('table th').withText('Connection Type');
4141
importDatabasesBtn = Selector('[data-testid=option-btn-import]');
4242
retryImportBtn = Selector('[data-testid=btn-retry]');
4343
removeImportedFileBtn = Selector('[aria-label="Clear selected files"]');

tests/e2e/pageObjects/pub-sub-page.ts

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,24 @@ import { InstancePage } from './instance-page';
33

44
export class PubSubPage extends InstancePage {
55
//CSS Selectors
6-
cssSelectorMessage = '[data-testid^=row]';
6+
cssSelectorMessage = '[data-testid="messages-list"] tr';
77
//-------------------------------------------------------------------------------------------
88
//DECLARATION OF SELECTORS
99
//*Declare all elements/components of the relevant page.
1010
//*Target any element/component via data-id, if possible!
1111
//*The following categories are ordered alphabetically (Alerts, Buttons, Checkboxes, etc.).
1212
//-------------------------------------------------------------------------------------------
1313
//COMPONENTS
14-
subscribeStatus = Selector('[data-testid=subscribe-status-text]');
15-
messages = Selector('[data-testid^=row]');
16-
totalMessagesCount = Selector('[data-testid=messages-count]');
14+
initialPage = Selector('[data-testid=pub-sub-page] [data-testid="empty-messages-list"]')
15+
subscribeStatus = Selector('[data-testid=pub-sub-status]');
16+
messages = Selector('[data-testid="messages-list"] tr');
17+
messagesTable = Selector('[data-testid="messages-list"] table')
18+
messagesTableBottomNav = Selector('[data-testid="messages-list"] nav[data-role=pagination]')
19+
messagesTableFirstPageBtn = Selector('[data-testid="messages-list"] nav[data-role=pagination] button[title="First page"]')
20+
messagesTableLastPageBtn = Selector('[data-testid="messages-list"] nav[data-role=pagination] button[title="Last page"]')
21+
totalMessagesCount = Selector('[data-testid=pub-sub-messages-count]');
1722
pubSubPageContainer = Selector('[data-testid=pub-sub-page]');
18-
clientBadge = Selector('[data-testid=affected-clients-badge]');
23+
publishResult = Selector('[data-testid=publish-result]');
1924
clearButtonTooltip = Selector('[data-radix-popper-content-wrapper]');
2025
ossClusterEmptyMessage = Selector('[data-testid=empty-messages-list-cluster]');
2126
//BUTTONS
@@ -30,7 +35,7 @@ export class PubSubPage extends InstancePage {
3035
channelsSubscribeInput = Selector('[data-testid=channels-input]');
3136

3237
patternsCount = Selector('[data-testid=patterns-count]');
33-
messageCount = Selector('[data-testid=messages-count]');
38+
messageCount = Selector('[data-testid=pub-sub-messages-count]');
3439

3540
/**
3641
* Publish message in pubsub
@@ -55,6 +60,6 @@ export class PubSubPage extends InstancePage {
5560
// Wait for pubsub loading
5661
await t.wait(1000);
5762
await this.publishMessage(channel, message);
58-
await t.expect((this.pubSubPageContainer.find('[data-testid^=row]').withText('message')).exists).ok('Message is not displayed');
63+
await t.expect((this.messages.withText('message')).exists).ok('Message is not displayed');
5964
}
6065
}

tests/e2e/tests/web/critical-path/browser/context.e2e.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import { Common } from '../../../../helpers/common';
55
import { KeyTypesTexts, rte } from '../../../../helpers/constants';
66
import { DatabaseAPIRequests } from '../../../../helpers/api/api-database';
77
import { verifySearchFilterValue } from '../../../../helpers/keys';
8+
import { t } from 'testcafe'
89

910
const myRedisDatabasePage = new MyRedisDatabasePage();
1011
const browserPage = new BrowserPage();
@@ -20,6 +21,8 @@ fixture `Browser Context`
2021
.page(commonUrl)
2122
.beforeEach(async() => {
2223
await databaseHelper.acceptLicenseTermsAndAddDatabaseApi(ossStandaloneConfig);
24+
// Force switch to list view
25+
await t.click(browserPage.browserViewButton);
2326
})
2427
// Update after resolving https://redislabs.atlassian.net/browse/RI-3299
2528
test.skip('Verify that user can see saved CLI size on Browser page when he returns back to Browser page', async t => {
@@ -87,6 +90,8 @@ test('Verify that user can see saved executed commands in CLI on Browser page wh
8790
test
8891
.before(async() => {
8992
await databaseHelper.acceptLicenseTermsAndAddDatabaseApi(ossStandaloneBigConfig);
93+
// Force switch to list view
94+
await t.click(browserPage.browserViewButton);
9095
})('Verify that user can see key details selected when he returns back to Browser page', async t => {
9196
// Scroll keys elements
9297
const scrollY = 1000;

0 commit comments

Comments
 (0)