@@ -144,40 +144,23 @@ test.describe('Basic Condition Set Use', () => {
144144 const conditionCollection = page . locator ( '#conditionCollection' ) ;
145145 await sineWaveGeneratorTreeItem . dragTo ( conditionCollection ) ;
146146
147- // Modify First Criterion
148- const firstCriterionTelemetry = page . locator (
149- '[aria-label="Criterion Telemetry Selection"] >> nth=0'
150- ) ;
151- firstCriterionTelemetry . selectOption ( { label : exampleTelemetry . name } ) ;
152- const firstCriterionMetadata = page . locator (
153- '[aria-label="Criterion Metadata Selection"] >> nth=0'
154- ) ;
155- firstCriterionMetadata . selectOption ( { label : 'Sine' } ) ;
156- const firstCriterionComparison = page . locator (
157- '[aria-label="Criterion Comparison Selection"] >> nth=0'
158- ) ;
159- firstCriterionComparison . selectOption ( { label : 'is greater than or equal to' } ) ;
160- const firstCriterionInput = page . locator ( '[aria-label="Criterion Input"] >> nth=0' ) ;
161- await firstCriterionInput . fill ( '0' ) ;
162-
163- // Modify First Criterion
164- const secondCriterionTelemetry = page . locator (
165- '[aria-label="Criterion Telemetry Selection"] >> nth=1'
166- ) ;
167- secondCriterionTelemetry . selectOption ( { label : exampleTelemetry . name } ) ;
168-
169- const secondCriterionMetadata = page . locator (
170- '[aria-label="Criterion Metadata Selection"] >> nth=1'
171- ) ;
172- secondCriterionMetadata . selectOption ( { label : 'Sine' } ) ;
173-
174- const secondCriterionComparison = page . locator (
175- '[aria-label="Criterion Comparison Selection"] >> nth=1'
176- ) ;
177- secondCriterionComparison . selectOption ( { label : 'is less than' } ) ;
178-
179- const secondCriterionInput = page . locator ( '[aria-label="Criterion Input"] >> nth=1' ) ;
180- await secondCriterionInput . fill ( '0' ) ;
147+ // Modify First Criterion - use value selectors (labels show path e.g. "My Items/Name")
148+ await page . getByLabel ( 'Criterion Telemetry Selection' ) . first ( ) . selectOption ( { value : 'all' } ) ;
149+ await page . getByLabel ( 'Criterion Metadata Selection' ) . first ( ) . selectOption ( { value : 'sin' } ) ;
150+ await page
151+ . locator ( 'select[aria-label="Criterion Comparison Selection"]' )
152+ . first ( )
153+ . selectOption ( { value : 'greaterThanOrEq' } ) ;
154+ await page . getByLabel ( 'Criterion Input' ) . first ( ) . fill ( '0' ) ;
155+
156+ // Modify Second Criterion
157+ await page . getByLabel ( 'Criterion Telemetry Selection' ) . nth ( 1 ) . selectOption ( { value : 'all' } ) ;
158+ await page . getByLabel ( 'Criterion Metadata Selection' ) . nth ( 1 ) . selectOption ( { value : 'sin' } ) ;
159+ await page
160+ . locator ( 'select[aria-label="Criterion Comparison Selection"]' )
161+ . nth ( 1 )
162+ . selectOption ( { value : 'lessThan' } ) ;
163+ await page . getByLabel ( 'Criterion Input' ) . nth ( 1 ) . fill ( '0' ) ;
181164
182165 // Save ConditionSet
183166 await page . locator ( 'button[title="Save"]' ) . click ( ) ;
@@ -228,51 +211,29 @@ test.describe('Basic Condition Set Use', () => {
228211 const conditionCollection = page . locator ( '#conditionCollection' ) ;
229212 await sineWaveGeneratorTreeItem . dragTo ( conditionCollection ) ;
230213
231- // Modify First Criterion
232- const firstCriterionTelemetry = page . locator (
233- '[aria-label="Criterion Telemetry Selection"] >> nth=0'
234- ) ;
235- firstCriterionTelemetry . selectOption ( { label : exampleTelemetry . name } ) ;
236- const firstCriterionMetadata = page . locator (
237- '[aria-label="Criterion Metadata Selection"] >> nth=0'
238- ) ;
239- firstCriterionMetadata . selectOption ( { label : 'Sine' } ) ;
240- const firstCriterionComparison = page . locator (
241- '[aria-label="Criterion Comparison Selection"] >> nth=0'
242- ) ;
243- firstCriterionComparison . selectOption ( { label : 'is greater than or equal to' } ) ;
244- const firstCriterionInput = page . locator ( '[aria-label="Criterion Input"] >> nth=0' ) ;
245- await firstCriterionInput . fill ( '0' ) ;
214+ // Modify First Criterion - use value selectors (labels show path e.g. "My Items/Name")
215+ await page . getByLabel ( 'Criterion Telemetry Selection' ) . first ( ) . selectOption ( { value : 'all' } ) ;
216+ await page . getByLabel ( 'Criterion Metadata Selection' ) . first ( ) . selectOption ( { value : 'sin' } ) ;
217+ await page
218+ . locator ( 'select[aria-label="Criterion Comparison Selection"]' )
219+ . first ( )
220+ . selectOption ( { value : 'greaterThanOrEq' } ) ;
221+ await page . getByLabel ( 'Criterion Input' ) . first ( ) . fill ( '0' ) ;
246222
247223 // Modify Second Criterion
248- const secondCriterionTelemetry = page . locator (
249- '[aria-label="Criterion Telemetry Selection"] >> nth=1'
250- ) ;
251- await secondCriterionTelemetry . selectOption ( { label : exampleTelemetry . name } ) ;
252-
253- const secondCriterionMetadata = page . locator (
254- '[aria-label="Criterion Metadata Selection"] >> nth=1'
255- ) ;
256- await secondCriterionMetadata . selectOption ( { label : 'Sine' } ) ;
257-
258- const secondCriterionComparison = page . locator (
259- '[aria-label="Criterion Comparison Selection"] >> nth=1'
260- ) ;
261- await secondCriterionComparison . selectOption ( { label : 'is less than' } ) ;
262-
263- const secondCriterionInput = page . locator ( '[aria-label="Criterion Input"] >> nth=1' ) ;
264- await secondCriterionInput . fill ( '0' ) ;
224+ await page . getByLabel ( 'Criterion Telemetry Selection' ) . nth ( 1 ) . selectOption ( { value : 'all' } ) ;
225+ await page . getByLabel ( 'Criterion Metadata Selection' ) . nth ( 1 ) . selectOption ( { value : 'sin' } ) ;
226+ await page
227+ . locator ( 'select[aria-label="Criterion Comparison Selection"]' )
228+ . nth ( 1 )
229+ . selectOption ( { value : 'lessThan' } ) ;
230+ await page . getByLabel ( 'Criterion Input' ) . nth ( 1 ) . fill ( '0' ) ;
265231
266- // Enable test data
232+ // Enable test data - use index for telemetry (no "all" option), value for metadata
267233 await page . getByLabel ( 'Apply Test Data' ) . nth ( 1 ) . click ( ) ;
268- const testDataTelemetry = page . locator ( '[aria-label="Test Data Telemetry Selection"] >> nth=0' ) ;
269- await testDataTelemetry . selectOption ( { label : exampleTelemetry . name } ) ;
270-
271- const testDataMetadata = page . locator ( '[aria-label="Test Data Metadata Selection"] >> nth=0' ) ;
272- await testDataMetadata . selectOption ( { label : 'Sine' } ) ;
273-
274- const testInput = page . locator ( '[aria-label="Test Data Input"] >> nth=0' ) ;
275- await testInput . fill ( '0' ) ;
234+ await page . getByLabel ( 'Test Data Telemetry Selection' ) . first ( ) . selectOption ( { index : 1 } ) ;
235+ await page . getByLabel ( 'Test Data Metadata Selection' ) . first ( ) . selectOption ( { value : 'sin' } ) ;
236+ await page . getByLabel ( 'Test Data Input' ) . first ( ) . fill ( '0' ) ;
276237
277238 // Validate that the condition set is evaluating and outputting
278239 // the correct value when the underlying telemetry subscription is active.
@@ -302,24 +263,24 @@ test.describe('Basic Condition Set Use', () => {
302263 await page . getByLabel ( 'Edit Object' ) . click ( ) ;
303264 await page . getByLabel ( 'Add Condition' ) . click ( ) ;
304265 await page . getByLabel ( 'Condition Name Input' ) . first ( ) . fill ( 'P1 IS ON AND P2 IS ON' ) ;
305- await page . getByLabel ( 'Criterion Telemetry Selection' ) . selectOption ( { label : 'P1' } ) ;
266+ await page . getByLabel ( 'Criterion Telemetry Selection' ) . first ( ) . selectOption ( { index : 1 } ) ;
306267 await page . getByLabel ( 'Criterion Metadata Selection' ) . selectOption ( 'value' ) ;
307268 await page . getByLabel ( 'Criterion Comparison Selection' ) . selectOption ( 'equalTo' ) ;
308269 await page . getByLabel ( 'Criterion Input' ) . fill ( '1' ) ;
309270 await page . getByLabel ( 'Add Criteria - Enabled' ) . click ( ) ;
310- await page . getByLabel ( 'Criterion Telemetry Selection' ) . nth ( 1 ) . selectOption ( { label : 'P2' } ) ;
271+ await page . getByLabel ( 'Criterion Telemetry Selection' ) . nth ( 1 ) . selectOption ( { index : 2 } ) ;
311272 await page . getByLabel ( 'Criterion Metadata Selection' ) . nth ( 1 ) . selectOption ( 'value' ) ;
312273 await page . getByLabel ( 'Criterion Comparison Selection' ) . nth ( 1 ) . selectOption ( 'equalTo' ) ;
313274 await page . getByLabel ( 'Criterion Input' ) . nth ( 1 ) . fill ( '1' ) ;
314275 await page . getByLabel ( 'Add Condition' ) . click ( ) ;
315276 await page . getByLabel ( 'Condition Name Input' ) . first ( ) . fill ( 'P1 IS OFF OR P2 IS OFF' ) ;
316277 await page . getByLabel ( 'Condition Trigger' ) . first ( ) . selectOption ( 'any' ) ;
317- await page . getByLabel ( 'Criterion Telemetry Selection' ) . first ( ) . selectOption ( { label : 'P1' } ) ;
278+ await page . getByLabel ( 'Criterion Telemetry Selection' ) . first ( ) . selectOption ( { index : 1 } ) ;
318279 await page . getByLabel ( 'Criterion Metadata Selection' ) . first ( ) . selectOption ( 'value' ) ;
319280 await page . getByLabel ( 'Criterion Comparison Selection' ) . first ( ) . selectOption ( 'equalTo' ) ;
320281 await page . getByLabel ( 'Criterion Input' ) . first ( ) . fill ( '0' ) ;
321282 await page . getByLabel ( 'Add Criteria - Enabled' ) . first ( ) . click ( ) ;
322- await page . getByLabel ( 'Criterion Telemetry Selection' ) . nth ( 1 ) . selectOption ( { label : 'P2' } ) ;
283+ await page . getByLabel ( 'Criterion Telemetry Selection' ) . nth ( 1 ) . selectOption ( { index : 2 } ) ;
323284 await page . getByLabel ( 'Criterion Metadata Selection' ) . nth ( 1 ) . selectOption ( 'value' ) ;
324285 await page . getByLabel ( 'Criterion Comparison Selection' ) . nth ( 1 ) . selectOption ( 'equalTo' ) ;
325286 await page . getByLabel ( 'Criterion Input' ) . nth ( 1 ) . fill ( '0' ) ;
@@ -332,12 +293,12 @@ test.describe('Basic Condition Set Use', () => {
332293 * Create default conditions for test. Start with invalid values to put condition set into
333294 * "default" state
334295 */
335- await page . getByLabel ( 'Test Data Telemetry Selection' ) . selectOption ( { label : 'P1' } ) ;
336- await page . getByLabel ( 'Test Data Metadata Selection' ) . selectOption ( { label : 'Value ' } ) ;
337- await page . getByLabel ( 'Test Data Input' ) . fill ( '3' ) ;
296+ await page . getByLabel ( 'Test Data Telemetry Selection' ) . first ( ) . selectOption ( { index : 1 } ) ;
297+ await page . getByLabel ( 'Test Data Metadata Selection' ) . first ( ) . selectOption ( { value : 'value ' } ) ;
298+ await page . getByLabel ( 'Test Data Input' ) . first ( ) . fill ( '3' ) ;
338299 await page . getByLabel ( 'Add Test Datum' ) . click ( ) ;
339- await page . getByLabel ( 'Test Data Telemetry Selection' ) . nth ( 1 ) . selectOption ( { label : 'P2' } ) ;
340- await page . getByLabel ( 'Test Data Metadata Selection' ) . nth ( 1 ) . selectOption ( { label : 'Value ' } ) ;
300+ await page . getByLabel ( 'Test Data Telemetry Selection' ) . nth ( 1 ) . selectOption ( { index : 2 } ) ;
301+ await page . getByLabel ( 'Test Data Metadata Selection' ) . nth ( 1 ) . selectOption ( { value : 'value ' } ) ;
341302 await page . getByLabel ( 'Test Data Input' ) . nth ( 1 ) . fill ( '3' ) ;
342303 await page . getByLabel ( 'Apply Test Data' ) . nth ( 1 ) . click ( ) ;
343304
0 commit comments