@@ -10,20 +10,41 @@ export function UptimeSettingsProvider({ getService }: FtrProviderContext) {
1010 const testSubjects = getService ( 'testSubjects' ) ;
1111 const retry = getService ( 'retry' ) ;
1212
13+ const changeInputField = async ( text : string , field : string ) => {
14+ const input = await testSubjects . find ( field , 5000 ) ;
15+ await input . clearValueWithKeyboard ( ) ;
16+ await input . type ( text ) ;
17+ } ;
18+
1319 return {
1420 go : async ( ) => {
1521 await testSubjects . click ( 'settings-page-link' , 5000 ) ;
1622 } ,
23+
1724 changeHeartbeatIndicesInput : async ( text : string ) => {
18- const input = await testSubjects . find ( 'heartbeat-indices-input-loaded' , 5000 ) ;
19- await input . clearValueWithKeyboard ( ) ;
20- await input . type ( text ) ;
25+ await changeInputField ( text , 'heartbeat-indices-input-loaded' ) ;
26+ } ,
27+ changeErrorThresholdInput : async ( text : string ) => {
28+ await changeInputField ( text , 'error-state-threshold-input-loaded' ) ;
29+ } ,
30+ changeWarningThresholdInput : async ( text : string ) => {
31+ await changeInputField ( text , 'warning-state-threshold-input-loaded' ) ;
2132 } ,
2233 loadFields : async ( ) => {
23- const input = await testSubjects . find ( 'heartbeat-indices-input-loaded' , 5000 ) ;
24- const heartbeatIndices = await input . getAttribute ( 'value' ) ;
34+ const indInput = await testSubjects . find ( 'heartbeat-indices-input-loaded' , 5000 ) ;
35+ const errorInput = await testSubjects . find ( 'error-state-threshold-input-loaded' , 5000 ) ;
36+ const warningInput = await testSubjects . find ( 'warning-state-threshold-input-loaded' , 5000 ) ;
37+ const heartbeatIndices = await indInput . getAttribute ( 'value' ) ;
38+ const errorThreshold = await errorInput . getAttribute ( 'value' ) ;
39+ const warningThreshold = await warningInput . getAttribute ( 'value' ) ;
2540
26- return { heartbeatIndices } ;
41+ return {
42+ heartbeatIndices,
43+ certificatesThresholds : {
44+ errorState : errorThreshold ,
45+ warningState : warningThreshold ,
46+ } ,
47+ } ;
2748 } ,
2849 applyButtonIsDisabled : async ( ) => {
2950 return ! ! ( await ( await testSubjects . find ( 'apply-settings-button' ) ) . getAttribute ( 'disabled' ) ) ;
0 commit comments