Skip to content

Commit 1931e31

Browse files
Merge pull request #2619 from RedisInsight/e2e/bugfix/stabilization_for_tests
fix for sm tests
2 parents 4fa0194 + e36ff34 commit 1931e31

File tree

4 files changed

+11
-10
lines changed

4 files changed

+11
-10
lines changed

tests/e2e/pageObjects/base-page.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
1-
import { t } from 'testcafe';
1+
import { Selector, t } from 'testcafe';
22
import { NavigationPanel } from './components/navigation-panel';
33
import { Toast } from './components/toast';
44
import { ShortcutsPanel } from './components/shortcuts-panel';
55

66
export class BasePage {
7+
notification = Selector('[data-testid^=-notification]');
8+
79
NavigationPanel = new NavigationPanel();
810
ShortcutsPanel = new ShortcutsPanel();
911
Toast = new Toast();

tests/e2e/pageObjects/components/myRedisDatabase/add-redis-database.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ export class AddRedisDatabase {
3333
showPasswordBtn = Selector('[aria-label^="Show password"]');
3434
testConnectionBtn = Selector('[data-testid=btn-test-connection]');
3535
// TEXT INPUTS (also referred to as 'Text fields')
36-
disabledDatabaseInfo = Selector('[class=euiListGroupItem__text]');
36+
disabledDatabaseInfo = Selector('[class=euiListGroupItem__label]');
3737
hostInput = Selector('[data-testid=host]');
3838
portInput = Selector('[data-testid=port]');
3939
databaseAliasInput = Selector('[data-testid=name]');

tests/e2e/tests/critical-path/pub-sub/subscribe-unsubscribe.e2e.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ fixture `Subscribe/Unsubscribe from a channel`
2020
await t.click(myRedisDatabasePage.NavigationPanel.pubSubButton);
2121
})
2222
.afterEach(async() => {
23-
await databaseAPIRequests.deleteStandaloneDatabaseApi(ossStandaloneConfig);
23+
await databaseAPIRequests.deleteAllDatabasesApi();
2424
});
2525
test('Verify that when user subscribe to the pubsub channel he can see all the messages being published to my database from the moment of my subscription', async t => {
2626
// Verify that the Channel field placeholder is 'Enter Channel Name'
@@ -66,17 +66,16 @@ test('Verify that the focus gets always shifted to a newest message (auto-scroll
6666
});
6767
test
6868
.before(async t => {
69-
await databaseHelper.acceptLicenseTerms();
70-
await databaseAPIRequests.addNewStandaloneDatabaseApi(ossStandaloneV5Config);
69+
await databaseHelper.acceptLicenseTermsAndAddDatabase(ossStandaloneV5Config);
70+
await t.click(pubSubPage.NavigationPanel.myRedisDBButton);
7171
await databaseAPIRequests.addNewStandaloneDatabaseApi(ossStandaloneConfig);
7272
await myRedisDatabasePage.reloadPage();
7373
await myRedisDatabasePage.clickOnDBByName(ossStandaloneConfig.databaseName);
7474
// Go to PubSub page
7575
await t.click(myRedisDatabasePage.NavigationPanel.pubSubButton);
7676
})
7777
.after(async() => {
78-
await databaseAPIRequests.deleteStandaloneDatabaseApi(ossStandaloneV5Config);
79-
await databaseAPIRequests.deleteStandaloneDatabaseApi(ossStandaloneConfig);
78+
await databaseAPIRequests.deleteAllDatabasesApi();
8079
})('Verify that user subscription state is changed to unsubscribed, all the messages are cleared and total message counter is reset when user connect to another database', async t => {
8180
await t.click(pubSubPage.subscribeButton);
8281
// Publish 10 messages

tests/e2e/tests/critical-path/url-handling/url-handling.e2e.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ test
3434
};
3535

3636
await t.navigateTo(generateLink(connectUrlParams));
37-
await t.expect(await myRedisDatabasePage.AddRedisDatabase.disabledDatabaseInfo.nth(0).find('span').getAttribute('title')).contains(host, 'Wrong host value');
38-
await t.expect(await myRedisDatabasePage.AddRedisDatabase.disabledDatabaseInfo.nth(1).find('span').getAttribute('title')).contains(port, 'Wrong port value');
37+
await t.expect(await myRedisDatabasePage.AddRedisDatabase.disabledDatabaseInfo.nth(0).getAttribute('title')).contains(host, 'Wrong host value');
38+
await t.expect(await myRedisDatabasePage.AddRedisDatabase.disabledDatabaseInfo.nth(1).getAttribute('title')).contains(port, 'Wrong port value');
3939
await t.click(await myRedisDatabasePage.AddRedisDatabase.addRedisDatabaseButton);
4040
// wait for db is added
4141
await t.wait(3_000);
@@ -75,8 +75,8 @@ test
7575

7676
//Verify that the same db is not added
7777
await t.navigateTo(generateLink(connectUrlParams));
78-
await t.wait(3_000);
7978
await t.click(await workbenchPage.NavigationPanel.myRedisDBButton);
79+
await t.expect(browserPage.notification.exists).notOk({ timeout: 10000 });
8080
await t.expect(await myRedisDatabasePage.dbNameList.child('span').withExactText(databaseName).count).eql(2, 'the same db is added twice');
8181
});
8282

0 commit comments

Comments
 (0)