From f7808db7960a79dc8c25385806372c29943fada7 Mon Sep 17 00:00:00 2001 From: Mike Decker Date: Fri, 20 Oct 2023 12:29:11 -0700 Subject: [PATCH] add selector --- .../acceptance/Content/EventsCest.php | 2 +- .../acceptance/Content/SearchBlockCest.php | 4 +-- .../GlobalMessage/GlobalMessageCest.php | 4 +++ .../LocalFooter/LocalFooterCest.php | 12 ++++++-- .../LocalFooter/LocalFooterLockupCest.php | 28 +++++++++++++++++++ .../LockupSettings/LockupSettingsCest.php | 28 +++++++++++++++++++ .../SuperFooter/SuperFooterCest.php | 2 ++ .../acceptance/SystemSiteConfigCest.php | 12 ++++---- .../functional/Contrib/ExtLinkCest.php | 3 +- .../Navigation/NavigationDropDownsCest.php | 5 ++-- 10 files changed, 86 insertions(+), 14 deletions(-) diff --git a/tests/codeception/acceptance/Content/EventsCest.php b/tests/codeception/acceptance/Content/EventsCest.php index 805e6d843..40e2744e6 100644 --- a/tests/codeception/acceptance/Content/EventsCest.php +++ b/tests/codeception/acceptance/Content/EventsCest.php @@ -82,7 +82,7 @@ public function testListIntro(AcceptanceTester $I) { $I->amOnPage('/admin/config/importers/events-importer'); $I->fillField('No Results Message', $message); $I->click('Save'); - $I->canSee('Events Importer has been'); + $I->canSee('Events Importer hs been', '.messages-list'); $I->amOnPage($event->toUrl('delete-form')->toString()); $I->click('Delete'); diff --git a/tests/codeception/acceptance/Content/SearchBlockCest.php b/tests/codeception/acceptance/Content/SearchBlockCest.php index 76c4f8fb6..d9dc499b2 100644 --- a/tests/codeception/acceptance/Content/SearchBlockCest.php +++ b/tests/codeception/acceptance/Content/SearchBlockCest.php @@ -37,14 +37,14 @@ public function testHideSearchBlock(AcceptanceTester $I) { $I->selectOption('Organization', $org_term->id()); $I->click('Save'); // The settings might have been created or updated. - $I->see('Site Settings has been'); + $I->see('Site Settings hs been', '.messages-list'); $I->amOnPage('/'); $I->dontSeeElement('.su-site-search__input'); $I->amOnPage('/admin/config/system/basic-site-settings'); $I->uncheckOption('Hide Site Search'); $I->click('Save'); - $I->canSee('Site Settings has been'); + $I->canSee('Site Settings hs been', '.messages-list'); $I->amOnPage('/'); $I->seeElement('.su-site-search__input'); } diff --git a/tests/codeception/acceptance/GlobalMessage/GlobalMessageCest.php b/tests/codeception/acceptance/GlobalMessage/GlobalMessageCest.php index 23364c47c..4e8a95062 100644 --- a/tests/codeception/acceptance/GlobalMessage/GlobalMessageCest.php +++ b/tests/codeception/acceptance/GlobalMessage/GlobalMessageCest.php @@ -49,6 +49,8 @@ public function testFormSettings(AcceptanceTester $I) { $I->fillField('URL', ''); $I->fillField('Link text', 'Action link'); $I->click('Save'); + $I->see('Global Message hs been', '.messages-list'); + $I->amOnPage("/"); $I->seeElement(".su-alert--success"); $I->canSee("MESSAGE LABEL"); @@ -58,6 +60,8 @@ public function testFormSettings(AcceptanceTester $I) { $I->amOnPage('/admin/config/system/global-message'); $I->selectOption("#edit-su-global-msg-type", "error"); $I->click('Save'); + $I->see('Global Message hs been', '.messages-list'); + $I->amOnPage("/"); $I->seeElement(".su-alert--error"); } diff --git a/tests/codeception/acceptance/LocalFooter/LocalFooterCest.php b/tests/codeception/acceptance/LocalFooter/LocalFooterCest.php index d18904693..8bde9cfaf 100644 --- a/tests/codeception/acceptance/LocalFooter/LocalFooterCest.php +++ b/tests/codeception/acceptance/LocalFooter/LocalFooterCest.php @@ -41,6 +41,8 @@ public function testCustomLocalFooter(AcceptanceTester $I) { $I->checkOption('Enabled'); $I->selectOption('Country', 'United States'); $I->click('Save'); + $I->see('Local Footer has been', '.messages-list'); + $I->selectOption('State', 'New York'); $fields = [ 'Company' => 'Drupal', @@ -67,6 +69,7 @@ public function testCustomLocalFooter(AcceptanceTester $I) { } $I->click('Save'); + $I->see('Local Footer has been', '.messages-list'); $I->amOnPage('/'); $I->canSee('123 Drupal Dr'); @@ -83,6 +86,7 @@ public function testCustomLocalFooter(AcceptanceTester $I) { $I->amOnPage('/admin/config/system/local-footer'); $I->uncheckOption('Enabled'); $I->click('Save'); + $I->see('Local Footer has been', '.messages-list'); $I->amOnPage('/'); $I->cantSee('123 Drupal Dr'); @@ -99,6 +103,8 @@ public function testCustomContentLocalFooter(AcceptanceTester $I) { $I->fillField("#edit-su-local-foot-se-co-0-value", "

Block two

"); $I->fillField("#edit-su-local-foot-tr-co-0-value", "

Block three

"); $I->click('Save'); + $I->see('Local Footer has been', '.messages-list'); + $I->amOnPage('/'); $I->canSee('Block one'); $I->canSee('Block two'); @@ -119,7 +125,8 @@ public function testNodeRoutesAndNoLink(AcceptanceTester $I) { $I->fillField('su_local_foot_primary[0][uri]', $node->label() . " ({$node->id()})"); $I->fillField('su_local_foot_primary[0][title]', $node->label()); $I->click('Save'); - $I->canSee('Local Footer has been'); + $I->see('Local Footer has been', '.messages-list'); + $I->amOnPage('/'); $I->canSeeLink($node->label(), $node->toUrl()->toString()); @@ -129,7 +136,8 @@ public function testNodeRoutesAndNoLink(AcceptanceTester $I) { $I->fillField('su_local_foot_primary[0][uri]', ''); $I->fillField('su_local_foot_primary[0][title]', 'NO LINK'); $I->click('Save'); - $I->canSee('Local Footer has been'); + $I->see('Local Footer has been', '.messages-list'); + $I->amOnPage('/'); $I->canSee('NO LINK', 'li span'); } diff --git a/tests/codeception/acceptance/LocalFooter/LocalFooterLockupCest.php b/tests/codeception/acceptance/LocalFooter/LocalFooterLockupCest.php index 20a8bae00..f020b2262 100644 --- a/tests/codeception/acceptance/LocalFooter/LocalFooterLockupCest.php +++ b/tests/codeception/acceptance/LocalFooter/LocalFooterLockupCest.php @@ -52,6 +52,8 @@ public function testLockupSettingsA(AcceptanceTester $I) { $I->fillField('Line 4', 'Organization name'); $I->fillField('Line 5', 'Last line full width option'); $I->click('Save'); + $I->see('Local Footer has been', '.messages-list'); + $I->amOnPage('/'); $I->canSee("Site title line"); $I->canSee("Last line full width option"); @@ -73,6 +75,8 @@ public function testLockupSettingsB(AcceptanceTester $I) { $I->fillField('Line 4', 'Organization name'); $I->fillField('Line 5', 'Last line full width option'); $I->click('Save'); + $I->see('Local Footer has been', '.messages-list'); + $I->amOnPage('/'); $I->canSee("Site title line"); $I->canSee("Secondary title line"); @@ -94,6 +98,8 @@ public function testLockupSettingsD(AcceptanceTester $I) { $I->fillField('Line 4', 'Organization name'); $I->fillField('Line 5', 'Last line full width option'); $I->click('Save'); + $I->see('Local Footer has been', '.messages-list'); + $I->amOnPage('/'); $I->canSee("Site title line"); $I->canSee("Tertiary title line"); @@ -115,6 +121,8 @@ public function testLockupSettingsE(AcceptanceTester $I) { $I->fillField('Line 4', 'Organization name'); $I->fillField('Line 5', 'Last line full width option'); $I->click('Save'); + $I->see('Local Footer has been', '.messages-list'); + $I->amOnPage('/'); $I->canSee("Site title line"); $I->canSee("Secondary title line"); @@ -137,6 +145,8 @@ public function testLockupSettingsH(AcceptanceTester $I) { $I->fillField('Line 4', 'Organization name'); $I->fillField('Line 5', 'Last line full width option'); $I->click('Save'); + $I->see('Local Footer has been', '.messages-list'); + $I->amOnPage('/'); $I->canSee("Site title line"); $I->canSee("Organization name"); @@ -159,6 +169,8 @@ public function testLockupSettingsI(AcceptanceTester $I) { $I->fillField('Line 4', 'Organization name'); $I->fillField('Line 5', 'Last line full width option'); $I->click('Save'); + $I->see('Local Footer has been', '.messages-list'); + $I->amOnPage('/'); $I->canSee("Site title line"); $I->canSee("Organization name"); @@ -181,6 +193,8 @@ public function testLockupSettingsM(AcceptanceTester $I) { $I->fillField('Line 4', 'Organization name'); $I->fillField('Line 5', 'Last line full width option'); $I->click('Save'); + $I->see('Local Footer has been', '.messages-list'); + $I->amOnPage('/'); $I->canSee("Site title line"); $I->canSee("Secondary title line"); @@ -202,6 +216,8 @@ public function testLockupSettingsO(AcceptanceTester $I) { $I->fillField('Line 4', 'Organization name'); $I->fillField('Line 5', 'Last line full width option'); $I->click('Save'); + $I->see('Local Footer has been', '.messages-list'); + $I->amOnPage('/'); $I->canSee("Organization name"); } @@ -222,6 +238,8 @@ public function testLockupSettingsP(AcceptanceTester $I) { $I->fillField('Line 4', 'Organization name'); $I->fillField('Line 5', 'Last line full width option'); $I->click('Save'); + $I->see('Local Footer has been', '.messages-list'); + $I->amOnPage('/'); $I->canSee("Site title line"); $I->canSee("Organization name"); @@ -243,6 +261,8 @@ public function testLockupSettingsR(AcceptanceTester $I) { $I->fillField('Line 4', 'Organization name'); $I->fillField('Line 5', 'Last line full width option'); $I->click('Save'); + $I->see('Local Footer has been', '.messages-list'); + $I->amOnPage('/'); $I->canSee("Last line full width option"); } @@ -263,6 +283,8 @@ public function testLockupSettingsS(AcceptanceTester $I) { $I->fillField('Line 4', 'Organization name'); $I->fillField('Line 5', 'Last line full width option'); $I->click('Save'); + $I->see('Local Footer has been', '.messages-list'); + $I->amOnPage('/'); $I->canSee("Site title line"); $I->canSee("Secondary title line"); @@ -285,6 +307,8 @@ public function testLockupSettingsT(AcceptanceTester $I) { $I->fillField('Line 4', 'Organization name'); $I->fillField('Line 5', 'Last line full width option'); $I->click('Save'); + $I->see('Local Footer has been', '.messages-list'); + $I->amOnPage('/'); $I->canSee("Site title line"); $I->canSee("Secondary title line"); @@ -319,6 +343,8 @@ public function testLogoWithLockup(AcceptanceTester $I) { $I->click('Upload'); $I->click('Save'); + $I->see('Local Footer has been', '.messages-list'); + $I->amOnPage('/'); $I->seeElement(".su-lockup__custom-logo"); $I->assertNotEmpty($I->grabAttributeFrom('.su-lockup__custom-logo', 'alt')); @@ -353,6 +379,8 @@ public function testLogoWithOutLockup(AcceptanceTester $I) { $I->click('Upload'); $I->click('Save'); + $I->see('Local Footer has been', '.messages-list'); + $I->amOnPage('/'); $I->seeElement(".su-lockup__custom-logo"); $I->cantSee("Site title line"); diff --git a/tests/codeception/acceptance/LockupSettings/LockupSettingsCest.php b/tests/codeception/acceptance/LockupSettings/LockupSettingsCest.php index 1227048db..e6641f976 100644 --- a/tests/codeception/acceptance/LockupSettings/LockupSettingsCest.php +++ b/tests/codeception/acceptance/LockupSettings/LockupSettingsCest.php @@ -61,6 +61,8 @@ public function testLockupSettingsA(AcceptanceTester $I) { $I->fillField('Line 4', 'Organization name'); $I->fillField('Line 5', 'Last line full width option'); $I->click('Save'); + $I->see('Lockup Settings has been', '.messages-list'); + $I->amOnPage('/'); $I->canSee("Site title line"); $I->canSee("Last line full width option"); @@ -82,6 +84,8 @@ public function testLockupSettingsB(AcceptanceTester $I) { $I->fillField('Line 4', 'Organization name'); $I->fillField('Line 5', 'Last line full width option'); $I->click('Save'); + $I->see('Lockup Settings has been', '.messages-list'); + $I->amOnPage('/'); $I->canSee("Site title line"); $I->canSee("Secondary title line"); @@ -103,6 +107,8 @@ public function testLockupSettingsD(AcceptanceTester $I) { $I->fillField('Line 4', 'Organization name'); $I->fillField('Line 5', 'Last line full width option'); $I->click('Save'); + $I->see('Lockup Settings has been', '.messages-list'); + $I->amOnPage('/'); $I->canSee("Site title line"); $I->canSee("Tertiary title line"); @@ -124,6 +130,8 @@ public function testLockupSettingsE(AcceptanceTester $I) { $I->fillField('Line 4', 'Organization name'); $I->fillField('Line 5', 'Last line full width option'); $I->click('Save'); + $I->see('Lockup Settings has been', '.messages-list'); + $I->amOnPage('/'); $I->canSee("Site title line"); $I->canSee("Secondary title line"); @@ -146,6 +154,8 @@ public function testLockupSettingsH(AcceptanceTester $I) { $I->fillField('Line 4', 'Organization name'); $I->fillField('Line 5', 'Last line full width option'); $I->click('Save'); + $I->see('Lockup Settings has been', '.messages-list'); + $I->amOnPage('/'); $I->canSee("Site title line"); $I->canSee("Organization name"); @@ -168,6 +178,8 @@ public function testLockupSettingsI(AcceptanceTester $I) { $I->fillField('Line 4', 'Organization name'); $I->fillField('Line 5', 'Last line full width option'); $I->click('Save'); + $I->see('Lockup Settings has been', '.messages-list'); + $I->amOnPage('/'); $I->canSee("Site title line"); $I->canSee("Organization name"); @@ -190,6 +202,8 @@ public function testLockupSettingsM(AcceptanceTester $I) { $I->fillField('Line 4', 'Organization name'); $I->fillField('Line 5', 'Last line full width option'); $I->click('Save'); + $I->see('Lockup Settings has been', '.messages-list'); + $I->amOnPage('/'); $I->canSee("Site title line"); $I->canSee("Secondary title line"); @@ -211,6 +225,8 @@ public function testLockupSettingsO(AcceptanceTester $I) { $I->fillField('Line 4', 'Organization name'); $I->fillField('Line 5', 'Last line full width option'); $I->click('Save'); + $I->see('Lockup Settings has been', '.messages-list'); + $I->amOnPage('/'); $I->canSee("Organization name"); } @@ -231,6 +247,8 @@ public function testLockupSettingsP(AcceptanceTester $I) { $I->fillField('Line 4', 'Organization name'); $I->fillField('Line 5', 'Last line full width option'); $I->click('Save'); + $I->see('Lockup Settings has been', '.messages-list'); + $I->amOnPage('/'); $I->canSee("Site title line"); $I->canSee("Organization name"); @@ -252,6 +270,8 @@ public function testLockupSettingsR(AcceptanceTester $I) { $I->fillField('Line 4', 'Organization name'); $I->fillField('Line 5', 'Last line full width option'); $I->click('Save'); + $I->see('Lockup Settings has been', '.messages-list'); + $I->amOnPage('/'); $I->canSee("Last line full width option"); } @@ -272,6 +292,8 @@ public function testLockupSettingsS(AcceptanceTester $I) { $I->fillField('Line 4', 'Organization name'); $I->fillField('Line 5', 'Last line full width option'); $I->click('Save'); + $I->see('Lockup Settings has been', '.messages-list'); + $I->amOnPage('/'); $I->canSee("Site title line"); $I->canSee("Secondary title line"); @@ -294,6 +316,8 @@ public function testLockupSettingsT(AcceptanceTester $I) { $I->fillField('Line 4', 'Organization name'); $I->fillField('Line 5', 'Last line full width option'); $I->click('Save'); + $I->see('Lockup Settings has been', '.messages-list'); + $I->amOnPage('/'); $I->canSee("Site title line"); $I->canSee("Secondary title line"); @@ -328,6 +352,8 @@ public function testLogoWithLockup(AcceptanceTester $I) { $I->click('Upload'); $I->click('Save'); + $I->see('Lockup Settings has been', '.messages-list'); + $I->amOnPage('/'); $I->seeElement(".su-lockup__custom-logo"); $I->assertNotEmpty($I->grabAttributeFrom('.su-lockup__custom-logo', 'alt')); @@ -362,6 +388,8 @@ public function testLogoWithOutLockup(AcceptanceTester $I) { $I->click('Upload'); $I->click('Save'); + $I->see('Lockup Settings has been', '.messages-list'); + $I->amOnPage('/'); $I->seeElement(".su-lockup__custom-logo"); $I->assertNotEmpty($I->grabAttributeFrom('.su-lockup__custom-logo', 'alt')); diff --git a/tests/codeception/acceptance/SuperFooter/SuperFooterCest.php b/tests/codeception/acceptance/SuperFooter/SuperFooterCest.php index 0ca24e328..084fa8bd2 100644 --- a/tests/codeception/acceptance/SuperFooter/SuperFooterCest.php +++ b/tests/codeception/acceptance/SuperFooter/SuperFooterCest.php @@ -47,6 +47,8 @@ public function testFormSettings(AcceptanceTester $I) { $I->fillField('#edit-su-super-foot-intranet-0-uri', 'https://stanford.edu/'); $I->fillField('#edit-su-super-foot-intranet-0-title', 'Intranet Link'); $I->click('Save'); + $I->see('Super Footer has been', '.messages-list'); + $I->amOnPage("/"); $I->seeElement(".block-config-pages-super-footer"); $I->canSee("Super Footer Title"); diff --git a/tests/codeception/acceptance/SystemSiteConfigCest.php b/tests/codeception/acceptance/SystemSiteConfigCest.php index 27fb1b961..456ece9c3 100644 --- a/tests/codeception/acceptance/SystemSiteConfigCest.php +++ b/tests/codeception/acceptance/SystemSiteConfigCest.php @@ -53,7 +53,7 @@ public function testBasicSiteSettings(AcceptanceTester $I) { $I->fillField('Accessibility Contact (value 1)', $this->faker->email); $I->selectOption('Organization', $org_term->id()); $I->click('Save'); - $I->canSee('Site Settings has been'); + $I->canSee('Site Settings hs been', '.messages-list'); $I->amOnPage('/user/logout'); $I->amOnPage('/'); @@ -63,7 +63,7 @@ public function testBasicSiteSettings(AcceptanceTester $I) { $I->amOnPage('/admin/config/system/basic-site-settings'); $I->fillField('Site Name', ''); $I->click('Save'); - $I->canSee('Site Settings has been'); + $I->canSee('Site Settings hs been', '.messages-list'); $I->amOnPage('/'); $I->cantSee('Foo Bar Site'); } @@ -106,7 +106,7 @@ public function testSitePages(AcceptanceTester $I) { $I->fillField('Accessibility Contact (value 1)', $this->faker->email); $I->selectOption('Organization', $org_term->id()); $I->click('Save'); - $I->canSee('Site Settings has been'); + $I->canSee('Site Settings hs been', '.messages-list'); drupal_flush_all_caches(); $setting = \Drupal::config('system.site')->get('page.front'); @@ -122,7 +122,7 @@ public function testSitePages(AcceptanceTester $I) { $I->selectOption('404 Page', '- None -'); $I->selectOption('403 Page', '- None -'); $I->click('Save'); - $I->canSee('Site Settings has been'); + $I->canSee('Site Settings hs been', '.messages-list'); $I->amOnPage('/'); $I->canSeeResponseCodeIs(200); @@ -151,7 +151,7 @@ protected function experimentalTestGoogleAnalytics(AcceptanceTester $I) { $I->canSee('1 error has been found: Google Analytics Account'); $I->fillField('Google Analytics Account', 'UA-123456-12'); $I->click('Save'); - $I->canSee('Site Settings has been'); + $I->canSee('Site Settings hs been', '.messages-list'); $I->amOnPage('/user/logout'); $I->amOnPage('/'); @@ -160,7 +160,7 @@ protected function experimentalTestGoogleAnalytics(AcceptanceTester $I) { $I->amOnPage('/admin/config/system/basic-site-settings'); $I->fillField('Google Analytics Account', ''); $I->click('Save'); - $I->canSee('Site Settings has been'); + $I->canSee('Site Settings hs been', '.messages-list'); $I->amOnPage('/user/logout'); $I->amOnPage('/'); $I->cantSee('UA-12456-12'); diff --git a/tests/codeception/functional/Contrib/ExtLinkCest.php b/tests/codeception/functional/Contrib/ExtLinkCest.php index 7608c152c..2d4d46467 100644 --- a/tests/codeception/functional/Contrib/ExtLinkCest.php +++ b/tests/codeception/functional/Contrib/ExtLinkCest.php @@ -66,7 +66,7 @@ public function testExtLink(FunctionalTester $I) { $I->fillField('Accessibility Contact (value 1)', $this->faker->email); $I->selectOption('Org Code', $org_term->id()); $I->click('Save'); - $I->canSee('Site Settings has been'); + $I->canSee('Site Settings hs been', '.messages-list'); $I->amOnPage('/admin/config/system/local-footer'); $I->checkOption('#edit-su-footer-enabled-value'); @@ -88,6 +88,7 @@ public function testExtLink(FunctionalTester $I) { $I->fillField('su_local_foot_second[1][title]', 'Another secondary link'); $I->click('Save'); + $I->see('Local Footer has been', '.messages-list'); // Validate email links. $I->amOnPage('/'); diff --git a/tests/codeception/functional/Navigation/NavigationDropDownsCest.php b/tests/codeception/functional/Navigation/NavigationDropDownsCest.php index 16436c668..d05f0b667 100644 --- a/tests/codeception/functional/Navigation/NavigationDropDownsCest.php +++ b/tests/codeception/functional/Navigation/NavigationDropDownsCest.php @@ -65,14 +65,15 @@ public function testDropdownMenus(FunctionalTester $I) { $I->fillField('Accessibility Contact (value 1)', $this->faker->email); $I->selectOption('Org Code', $org_term->id()); $I->click('Save'); - $I->canSee('Site Settings has been'); + $I->canSee('Site Settings hs been', '.messages-list'); + $I->amOnPage('/'); $I->cantSeeElement('button', ['class' => 'su-nav-toggle']); $I->amOnPage('/admin/config/system/basic-site-settings'); $I->checkOption('Use drop down menus'); $I->click('Save'); - $I->canSee('Site Settings has been'); + $I->canSee('Site Settings hs been', '.messages-list'); $node_title = Factory::create()->text(20);