Skip to content

Commit 7c6f93a

Browse files
e2e - enablement area tests
1 parent 2ec601b commit 7c6f93a

File tree

2 files changed

+47
-0
lines changed

2 files changed

+47
-0
lines changed

tests/e2e/pageObjects/workbench-page.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,12 @@ export class WorkbenchPage {
8080
cancelButton: Selector
8181
applyButton: Selector
8282
documentButtonInQuickGuides: Selector
83+
redisStackTutorialsButton: Selector
84+
vectorSimilitaritySearchButton: Selector
85+
nextPageButton: Selector
86+
prevPageButton: Selector
87+
hashWithVectorButton: Selector
88+
redisStackLinks: Selector
8389

8490
constructor() {
8591
//CSS selectors
@@ -130,6 +136,12 @@ export class WorkbenchPage {
130136
this.cancelButton = Selector('[data-testid=cancel-btn]');
131137
this.applyButton = Selector('[data-testid=apply-btn]');
132138
this.documentButtonInQuickGuides = Selector('[data-testid=accordion-button-document]');
139+
this.redisStackTutorialsButton = Selector('[data-testid=accordion-button-redis_stack]');
140+
this.vectorSimilitaritySearchButton = Selector('[data-testid=internal-link-vector_similarity_search]');
141+
this.nextPageButton = Selector('[data-testid=enablement-area__next-page-btn]');
142+
this.prevPageButton = Selector('[data-testid=enablement-area__prev-page-btn]');
143+
this.hashWithVectorButton = Selector('[data-testid="preselect-A hash with vector embeddings"]');
144+
this.redisStackLinks = Selector('[data-testid=accordion-redis_stack] [data-testid^=internal-link]');
133145
// TEXT INPUTS (also referred to as 'Text fields')
134146
this.queryInput = Selector('[data-testid=query-input-container]');
135147
this.scriptsLines = Selector('[data-testid=query-input-container] .view-lines');

tests/e2e/tests/regression/workbench/default-scripts-area.e2e.ts

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,3 +133,38 @@ test
133133
//Verify the quick navigation section
134134
await t.expect(workbenchPage.enablementAreaPagination.visible).ok('The quick navigation section is displayed');
135135
});
136+
test
137+
.meta({ rte: rte.standalone })
138+
('Verify that user can see the pagination for redis stack pages in Tutorials', async t => {
139+
//Open any redis stack Tutorials
140+
await t.click(workbenchPage.redisStackTutorialsButton);
141+
await t.click(workbenchPage.vectorSimilitaritySearchButton);
142+
//Verify the pagination
143+
await t.expect(workbenchPage.enablementAreaPagination.visible).ok('The user can see the pagination for redis stack pages');
144+
await t.expect(workbenchPage.nextPageButton.visible).ok('The user can see the next page for redis stack pages');
145+
await t.expect(workbenchPage.prevPageButton.visible).ok('The user can see the prev page for redis stack pages');
146+
});
147+
test
148+
.meta({ rte: rte.standalone })
149+
('Verify that the same type of content is supported in the “Tutorials” as in the “Quick Guides”', async t => {
150+
const tutorialsContent = [
151+
'Working with JSON',
152+
'Vector Similarity Search',
153+
'Redis for time series',
154+
'Working with graphs',
155+
'Probabilistic data structures'
156+
];
157+
const command = 'HSET bikes:10000 ';
158+
//Verify the redis stack links
159+
await t.click(workbenchPage.redisStackTutorialsButton);
160+
const linksCount = await workbenchPage.redisStackLinks.count;
161+
for(let i = 0; i < linksCount; i++) {
162+
await t.expect(workbenchPage.redisStackLinks.nth(i).textContent).eql(tutorialsContent[i], `The link ${tutorialsContent[i]} is in the Enablement area`);
163+
}
164+
//Verify the load script to Editor
165+
await t.click(workbenchPage.vectorSimilitaritySearchButton);
166+
await t.expect(workbenchPage.queryInputScriptArea.textContent).eql('', 'The editor is empty');
167+
await t.click(workbenchPage.hashWithVectorButton);
168+
const editorContent = (await workbenchPage.queryInputScriptArea.textContent).replace(/\s/g, ' ')
169+
await t.expect(editorContent).eql(command, 'The selected command is in the Editor');
170+
});

0 commit comments

Comments
 (0)