Skip to content

Commit 85a9cdc

Browse files
authored
Merge pull request #1323 from RedisInsight/e2e/feature/RI-3646-change-expiration-timeline-to-bar-chart
E2e/feature/ri 3646 change expiration timeline to bar chart
2 parents 4885d33 + 50cab84 commit 85a9cdc

File tree

2 files changed

+16
-16
lines changed

2 files changed

+16
-16
lines changed

tests/e2e/pageObjects/memory-efficiency-page.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,8 @@ export class MemoryEfficiencyPage {
3333
tableKeysHeader = Selector('[data-test-subj*=tableHeaderCell_keys]');
3434
// GRAPH ELEMENTS
3535
donutTotalKeys = Selector('[data-testid=donut-title-keys]');
36-
firstPoint = Selector('[data-testid*=circle-3600]');
37-
thirdPoint = Selector('[data-testid*=circle-43200]');
38-
fourthPoint = Selector('[data-testid*=circle-86400]');
39-
noExpiryPoint = Selector('[data-testid*=circle-0]');
40-
noExpiryDefaultPoint = Selector('[data-testid=circle-0-0]');
36+
firstPoint = Selector('[data-testid*=bar-3600]');
37+
thirdPoint = Selector('[data-testid*=bar-43200]');
38+
fourthPoint = Selector('[data-testid*=bar-86400]');
39+
noExpiryPoint = Selector('[data-testid*=bar-0-]:not(rect[data-testid=bar-0-0])');
4140
}

tests/e2e/tests/critical-path/memory-efficiency/memory-efficiency.e2e.ts

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -196,22 +196,23 @@ test
196196
await browserPage.deleteKeyByName(streamKeyNameDelimiter);
197197
await deleteStandaloneDatabaseApi(ossStandaloneConfig);
198198
})('Summary per expiration time', async t => {
199-
// Create new report
199+
const yAxis: number = 218;
200+
// Create new report
200201
await t.click(memoryEfficiencyPage.newReportBtn);
201202
// Points are displayed in graph according to their TTL
202-
const firstPointLocation = +((await memoryEfficiencyPage.firstPoint.getAttribute('cy')).slice(0, 2));
203-
const thirdPointLocation = await memoryEfficiencyPage.thirdPoint.getAttribute('cy');
204-
const fourthPointLocation = +((await memoryEfficiencyPage.fourthPoint.getAttribute('cy')).slice(0, 2));
205-
const noExpiryDefaultPointLocation = memoryEfficiencyPage.noExpiryDefaultPoint;
203+
const firstPointLocation = +((await memoryEfficiencyPage.firstPoint.getAttribute('y')).slice(0, 2));
204+
const thirdPointLocation = await memoryEfficiencyPage.thirdPoint.getAttribute('y');
205+
const fourthPointLocation = +((await memoryEfficiencyPage.fourthPoint.getAttribute('y')).slice(0, 2));
206+
const noExpiryDefaultPointLocation = memoryEfficiencyPage.noExpiryPoint;
206207

207-
await t.expect(firstPointLocation).lt(198, 'Point in <1 hr breakdown doesn\'t contain key');
208-
await t.expect(fourthPointLocation).lt(198, 'Point in 12-25 Hrs breakdown doesn\'t contain key');
209-
await t.expect(thirdPointLocation).eql('198', 'Point in 4-12 Hrs breakdown contains key');
210-
await t.expect(noExpiryDefaultPointLocation.exists).notOk('No expiry breakdown displayed when toggle is off', {timeout: 1000});
208+
await t.expect(firstPointLocation).lt(yAxis, 'Point in <1 hr breakdown doesn\'t contain key');
209+
await t.expect(fourthPointLocation).lt(yAxis, 'Point in 12-25 Hrs breakdown doesn\'t contain key');
210+
await t.expect(thirdPointLocation).eql(`${yAxis}`, 'Point in 4-12 Hrs breakdown contains key');
211+
await t.expect(noExpiryDefaultPointLocation.visible).notOk('No expiry breakdown displayed when toggle is off', {timeout: 1000});
211212
// No Expiry toggle shows No expiry breakdown
212213
await t.click(memoryEfficiencyPage.showNoExpiryToggle);
213-
const noExpiryPointLocation = +((await memoryEfficiencyPage.noExpiryPoint.getAttribute('cy')).slice(0, 2));
214-
await t.expect(noExpiryPointLocation).lt(198, 'Point in No expiry breakdown doesn\'t contain key');
214+
const noExpiryPointLocation = +((await memoryEfficiencyPage.noExpiryPoint.getAttribute('y')).slice(0, 2));
215+
await t.expect(noExpiryPointLocation).lt(yAxis, 'Point in No expiry breakdown doesn\'t contain key');
215216
});
216217
test
217218
.before(async t => {

0 commit comments

Comments
 (0)