From ad6a08b87dc16d71240da9d59183782896b88f4d Mon Sep 17 00:00:00 2001 From: Mike Decker Date: Mon, 10 Jun 2024 15:13:02 -0700 Subject: [PATCH] Update events minicalendar functional test --- .../functional/Content/EventsCest.php | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/tests/codeception/functional/Content/EventsCest.php b/tests/codeception/functional/Content/EventsCest.php index bd056ca09..134cc9f19 100644 --- a/tests/codeception/functional/Content/EventsCest.php +++ b/tests/codeception/functional/Content/EventsCest.php @@ -66,7 +66,7 @@ public function testMiniCalendar(FunctionalTester $I) { ]); $I->amOnPage($node->toUrl()->toString()); $I->canSee('Mini Calendar', 'h2'); - $I->canSee(date('F Y'), '.react-calendar'); + $I->canSee(date('F Y'), '.mini-calendar'); foreach ($events as $event) { $start_timestamp = $event->get('su_event_date_time') @@ -74,17 +74,15 @@ public function testMiniCalendar(FunctionalTester $I) { ->get('value') ->getString(); - $start_day = date('j', $start_timestamp); + $button_label = date('M jS Y', $start_timestamp); - // The button element is disabled until the calendar is loaded. - $I->waitForElementChange('//abbr[contains(text(), "' . $start_day . '")]/..', function(WebDriverElement $element) { - return is_null($element->getAttribute('disabled')); - }); - $I->click($start_day); + $I->waitForElementClickable("button[aria-label='$button_label']"); + $I->wait(1); + $I->click("[aria-label='$button_label']"); $I->waitForText($event->label(), 5); - $I->canSee($event->label(), '.popover-list'); - $I->click('Close', '.MuiPaper-root'); - $I->click('Next Month'); + $I->canSee($event->label(), 'dialog'); + $I->click('Close Dialog'); + $I->click('Next Month');; } }