
I am doing some E2E test using cypress and I want to get the date that appears on a DatePicker element from my app. I tried this but both return an empty string:
export class SettingPage {
doc_expirydate='#txtDocExpiryDate'
clickexpirydate (date) {
cy.get(this.doc_expirydate).type(date)
}
}
import { SettingPage } from "./Pages/setting_page"`
const settingpage = new SettingPage()
it('Setting_Page', function () {
settingpage.clickexpirydate('type=date','2023-01-07')
}

I want to enter the date to complete E2E testing.