@@ -6,14 +6,13 @@ import {
6
6
import { MyRedisDatabasePage , WorkbenchPage } from '../../../pageObjects' ;
7
7
import { commonUrl , ossStandaloneConfig } from '../../../helpers/conf' ;
8
8
import { deleteStandaloneDatabaseApi } from '../../../helpers/api/api-database' ;
9
- import { Common } from '../../../helpers/common' ;
10
9
11
10
const myRedisDatabasePage = new MyRedisDatabasePage ( ) ;
12
11
const workbenchPage = new WorkbenchPage ( ) ;
13
- const common = new Common ( ) ;
14
- const filePath = path . join ( '..' , '..' , '..' , 'test-data' , 'upload-tutorials' , 'sample.zip' ) ;
15
- const tutorialName = `tutorialName- ${ common . generateWord ( 10 ) } ` ;
16
- const link = 'https://drive.google.com/uc?export=download&id=1mlyDKWLu12L02FblOPh15EwG2Vy_FhJ7 ' ;
12
+ const filePath = path . join ( '..' , '..' , '..' , 'test-data' , 'upload-tutorials' , 'testTutorials.zip' ) ;
13
+ const tutorialName = 'testTutorials' ;
14
+ const tutorialName2 = 'tutorialTestByLink' ;
15
+ const link = 'https://drive.google.com/uc?id=1puRUoT8HmyZCekkeWNxBzXe_48TzXcJc&export=download ' ;
17
16
let folder1 = 'folder-1' ;
18
17
let folder2 = 'folder-2' ;
19
18
let internalLinkName1 = 'probably-1' ;
@@ -29,7 +28,7 @@ fixture `Upload custom tutorials`
29
28
. afterEach ( async ( ) => {
30
29
await deleteStandaloneDatabaseApi ( ossStandaloneConfig ) ;
31
30
} ) ;
32
- // https://redislabs.atlassian.net/browse/RI-4186, https://redislabs.atlassian.net/browse/RI-4198
31
+ // https://redislabs.atlassian.net/browse/RI-4186, https://redislabs.atlassian.net/browse/RI-4198, https://redislabs.atlassian.net/browse/RI-4302
33
32
test ( 'Verify that user can upload tutorial with local zip file without manifest.json' , async t => {
34
33
// Verify that user can upload custom tutorials on docker version
35
34
folder1 = 'folder-1' ;
@@ -39,8 +38,6 @@ test('Verify that user can upload tutorial with local zip file without manifest.
39
38
// Verify that user can see the “MY TUTORIALS” section in the Enablement area.
40
39
await t . expect ( workbenchPage . customTutorials . visible ) . ok ( 'custom tutorials sections is not visible' ) ;
41
40
await t . click ( workbenchPage . tutorialOpenUploadButton ) ;
42
- // Verify that User can enter a tutorial name
43
- await t . typeText ( workbenchPage . tutorialNameField , tutorialName ) ;
44
41
await t . expect ( workbenchPage . tutorialSubmitButton . hasAttribute ( 'disabled' ) ) . ok ( 'submit button is not disabled' ) ;
45
42
// Verify that User can request to add a new custom Tutorial by uploading a .zip archive from a local folder
46
43
await t . setFilesToUpload ( workbenchPage . tutorialImport , [ filePath ] ) ;
@@ -50,10 +47,12 @@ test('Verify that user can upload tutorial with local zip file without manifest.
50
47
await t . click ( workbenchPage . tutorialAccordionButton . withText ( tutorialName ) ) ;
51
48
await t . expect ( ( await workbenchPage . getAccordionButtonWithName ( folder1 ) ) . visible ) . ok ( `${ folder1 } is not visible` ) ;
52
49
await t . expect ( ( await workbenchPage . getAccordionButtonWithName ( folder2 ) ) . visible ) . ok ( `${ folder2 } is not visible` ) ;
50
+ await t . click ( await workbenchPage . getAccordionButtonWithName ( folder1 ) ) ;
53
51
await t . expect ( ( await workbenchPage . getInternalLinkWithManifest ( internalLinkName1 ) ) . visible )
54
52
. ok ( `${ internalLinkName1 } is not visible` ) ;
53
+ await t . click ( await workbenchPage . getAccordionButtonWithName ( folder2 ) ) ;
55
54
await t . expect ( ( await workbenchPage . getInternalLinkWithManifest ( internalLinkName2 ) ) . visible )
56
- . ok ( `${ internalLinkName2 } is not visible` ) ;
55
+ . ok ( `${ internalLinkName1 } is not visible` ) ;
57
56
await t . expect ( workbenchPage . scrolledEnablementArea . exists ) . notOk ( 'enablement area is visible before clicked' ) ;
58
57
await t . click ( ( await workbenchPage . getInternalLinkWithManifest ( internalLinkName1 ) ) ) ;
59
58
await t . expect ( workbenchPage . scrolledEnablementArea . visible ) . ok ( 'enablement area is not visible after clicked' ) ;
@@ -66,21 +65,23 @@ test('Verify that user can upload tutorial with local zip file without manifest.
66
65
await t . expect ( ( workbenchPage . tutorialAccordionButton . withText ( tutorialName ) . exists ) )
67
66
. notOk ( `${ tutorialName } tutorial is not uploaded` ) ;
68
67
} ) ;
69
- // https://redislabs.atlassian.net/browse/RI-4186, https://redislabs.atlassian.net/browse/RI-4213
68
+ // https://redislabs.atlassian.net/browse/RI-4186, https://redislabs.atlassian.net/browse/RI-4213, https://redislabs.atlassian.net/browse/RI-4302
70
69
test ( 'Verify that user can upload tutorial with URL with manifest.json' , async t => {
71
- internalLinkName1 = 'working_probably' ;
70
+ const labelFromManifest = 'LabelFromManifest' ;
71
+ internalLinkName1 = 'manifest-id' ;
72
72
73
73
await t . click ( workbenchPage . tutorialOpenUploadButton ) ;
74
- await t . typeText ( workbenchPage . tutorialNameField , tutorialName ) ;
75
74
// Verify that user can upload tutorials using a URL
76
75
await t . typeText ( workbenchPage . tutorialLinkField , link ) ;
77
76
await t . click ( workbenchPage . tutorialSubmitButton ) ;
78
- await t . expect ( workbenchPage . tutorialAccordionButton . withText ( tutorialName ) . with ( { timeout : 20000 } ) . visible )
79
- . ok ( `${ tutorialName } tutorial is not uploaded` ) ;
80
- await t . click ( workbenchPage . tutorialAccordionButton . withText ( tutorialName ) ) ;
77
+ await t . expect ( workbenchPage . tutorialAccordionButton . withText ( tutorialName2 ) . with ( { timeout : 20000 } ) . visible )
78
+ . ok ( `${ tutorialName2 } tutorial is not uploaded` ) ;
79
+ await t . click ( workbenchPage . tutorialAccordionButton . withText ( tutorialName2 ) ) ;
81
80
// Verify that User can see the same structure in the tutorial uploaded as described in the .json manifest
82
81
await t . expect ( ( await workbenchPage . getInternalLinkWithoutManifest ( internalLinkName1 ) ) . visible )
83
- . ok ( `${ internalLinkName1 } folder is not visible` ) ;
82
+ . ok ( `${ internalLinkName1 } folder specified in manifest is not visible` ) ;
83
+ await t . expect ( await ( await workbenchPage . getInternalLinkWithoutManifest ( internalLinkName1 ) ) . textContent )
84
+ . eql ( labelFromManifest , `${ labelFromManifest } tutorial specified in manifest is not visible` ) ;
84
85
await t . click ( ( await workbenchPage . getInternalLinkWithoutManifest ( internalLinkName1 ) ) ) ;
85
86
await t . expect ( workbenchPage . scrolledEnablementArea . visible ) . ok ( 'enablement area is not visible after clicked' ) ;
86
87
await t . click ( workbenchPage . closeEnablementPage ) ;
@@ -89,6 +90,6 @@ test('Verify that user can upload tutorial with URL with manifest.json', async t
89
90
await t . click ( workbenchPage . tutorialDeleteButton ) ;
90
91
await t . expect ( workbenchPage . tutorialDeleteButton . exists ) . notOk ( 'Delete popup is still visible' ) ;
91
92
// 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
92
- await t . expect ( ( workbenchPage . tutorialAccordionButton . withText ( tutorialName ) . exists ) )
93
- . notOk ( `${ tutorialName } tutorial is not uploaded` ) ;
93
+ await t . expect ( ( workbenchPage . tutorialAccordionButton . withText ( tutorialName2 ) . exists ) )
94
+ . notOk ( `${ tutorialName2 } tutorial is not uploaded` ) ;
94
95
} ) ;
0 commit comments