Thanks for the reply. The strong element is nested in the 5th div from the parent that I want to select. This includes the parent div that I want to select. So I did the following and nothing happens, no errors either:
div:has(> div > div > div > div strong:contains("3:15pm"))
Actually, I'm using the following DOM tree. The top most div that contains the <strong> element with the text "3:15pm" is what I want to select and then click the button which it contains. It's the very first div shown below that I want to select. How should I code the selector for this?:
<div data-test-component="StencilReactCard" data-testid="ShiftCard-2022-11-07T20:15:00Z-2022-11-08T00:15:00Z" tabindex="0" role="button" class="css-s7b8pn">
<div data-test-component="StencilReactRow" class="css-93w5zn">
<div data-test-component="StencilReactView" data-test-id="ShiftTimeSiteSkill" class="css-1cl9hwf">
<div data-test-component="StencilReactRow" class="css-7b15qy">
<div data-test-component="StencilText" class="css-5mrmps"><strong>3:15pm-7:15pm</strong> (4hrs)</div>
</div>
<div data-test-component="StencilReactRow" class="css-b9a2q3">
<div data-test-component="StencilText" data-test-id="ShiftTimeSiteSkill-site" class="css-kyen4s">Opportunity Card</div>
</div>
<div data-test-component="StencilReactRow" class="css-b9a2q3">
<div data-test-component="StencilText" data-test-id="ShiftTimeSiteSkill-skill" class="css-kyen4s">Current Listing</div>
</div>
</div>
</div>
<div data-test-component="StencilReactView" data-test-id="ShiftCardScheduledStatus" class="css-1uk1gs8">
<div data-testid="ShiftCardScheduledStatus_Empty" class="css-17jnaqn"></div>
</div>
<div data-test-component="StencilReactRow" class="css-3dmssj">
<div data-test-component="StencilReactView" data-test-id="StopPropagationContainer" class="css-1uk1gs8">
<button data-test-component="StencilPopoverTrigger" aria-expanded="false" aria-describedby="ShiftFlowActionsButton-helperText" data-test-id="ShiftFlowActionsButton" type="button" class="exidgq40 e4s17lp0 css-1ijwbsp">
<div data-test-component="StencilReactRow" class="css-fpj0yv">
Actions
<div class="css-mtbjwo e1fhen290">
<svg display="block" xmlns="http://www.w3.org/2000/svg" class="stencilSvgIcon css-14wvfj0" width="16" height="16" aria-hidden="true" focusable="false" viewBox="0 0 16 16" data-test-component="StencilIconChevronDown" style="width: 16px; height: 16px;">
<path fill-rule="evenodd" fill="currentColor" d="M3,6a1,1,0,0,1,1.7-.7L8,8.6l3.3-3.3a1,1,0,0,1,1.4,1.4l-4,4a1,1,0,0,1-1.4,0l-4-4A1,1,0,0,1,3,6Z"></path>
</svg>
</div>
</div>
</button>
<div class="css-1hpxqns" style="position: absolute; inset: 0px auto auto 0px; margin: 0px; transform: translate(682px, 164px);" data-popper-placement="bottom">
<div style="opacity: 0; transform: translateY(-16px);"></div>
</div>
<span hidden="" id="ShiftFlowActionsButton-helperText">Action Button</span>
</div>
</div>
</div>