@@ -73,8 +73,8 @@ describe.skip('Job Templates Tests', function () {
73
73
cy . clickLink ( / ^ C r e a t e j o b t e m p l a t e $ / ) ;
74
74
cy . getBy ( '[data-cy="name"]' ) . type ( jtName ) ;
75
75
cy . getBy ( '[data-cy="description"]' ) . type ( 'This is a JT description' ) ;
76
- cy . selectDropdownOptionByResourceName ( 'inventory' , inventory . name ) ;
77
- cy . selectDropdownOptionByResourceName ( 'project' , `${ project . name } ` ) ;
76
+ cy . singleSelectByDataCy ( 'inventory' , inventory . name ) ;
77
+ cy . singleSelectByDataCy ( 'project' , `${ ( this . globalProject as Project ) . name } ` ) ;
78
78
cy . selectDropdownOptionByResourceName ( 'playbook' , 'hello_world.yml' ) ;
79
79
cy . getBy ( '[data-cy="Submit"]' ) . click ( ) ;
80
80
cy . wait ( '@createJT' )
@@ -110,6 +110,33 @@ describe.skip('Job Templates Tests', function () {
110
110
} ) ;
111
111
} ) ;
112
112
113
+ it ( 'can create a job template that inherits the execution environment from the project' , function ( ) {
114
+ cy . createAwxExecutionEnvironment ( {
115
+ organization : awxOrganization . id ,
116
+ } ) . then ( ( ee : ExecutionEnvironment ) => {
117
+ executionEnvironment = ee ;
118
+ cy . createAwxProject ( awxOrganization , {
119
+ default_environment : ee . id ,
120
+ } ) . then ( ( proj : Project ) => {
121
+ project = proj ;
122
+ cy . intercept ( 'POST' , awxAPI `/job_templates` ) . as ( 'createJT' ) ;
123
+ const jtName = 'E2E-JT ' + randomString ( 4 ) ;
124
+ cy . navigateTo ( 'awx' , 'templates' ) ;
125
+ cy . getBy ( '[data-cy="create-template"]' ) . click ( ) ;
126
+ cy . clickLink ( / ^ C r e a t e j o b t e m p l a t e $ / ) ;
127
+ cy . getBy ( '[data-cy="name"]' ) . type ( jtName ) ;
128
+ cy . getBy ( '[data-cy="description"]' ) . type ( 'This is a JT description' ) ;
129
+ cy . singleSelectByDataCy ( 'inventory' , inventory . name ) ;
130
+ cy . singleSelectByDataCy ( 'project' , proj . name ) ;
131
+ cy . selectDropdownOptionByResourceName ( 'playbook' , 'hello_world.yml' ) ;
132
+ cy . getBy ( '[data-cy="Submit"]' ) . click ( ) ;
133
+ cy . wait ( '@createJT' ) ;
134
+ cy . getByDataCy ( 'execution-environment' ) . contains ( ee . name ) ;
135
+ cy . getByDataCy ( 'project' ) . contains ( proj . name ) ;
136
+ } ) ;
137
+ } ) ;
138
+ } ) ;
139
+
113
140
it ( 'can create a job template using the prompt on launch wizard' , function ( ) {
114
141
cy . intercept ( 'POST' , awxAPI `/job_templates` ) . as ( 'createPOLJT' ) ;
115
142
const jtName = 'E2E-POLJT ' + randomString ( 4 ) ;
@@ -119,7 +146,7 @@ describe.skip('Job Templates Tests', function () {
119
146
cy . getBy ( '[data-cy="name"]' ) . type ( jtName ) ;
120
147
cy . getBy ( '[data-cy="description"]' ) . type ( 'This is a JT with POL wizard description' ) ;
121
148
cy . selectPromptOnLaunch ( 'inventory' ) ;
122
- cy . selectDropdownOptionByResourceName ( 'project' , `${ project . name } ` ) ;
149
+ cy . singleSelectByDataCy ( 'project' , `${ project . name } ` ) ;
123
150
cy . selectDropdownOptionByResourceName ( 'playbook' , 'hello_world.yml' ) ;
124
151
cy . selectPromptOnLaunch ( 'execution_environment' ) ;
125
152
cy . selectPromptOnLaunch ( 'credential' ) ;
@@ -133,7 +160,7 @@ describe.skip('Job Templates Tests', function () {
133
160
cy . filterTableByMultiSelect ( 'name' , [ jtName ] ) ;
134
161
cy . getTableRow ( 'name' , jtName , { disableFilter : true } ) . should ( 'be.visible' ) ;
135
162
cy . clickTableRowAction ( 'name' , jtName , 'launch-template' , { disableFilter : true } ) ;
136
- cy . selectDropdownOptionByResourceName ( 'inventory' , inventory . name ) ;
163
+ cy . singleSelectByDataCy ( 'inventory' , inventory . name ) ;
137
164
cy . clickButton ( / ^ N e x t / ) ;
138
165
cy . multiSelectByDataCy ( 'credential' , [ machineCredential . name ] ) ;
139
166
cy . clickButton ( / ^ N e x t / ) ;
@@ -185,7 +212,7 @@ describe.skip('Job Templates Tests', function () {
185
212
cy . getBy ( '[data-cy="name"]' ) . type ( jtName ) ;
186
213
cy . getBy ( '[data-cy="description"]' ) . type ( 'This is a JT with POL wizard description' ) ;
187
214
cy . selectPromptOnLaunch ( 'inventory' ) ;
188
- cy . selectDropdownOptionByResourceName ( 'project' , `${ project . name } ` ) ;
215
+ cy . singleSelectByDataCy ( 'project' , `${ project . name } ` ) ;
189
216
cy . selectDropdownOptionByResourceName ( 'playbook' , 'hello_world.yml' ) ;
190
217
cy . selectPromptOnLaunch ( 'execution_environment' ) ;
191
218
cy . selectPromptOnLaunch ( 'credential' ) ;
@@ -196,7 +223,7 @@ describe.skip('Job Templates Tests', function () {
196
223
. then ( ( id : string ) => {
197
224
cy . verifyPageTitle ( jtName ) ;
198
225
cy . clickButton ( / ^ L a u n c h t e m p l a t e $ / ) ;
199
- cy . selectDropdownOptionByResourceName ( 'inventory' , inventory . name ) ;
226
+ cy . singleSelectByDataCy ( 'inventory' , inventory . name ) ;
200
227
cy . clickButton ( / ^ N e x t / ) ;
201
228
cy . selectItemFromLookupModal ( 'credential-select' , machineCredential . name ) ;
202
229
cy . clickButton ( / ^ N e x t / ) ;
@@ -252,8 +279,8 @@ describe.skip('Job Templates Tests', function () {
252
279
cy . getBy ( '[data-cy="create-template"]' ) . click ( ) ;
253
280
cy . clickLink ( / ^ C r e a t e j o b t e m p l a t e $ / ) ;
254
281
cy . getByDataCy ( 'name' ) . type ( jtName ) ;
255
- cy . selectDropdownOptionByResourceName ( 'inventory' , inventory . name ) ;
256
- cy . selectDropdownOptionByResourceName ( 'project' , gitProject . name ) ;
282
+ cy . singleSelectByDataCy ( 'inventory' , inventory . name ) ;
283
+ cy . singleSelectByDataCy ( 'project' , gitProject . name ) ;
257
284
cy . selectDropdownOptionByResourceName ( 'playbook' , 'debug-loop.yml' ) ;
258
285
cy . getByDataCy ( 'allow_simultaneous' ) . click ( ) ;
259
286
cy . clickButton ( 'Create job template' ) ;
@@ -373,7 +400,7 @@ describe.skip('Job Templates Tests', function () {
373
400
cy . verifyPageTitle ( jobTemplate . name ) ;
374
401
cy . getByDataCy ( 'inventory' ) . contains ( 'Deleted' ) ;
375
402
cy . clickLink ( 'Edit template' ) ;
376
- cy . selectDropdownOptionByResourceName ( 'inventory' , inv . name ) ;
403
+ cy . singleSelectByDataCy ( 'inventory' , inv . name ) ;
377
404
cy . intercept ( 'PATCH' , awxAPI `/job_templates/${ jobTemplate . id . toString ( ) } /` ) . as ( 'saveJT' ) ;
378
405
cy . clickButton ( 'Save job template' ) ;
379
406
cy . wait ( '@saveJT' ) ;
0 commit comments