@@ -19,30 +19,37 @@ let internalLinkName1 = 'probably-1';
19
19
let internalLinkName2 = 'vector-2' ;
20
20
21
21
fixture `Upload custom tutorials`
22
- . meta ( { type : 'regression' , rte : rte . standalone } )
22
+ . meta ( { type : 'regression' , rte : rte . standalone } )
23
23
. page ( commonUrl )
24
24
. beforeEach ( async t => {
25
25
await acceptLicenseTermsAndAddDatabaseApi ( ossStandaloneConfig , ossStandaloneConfig . databaseName ) ;
26
26
await t . click ( myRedisDatabasePage . workbenchButton ) ;
27
27
} )
28
- . afterEach ( async ( ) => {
28
+ . afterEach ( async ( ) => {
29
29
await deleteStandaloneDatabaseApi ( ossStandaloneConfig ) ;
30
30
} ) ;
31
- // https://redislabs.atlassian.net/browse/RI-4186, https://redislabs.atlassian.net/browse/RI-4198, https://redislabs.atlassian.net/browse/RI-4302
31
+ /* https://redislabs.atlassian.net/browse/RI-4186, https://redislabs.atlassian.net/browse/RI-4198,
32
+ https://redislabs.atlassian.net/browse/RI-4302, https://redislabs.atlassian.net/browse/RI-4318
33
+ */
32
34
test ( 'Verify that user can upload tutorial with local zip file without manifest.json' , async t => {
33
35
// Verify that user can upload custom tutorials on docker version
36
+ const imageExternalPath = 'RedisInsight screen external' ;
37
+ const imageRelativePath = 'RedisInsight screen relative' ;
34
38
folder1 = 'folder-1' ;
35
39
folder2 = 'folder-2' ;
36
40
internalLinkName1 = 'probably-1' ;
37
41
internalLinkName2 = 'vector-2' ;
42
+
38
43
// Verify that user can see the “MY TUTORIALS” section in the Enablement area.
39
44
await t . expect ( workbenchPage . customTutorials . visible ) . ok ( 'custom tutorials sections is not visible' ) ;
40
45
await t . click ( workbenchPage . tutorialOpenUploadButton ) ;
41
46
await t . expect ( workbenchPage . tutorialSubmitButton . hasAttribute ( 'disabled' ) ) . ok ( 'submit button is not disabled' ) ;
47
+
42
48
// Verify that User can request to add a new custom Tutorial by uploading a .zip archive from a local folder
43
49
await t . setFilesToUpload ( workbenchPage . tutorialImport , [ filePath ] ) ;
44
50
await t . click ( workbenchPage . tutorialSubmitButton ) ;
45
51
await t . expect ( workbenchPage . tutorialAccordionButton . withText ( tutorialName ) . visible ) . ok ( `${ tutorialName } tutorial is not uploaded` ) ;
52
+
46
53
// Verify that when user upload a .zip archive without a .json manifest, all markdown files are inserted at the same hierarchy level
47
54
await t . click ( workbenchPage . tutorialAccordionButton . withText ( tutorialName ) ) ;
48
55
await t . expect ( ( await workbenchPage . getAccordionButtonWithName ( folder1 ) ) . visible ) . ok ( `${ folder1 } is not visible` ) ;
@@ -52,16 +59,29 @@ test('Verify that user can upload tutorial with local zip file without manifest.
52
59
. ok ( `${ internalLinkName1 } is not visible` ) ;
53
60
await t . click ( await workbenchPage . getAccordionButtonWithName ( folder2 ) ) ;
54
61
await t . expect ( ( await workbenchPage . getInternalLinkWithManifest ( internalLinkName2 ) ) . visible )
55
- . ok ( `${ internalLinkName1 } is not visible` ) ;
62
+ . ok ( `${ internalLinkName2 } is not visible` ) ;
56
63
await t . expect ( workbenchPage . scrolledEnablementArea . exists ) . notOk ( 'enablement area is visible before clicked' ) ;
57
64
await t . click ( ( await workbenchPage . getInternalLinkWithManifest ( internalLinkName1 ) ) ) ;
58
65
await t . expect ( workbenchPage . scrolledEnablementArea . visible ) . ok ( 'enablement area is not visible after clicked' ) ;
66
+
67
+ // Verify that user can see image in custom tutorials by providing absolute external path in md file
68
+ const imageExternal = await workbenchPage . getTutorialImageByAlt ( imageExternalPath ) ;
69
+ await workbenchPage . waitUntilImageRendered ( imageExternal ) ;
70
+ const imageExternalHeight = await imageExternal . getStyleProperty ( 'height' ) ;
71
+ await t . expect ( parseInt ( imageExternalHeight . replace ( / [ ^ \d ] / g, '' ) ) ) . gte ( 150 ) ;
72
+
73
+ // Verify that user can see image in custom tutorials by providing relative path in md file
74
+ const imageRelative = await workbenchPage . getTutorialImageByAlt ( imageRelativePath ) ;
75
+ await workbenchPage . waitUntilImageRendered ( imageRelative ) ;
76
+ const imageRelativeHeight = await imageRelative . getStyleProperty ( 'height' ) ;
77
+ await t . expect ( parseInt ( imageRelativeHeight . replace ( / [ ^ \d ] / g, '' ) ) ) . gte ( 150 ) ;
78
+
79
+ // 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
59
80
await t . click ( workbenchPage . closeEnablementPage ) ;
60
81
await t . click ( workbenchPage . tutorialLatestDeleteIcon ) ;
61
82
await t . expect ( workbenchPage . tutorialDeleteButton . visible ) . ok ( 'Delete popup is not visible' ) ;
62
83
await t . click ( workbenchPage . tutorialDeleteButton ) ;
63
84
await t . expect ( workbenchPage . tutorialDeleteButton . exists ) . notOk ( 'Delete popup is still visible' ) ;
64
- // 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
65
85
await t . expect ( ( workbenchPage . tutorialAccordionButton . withText ( tutorialName ) . exists ) )
66
86
. notOk ( `${ tutorialName } tutorial is not uploaded` ) ;
67
87
} ) ;
0 commit comments