1

I'm using the Fullcalendar Resource-timeline feature. enter image description here

I want to create automatic tests that click on dates in order to create events. The problem here, is that the cells are not dom elements. The solution I came up so far is to calculate the coordinates for the cursor to click, but it's not working.

    WebDriver driver = getDriver();
    Actions actions = new Actions(driver);

    // Get absence calendar
    WebElement absenceCalendar = getAbsenceCalendar(driver);

    // Get X coordinate for the first monday of the month. Add 5px in order to close in to the center
    int xCoordinates = getFirstDayFromAnyCalendar(absenceCalendar,"L").getLocation().getX()+5;

    logger.info("X: "+xCoordinates);
    // Get Y coordinate from jeune

    int yCoordinates = getJeuneLineFromCalendar(absenceCalendar,jeune).getLocation().getY();
    logger.info("Y: "+yCoordinates);

     //Move the cursor to the top left corner of the screen
    actions.moveToElement(driver.findElement(By.tagName("body")), 0, 0);

    //Move the cursor to the coordinates and click.
    actions.moveByOffset(xCoordinates, yCoordinates).click().perform();

The coordinates checks out, but the click does not work. Any idea ?

jmc
  • 312
  • 1
  • 11
  • 1
    even fullcalendar themselves don't seem to have an automated test for this - see https://github.com/fullcalendar/fullcalendar/tree/master/packages/__tests__ . So I'd guess it's probably impossible. Maybe you should ask them how they test it currently. (And not sure you really need to their their core functionality all over again, do you?) – ADyson Aug 11 '20 at 12:47
  • Thank you.Given the paid licence, we have an email support from them. I'll contact them and I'll let you know – jmc Aug 12 '20 at 07:05

0 Answers0