Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions tests/e2e/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ remote
.redisinsight
.redisinsight-v2
.redisinsight-app
rihomedir
Binary file not shown.
84 changes: 43 additions & 41 deletions tests/e2e/tests/web/regression/insights/import-tutorials.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,47 +114,49 @@ test
.notOk(`${tutorialName} tutorial is not uploaded`);
});
// https://redislabs.atlassian.net/browse/RI-4186, https://redislabs.atlassian.net/browse/RI-4213, https://redislabs.atlassian.net/browse/RI-4302
test.after(async() => {
tutorialName = 'Tutorials with manifest';
const tutorials = await workbenchPage.InsightsPanel.setActiveTab(ExploreTabs.Explore);
if(await tutorials.tutorialAccordionButton.withText(tutorialName).exists) {
await tutorials.deleteTutorialByName(tutorialName);
}
await databaseAPIRequests.deleteStandaloneDatabaseApi(ossStandaloneConfig);
})('Verify that user can upload tutorial with URL with manifest.json', async t => {
const labelFromManifest = 'LabelFromManifest';
const link = 'https://github.com/RedisInsight/RedisInsight/raw/main/tests/e2e/test-data/upload-tutorials/TutorialsWithManifest.zip';
internalLinkName1 = 'manifest-id';
tutorialName = 'Tutorials with manifest';
const summary = 'Summary for JSON';

await workbenchPage.InsightsPanel.togglePanel(true);
const tutorials = await workbenchPage.InsightsPanel.setActiveTab(ExploreTabs.Explore);
await t.click(tutorials.tutorialOpenUploadButton);
// Verify that user can upload tutorials using a URL
await t.typeText(tutorials.tutorialLinkField, link);
await t.click(tutorials.tutorialSubmitButton);
await t.expect(tutorials.tutorialAccordionButton.withText(tutorialName).with({ timeout: 20000 }).visible)
.ok(`${tutorialName} tutorial is not uploaded`);
await t.click(tutorials.tutorialAccordionButton.withText(tutorialName));
// Verify that User can see the same structure in the tutorial uploaded as described in the .json manifest
await t.expect(tutorials.getInternalLinkWithoutManifest(internalLinkName1).visible)
.ok(`${internalLinkName1} folder specified in manifest is not visible`);
await t.expect(tutorials.getInternalLinkWithoutManifest(internalLinkName1).textContent)
.contains(labelFromManifest, `${labelFromManifest} tutorial specified in manifest is not visible`);
await t.expect(tutorials.getInternalLinkWithoutManifest(internalLinkName1).textContent)
.contains(summary, `${summary} tutorial specified in manifest is not visible`);
await t.click(tutorials.getInternalLinkWithoutManifest(internalLinkName1));
await t.expect(tutorials.scrolledEnablementArea.visible).ok('enablement area is not visible after clicked');
await t.click(tutorials.closeEnablementPage);
await t.click(tutorials.tutorialLatestDeleteIcon);
await t.expect(tutorials.tutorialDeleteButton.visible).ok('Delete popup is not visible');
await t.click(tutorials.tutorialDeleteButton);
await t.expect(tutorials.tutorialDeleteButton.exists).notOk('Delete popup is still visible');
// Verify that when User delete the tutorial, then User can see this tutorial and relevant markdown files are deleted from: the Enablement area in Workbench
await t.expect(tutorials.tutorialAccordionButton.withText(tutorialName).exists)
.notOk(`${tutorialName} tutorial is not uploaded`);
});
// skipped because need to move .zip tutorial to another github repository
test.skip
.after(async() => {
tutorialName = 'Tutorials with manifest';
const tutorials = await workbenchPage.InsightsPanel.setActiveTab(ExploreTabs.Explore);
if(await tutorials.tutorialAccordionButton.withText(tutorialName).exists) {
await tutorials.deleteTutorialByName(tutorialName);
}
await databaseAPIRequests.deleteStandaloneDatabaseApi(ossStandaloneConfig);
})('Verify that user can upload tutorial with URL with manifest.json', async t => {
const labelFromManifest = 'LabelFromManifest';
const link = 'https://github.com/RedisInsight/RedisInsight/raw/main/tests/e2e/test-data/upload-tutorials/TutorialsWithManifest.zip';
internalLinkName1 = 'manifest-id';
tutorialName = 'Tutorials with manifest';
const summary = 'Summary for JSON';

await workbenchPage.InsightsPanel.togglePanel(true);
const tutorials = await workbenchPage.InsightsPanel.setActiveTab(ExploreTabs.Explore);
await t.click(tutorials.tutorialOpenUploadButton);
// Verify that user can upload tutorials using a URL
await t.typeText(tutorials.tutorialLinkField, link);
await t.click(tutorials.tutorialSubmitButton);
await t.expect(tutorials.tutorialAccordionButton.withText(tutorialName).with({ timeout: 20000 }).visible)
.ok(`${tutorialName} tutorial is not uploaded`);
await t.click(tutorials.tutorialAccordionButton.withText(tutorialName));
// Verify that User can see the same structure in the tutorial uploaded as described in the .json manifest
await t.expect(tutorials.getInternalLinkWithoutManifest(internalLinkName1).visible)
.ok(`${internalLinkName1} folder specified in manifest is not visible`);
await t.expect(tutorials.getInternalLinkWithoutManifest(internalLinkName1).textContent)
.contains(labelFromManifest, `${labelFromManifest} tutorial specified in manifest is not visible`);
await t.expect(tutorials.getInternalLinkWithoutManifest(internalLinkName1).textContent)
.contains(summary, `${summary} tutorial specified in manifest is not visible`);
await t.click(tutorials.getInternalLinkWithoutManifest(internalLinkName1));
await t.expect(tutorials.scrolledEnablementArea.visible).ok('enablement area is not visible after clicked');
await t.click(tutorials.closeEnablementPage);
await t.click(tutorials.tutorialLatestDeleteIcon);
await t.expect(tutorials.tutorialDeleteButton.visible).ok('Delete popup is not visible');
await t.click(tutorials.tutorialDeleteButton);
await t.expect(tutorials.tutorialDeleteButton.exists).notOk('Delete popup is still visible');
// Verify that when User delete the tutorial, then User can see this tutorial and relevant markdown files are deleted from: the Enablement area in Workbench
await t.expect(tutorials.tutorialAccordionButton.withText(tutorialName).exists)
.notOk(`${tutorialName} tutorial is not uploaded`);
});
// https://redislabs.atlassian.net/browse/RI-4352
test
.before(async t => {
Expand Down