I'm trying to select the date using a cypress test to no avail. I've tried using the xpath and also the input field but it's not working.
Here's the HTML:
<ion-card>
<div>
<ion-item class="item-content">
<ion-label style="color: black;" position="stacked">Start Date</ion-label>
<input required formControlName="startDate" type="Date" />
<div>
<ion-note slot="error" *ngIf="(startDate.touched && startDate.errors)">Start date is required and must be
before end date.
</ion-note>
</div>
</ion-item>
</div>
<div>
<ion-item class="item-content">
<ion-label style="color: black;" position="stacked">End Date</ion-label>
<input required formControlName="endDate" type="Date" />
<div>
<ion-note slot="error" *ngIf="(endDate.touched && endDate.errors)">End date is required.
</ion-note>
</div>
</ion-item>
</div>
</ion-card>
When I inspect the element:
Cypress test: cy.get('body > app-root > ion-app > ion-router-outlet > app-add-itinerary > ion-content > form > ion-card:nth-child(3) > div:nth-child(1) > ion-item > input').click()
I've also tried cy.get(input).click() but that doesn't work either.
I'm using "cypress": "^10.3.0",
Any help would be appeciated.
