@@ -52,21 +52,19 @@ fixture `Triggers and Functions`
52
52
await browserPage . Cli . sendCommandInCli ( `TFUNCTION DELETE ${ libraryName } ` ) ;
53
53
await databaseAPIRequests . deleteStandaloneDatabaseApi ( ossStandaloneRedisGears ) ;
54
54
} ) ;
55
-
56
55
test ( 'Verify that when user can see added library' , async t => {
57
-
58
56
const item = { name : libraryName , user : 'default' , pending : 0 , totalFunctions : 1 } as TriggersAndFunctionLibrary ;
59
57
const command = `TFUNCTION LOAD "#!js api_version=1.0 name=${ libraryName } \\n redis.registerFunction(\'foo\', ()=>{return \'bar\'})"` ;
58
+
60
59
await browserPage . Cli . sendCommandInCli ( command ) ;
61
60
await t . click ( browserPage . NavigationPanel . triggeredFunctionsButton ) ;
62
61
await t . click ( triggersAndFunctionsFunctionsPage . librariesLink ) ;
63
- const row = await triggersAndFunctionsLibrariesPage . getLibraryItem ( libraryName ) ;
62
+ const row = await triggersAndFunctionsLibrariesPage . getLibraryItem ( libraryName ) ;
64
63
await t . expect ( row . name ) . eql ( item . name , 'library name is unexpected' ) ;
65
64
await t . expect ( row . user ) . eql ( item . user , 'user name is unexpected' ) ;
66
65
await t . expect ( row . pending ) . eql ( item . pending , 'user name is unexpected' ) ;
67
66
await t . expect ( row . totalFunctions ) . eql ( item . totalFunctions , 'user name is unexpected' ) ;
68
67
} ) ;
69
-
70
68
test ( 'Verify that library details is displayed' , async t => {
71
69
const command = `TFUNCTION LOAD "#!js api_version=1.0 name=${ libraryName } \\n
72
70
redis.registerFunction('${ LIBRARIES_LIST [ 0 ] . name } ', function(){});
@@ -80,13 +78,12 @@ test('Verify that library details is displayed', async t => {
80
78
81
79
await t . click ( browserPage . NavigationPanel . triggeredFunctionsButton ) ;
82
80
await t . click ( triggersAndFunctionsFunctionsPage . librariesLink ) ;
83
- await t . click ( await triggersAndFunctionsLibrariesPage . getLibraryNameSelector ( libraryName ) ) ;
81
+ await t . click ( triggersAndFunctionsLibrariesPage . getLibraryNameSelector ( libraryName ) ) ;
84
82
85
83
for ( const { name, type } of LIBRARIES_LIST ) {
86
84
await t . expect ( await triggersAndFunctionsLibrariesPage . getFunctionsByName ( type , name ) . exists ) . ok ( `library is not displayed in ${ type } section` ) ;
87
85
}
88
86
} ) ;
89
-
90
87
test ( 'Verify that user can modify code' , async t => {
91
88
const command = `TFUNCTION LOAD "#!js api_version=1.0 name=${ libraryName } \\n redis.registerFunction(\'foo\', ()=>{return \'bar\'});"` ;
92
89
const commandUpdatedPart1 = `#!js api_version=1.0 name=${ libraryName } ` ;
@@ -96,21 +93,20 @@ test('Verify that user can modify code', async t => {
96
93
await browserPage . Cli . sendCommandInCli ( command ) ;
97
94
await t . click ( browserPage . NavigationPanel . triggeredFunctionsButton ) ;
98
95
await t . click ( triggersAndFunctionsFunctionsPage . librariesLink ) ;
99
- await t . click ( await triggersAndFunctionsLibrariesPage . getLibraryNameSelector ( libraryName ) ) ;
96
+ await t . click ( triggersAndFunctionsLibrariesPage . getLibraryNameSelector ( libraryName ) ) ;
100
97
await t . click ( triggersAndFunctionsLibrariesPage . editMonacoButton ) ;
101
98
await triggersAndFunctionsLibrariesPage . sendTextToMonaco ( MonacoEditorInputs . Library , commandUpdatedPart1 , commandUpdatedPart2 ) ;
102
99
await t . click ( triggersAndFunctionsLibrariesPage . acceptButton ) ;
103
100
await t . expect (
104
101
( await triggersAndFunctionsLibrariesPage . getTextFromMonaco ( ) ) ) . eql ( commandUpdatedPart1 + commandUpdatedPart2 ) , 'code was not updated' ;
105
102
106
- await t . click ( await triggersAndFunctionsLibrariesPage . configurationLink ) ;
103
+ await t . click ( triggersAndFunctionsLibrariesPage . configurationLink ) ;
107
104
await t . click ( triggersAndFunctionsLibrariesPage . editMonacoButton ) ;
108
105
await triggersAndFunctionsLibrariesPage . sendTextToMonaco ( MonacoEditorInputs . LibraryConfiguration , configuration ) ;
109
106
await t . click ( triggersAndFunctionsLibrariesPage . acceptButton ) ;
110
107
await t . expect (
111
108
( await triggersAndFunctionsLibrariesPage . getTextFromMonaco ( ) ) ) . eql ( configuration , 'configuration was not added' ) ;
112
109
} ) ;
113
-
114
110
test ( 'Verify that function details is displayed' , async t => {
115
111
const command = `TFUNCTION LOAD "#!js api_version=1.0 name=${ libraryName } \\n
116
112
redis.registerAsyncFunction('${ LIBRARIES_LIST [ 2 ] . name } ', function(client){
@@ -119,7 +115,7 @@ test('Verify that function details is displayed', async t => {
119
115
120
116
await browserPage . Cli . sendCommandInCli ( command ) ;
121
117
await t . click ( browserPage . NavigationPanel . triggeredFunctionsButton ) ;
122
- await t . click ( await triggersAndFunctionsFunctionsPage . getFunctionsNameSelector ( LIBRARIES_LIST [ 2 ] . name ) ) ;
118
+ await t . click ( triggersAndFunctionsFunctionsPage . getFunctionsNameSelector ( LIBRARIES_LIST [ 2 ] . name ) ) ;
123
119
let fieldsAndValue = await triggersAndFunctionsFunctionsPage . getFieldsAndValuesBySection ( FunctionsSections . General ) ;
124
120
await t . expect ( fieldsAndValue ) . contains ( functionDetails . libraryName , 'library name is not corrected' ) ;
125
121
await t . expect ( fieldsAndValue ) . contains ( functionDetails . isAsync , 'async is not corrected' ) ;
@@ -128,14 +124,14 @@ test('Verify that function details is displayed', async t => {
128
124
await t . expect ( fieldsAndValue ) . contains ( functionDetails . flag , 'flag name is not displayed' ) ;
129
125
} ) ;
130
126
test ( 'Verify that library and functions can be deleted' , async t => {
131
-
132
127
const libraryName2 = `${ libraryName } 2` ;
133
128
const command1 = `TFUNCTION LOAD "#!js api_version=1.0 name=${ libraryName } \\n redis.registerFunction(\'${ LIBRARIES_LIST [ 0 ] . name } \', ()=>{return \'bar\'})"` ;
134
129
const command2 = `TFUNCTION LOAD "#!js api_version=1.0 name=${ libraryName2 } \\n redis.registerFunction(\'${ LIBRARIES_LIST [ 1 ] . name } \', ()=>{return \'bar\'})"` ;
130
+
135
131
await browserPage . Cli . sendCommandInCli ( command1 ) ;
136
132
await browserPage . Cli . sendCommandInCli ( command2 ) ;
137
- await t . click ( await browserPage . NavigationPanel . triggeredFunctionsButton ) ;
138
- await t . click ( await triggersAndFunctionsFunctionsPage . librariesLink ) ;
133
+ await t . click ( browserPage . NavigationPanel . triggeredFunctionsButton ) ;
134
+ await t . click ( triggersAndFunctionsFunctionsPage . librariesLink ) ;
139
135
await triggersAndFunctionsLibrariesPage . deleteLibraryByName ( libraryName2 ) ;
140
136
await t . expect ( await triggersAndFunctionsLibrariesPage . getLibraryNameSelector ( libraryName2 ) . exists ) . notOk ( `the library ${ libraryName2 } was not deleted` ) ;
141
137
await t . click ( triggersAndFunctionsLibrariesPage . functionsLink ) ;
@@ -158,7 +154,7 @@ test.after(async() => {
158
154
await t . expect ( uploadedText . length ) . gte ( 1 , 'file was not uploaded' ) ;
159
155
await CommonElementsActions . checkCheckbox ( triggersAndFunctionsLibrariesPage . addConfigurationCheckBox , true ) ;
160
156
await triggersAndFunctionsLibrariesPage . sendTextToMonaco ( MonacoEditorInputs . Configuration , configuration ) ;
161
- await t . click ( await triggersAndFunctionsLibrariesPage . addLibrarySubmitButton ) ;
157
+ await t . click ( triggersAndFunctionsLibrariesPage . addLibrarySubmitButton ) ;
162
158
await t . expect ( triggersAndFunctionsLibrariesPage . getLibraryNameSelector ( libNameFromFile ) . exists ) . ok ( 'the library was not added' ) ;
163
159
await t . expect ( triggersAndFunctionsLibrariesPage . getFunctionsByName ( LibrariesSections . Functions , functionNameFromFile ) . exists ) . ok ( 'the library information was not opened' ) ;
164
160
} ) ;
@@ -169,7 +165,6 @@ test.after(async() => {
169
165
} ) ( 'Verify that user can open a Stream key from function' , async t => {
170
166
const command1 = `#!js api_version=1.0 name=${ libraryName } ` ;
171
167
const command2 = `redis.registerStreamTrigger('${ LIBRARIES_LIST [ 3 ] . name } ', 'name', function(){});` ;
172
-
173
168
const streamKeyParameters : StreamKeyParameters = {
174
169
keyName : streamKeyName ,
175
170
entries : [ {
@@ -180,6 +175,7 @@ test.after(async() => {
180
175
} ]
181
176
} ]
182
177
} ;
178
+
183
179
await apiKeyRequests . addStreamKeyApi ( streamKeyParameters , ossStandaloneRedisGears ) ;
184
180
await t . click ( browserPage . NavigationPanel . triggeredFunctionsButton ) ;
185
181
await t . click ( triggersAndFunctionsFunctionsPage . librariesLink ) ;
0 commit comments