0

enter image description here

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')

}

enter image description here

I want to enter the date to complete E2E testing.

1
  • Please edit your question and convert the images to code fragments in the question. That makes it easier to read your question and cut and paste your code. Also, try to correct the formatting of the code that is in your question. Commented Jan 5, 2023 at 12:11

1 Answer 1

1

The call to the clickexpirydate() method has two parameters, but the method only receives one parameter.

Change it to this

settingpage.clickexpirydate('2023-01-07')
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.