kevinoleary19 / Angular-2-Datepicker

A minimalist datepicker inspired by Google's material design
70 stars 71 forks source link

Is this possible to test with protractor? #75

Open ericfrancis opened 7 years ago

ericfrancis commented 7 years ago

Was able to test with

// protractor spec
    // click date
    dateElement.click();

    // get the navigation arrows
    const datePickerArrows = dateElement.$$( '.datepicker__calendar__nav__arrow' );
    // click right arrow
    const datePickerRightArrow = datePickerArrows.get( 1 );
    datePickerRightArrow.click();

    // get the days
    // only actual dates have span elements
    const datePickerDays = dateElement.$$( '.datepicker__calendar__month__day > span' );
    return datePickerDays.count().then( count => {
      return datePickerDays.get( count - daysFromEndOfMonth ).click();
    });