From 6be3b1db5568bd6eeaa76c4cf16d923cd610d850 Mon Sep 17 00:00:00 2001 From: pookmish Date: Fri, 20 Oct 2023 16:35:07 -0500 Subject: [PATCH] 11.0.2 - Adjusted acceptance tests --- CHANGELOG.md | 4 +++ ...s.stanford_basic_site_settings.default.yml | 2 +- stanford_profile.info.yml | 2 +- .../acceptance/Content/BasicPageCest.php | 12 ++++++-- .../acceptance/Content/CoursesCest.php | 1 - .../acceptance/Content/CustomBlockCest.php | 2 +- .../acceptance/Content/EventsCest.php | 2 +- .../acceptance/Content/NewsCest.php | 2 -- .../acceptance/Content/PersonCest.php | 2 +- .../acceptance/Content/PolicyCest.php | 8 +++-- .../acceptance/Content/PublicationsCest.php | 1 - .../acceptance/Content/SearchBlockCest.php | 13 ++++++-- .../acceptance/Contrib/ViewsBulkEditCest.php | 8 ++--- .../GlobalMessage/GlobalMessageCest.php | 4 +++ tests/codeception/acceptance/HomePageCest.php | 2 +- .../LocalFooter/LocalFooterCest.php | 13 ++++++-- .../LocalFooter/LocalFooterLockupCest.php | 28 +++++++++++++++++ .../LockupSettings/LockupSettingsCest.php | 30 ++++++++++++++++++- .../acceptance/Media/MediaCest.php | 1 - .../acceptance/Media/MediaFormsCest.php | 2 +- .../Paragraphs/Issue2901390Cest.php | 2 +- .../acceptance/Paragraphs/ListsCest.php | 7 ----- tests/codeception/acceptance/SubThemeCest.php | 13 ++++---- .../SuperFooter/SuperFooterCest.php | 4 ++- .../acceptance/SystemSiteConfigCest.php | 20 +++++++++++-- .../acceptance/TextFormatsCest.php | 1 - .../acceptance/Users/IntranetCest.php | 1 - .../acceptance/Users/RolesCest.php | 7 ++--- .../Content/BasicPageParagraphsCest.php | 10 +++---- .../functional/Content/StanfordNewsCest.php | 8 ++--- .../functional/Contrib/ExtLinkCest.php | 29 +++++++++++++++++- .../Navigation/NavigationDropDownsCest.php | 4 ++- .../Paragraphs/EntityReferenceCest.php | 5 ++-- .../functional/Paragraphs/GalleryCest.php | 3 +- .../functional/Paragraphs/SpacerCest.php | 17 +++++------ .../functional/Paragraphs/WYSIWYGCest.php | 7 ++--- .../functional/Users/RolesCest.php | 13 ++++++-- 37 files changed, 207 insertions(+), 83 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 04a414ec..bd9bf555 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Stanford Profile +11.0.2 +------------------------------------------------------------------------------- +- Fix acceptance tests. + 11.0.1 ------------------------------------------------------------------------------- - Fix site setting redirect logic diff --git a/config/sync/core.entity_form_display.config_pages.stanford_basic_site_settings.default.yml b/config/sync/core.entity_form_display.config_pages.stanford_basic_site_settings.default.yml index bb2ca932..4ffcecd1 100644 --- a/config/sync/core.entity_form_display.config_pages.stanford_basic_site_settings.default.yml +++ b/config/sync/core.entity_form_display.config_pages.stanford_basic_site_settings.default.yml @@ -106,7 +106,7 @@ third_party_settings: show_empty_fields: false id: '' formatter: closed - description: '' + description: "

Site owners are required to provide the email addresses for important site contacts on an annual basis in order to renew the site. Please provide an email address for the business owner, technical owner, and the accessibility contact for the site, as well as an indication of the organizational affiliation of the site.

\r\n\r\n

If you have questions about this information or policies around site renewal, please visit our User Guide page on site ownership.

" required_fields: true id: config_pages.stanford_basic_site_settings.default targetEntityType: config_pages diff --git a/stanford_profile.info.yml b/stanford_profile.info.yml index 156c5dad..19aa53ef 100644 --- a/stanford_profile.info.yml +++ b/stanford_profile.info.yml @@ -1,6 +1,6 @@ name: 'Stanford Profile' description: 'Jumpstart Website Profile' -version: 11.0.1 +version: 11.0.2 type: profile project: Stanford core_version_requirement: ^9 || ^10 diff --git a/tests/codeception/acceptance/Content/BasicPageCest.php b/tests/codeception/acceptance/Content/BasicPageCest.php index 791fb657..8f72a425 100644 --- a/tests/codeception/acceptance/Content/BasicPageCest.php +++ b/tests/codeception/acceptance/Content/BasicPageCest.php @@ -31,7 +31,10 @@ public function __construct() { */ public function testCreatingPage(AcceptanceTester $I) { $node_title = $this->faker->text(20); - $node = $I->createEntity(['type' => 'stanford_page', 'title' => $node_title]); + $node = $I->createEntity([ + 'type' => 'stanford_page', + 'title' => $node_title, + ]); $I->logInWithRole('site_manager'); $I->amOnPage($node->toUrl('edit-form')->toString()); @@ -69,9 +72,12 @@ public function testCreatingPage(AcceptanceTester $I) { /** * Test deleting menu items clears them from the main menu. */ - public function testDeletedMenuItems(AcceptanceTester $I){ + public function testDeletedMenuItems(AcceptanceTester $I) { $node_title = $this->faker->text(20); - $node = $I->createEntity(['type' => 'stanford_page', 'title' => $node_title]); + $node = $I->createEntity([ + 'type' => 'stanford_page', + 'title' => $node_title, + ]); $I->logInWithRole('site_manager'); $I->amOnPage($node->toUrl('edit-form')->toString()); diff --git a/tests/codeception/acceptance/Content/CoursesCest.php b/tests/codeception/acceptance/Content/CoursesCest.php index 334e2dbe..3a214396 100644 --- a/tests/codeception/acceptance/Content/CoursesCest.php +++ b/tests/codeception/acceptance/Content/CoursesCest.php @@ -79,7 +79,6 @@ public function testRabbitHoleRedirects(AcceptanceTester $I) { $I->canSee('This page will redirect'); } - /** * Create a Course Node. * diff --git a/tests/codeception/acceptance/Content/CustomBlockCest.php b/tests/codeception/acceptance/Content/CustomBlockCest.php index dd9a729c..a15d5da0 100644 --- a/tests/codeception/acceptance/Content/CustomBlockCest.php +++ b/tests/codeception/acceptance/Content/CustomBlockCest.php @@ -25,7 +25,7 @@ public function __construct() { public function testCustomBlockAccess(AcceptanceTester $I) { $block = $I->createEntity([ 'type' => 'stanford_component_block', - 'info' => $this->faker->word(3, true), + 'info' => $this->faker->word(3, TRUE), ], 'block_content'); $I->logInWithRole('site_manager'); $I->amOnPage($block->toUrl()->toString()); diff --git a/tests/codeception/acceptance/Content/EventsCest.php b/tests/codeception/acceptance/Content/EventsCest.php index 805e6d84..14ae5173 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 has been', '.messages-list'); $I->amOnPage($event->toUrl('delete-form')->toString()); $I->click('Delete'); diff --git a/tests/codeception/acceptance/Content/NewsCest.php b/tests/codeception/acceptance/Content/NewsCest.php index 293c9d31..4e00a502 100644 --- a/tests/codeception/acceptance/Content/NewsCest.php +++ b/tests/codeception/acceptance/Content/NewsCest.php @@ -78,7 +78,6 @@ public function testViewPagesExist(AcceptanceTester $I) { * Validate external content redirect. */ public function testExternalSourceArticle(AcceptanceTester $I) { - $node = $I->createEntity([ 'type' => 'stanford_news', 'title' => $this->faker->words(3, TRUE), @@ -251,5 +250,4 @@ public function testMetaData(AcceptanceTester $I) { $I->assertEquals($values['featured_image_alt'], $I->grabAttributeFrom('meta[name="twitter:image:alt"]', 'content'), 'Metadata "twitter:image:alt" should match.'); } - } diff --git a/tests/codeception/acceptance/Content/PersonCest.php b/tests/codeception/acceptance/Content/PersonCest.php index 815d380a..b0241db9 100644 --- a/tests/codeception/acceptance/Content/PersonCest.php +++ b/tests/codeception/acceptance/Content/PersonCest.php @@ -343,7 +343,7 @@ public function testMetaData(AcceptanceTester $I) { /** * Deleting the taxonomy term doesn't break the form. */ - public function testDeletedTerm(AcceptanceTester $I){ + public function testDeletedTerm(AcceptanceTester $I) { $term = $I->createEntity([ 'name' => $this->faker->words(2, TRUE), 'vid' => 'stanford_person_types', diff --git a/tests/codeception/acceptance/Content/PolicyCest.php b/tests/codeception/acceptance/Content/PolicyCest.php index f16a3c06..8dc1dbcf 100644 --- a/tests/codeception/acceptance/Content/PolicyCest.php +++ b/tests/codeception/acceptance/Content/PolicyCest.php @@ -131,7 +131,7 @@ public function testPolicyPathAuto(AcceptanceTester $I) { $node = $I->createEntity([ 'type' => 'stanford_policy', - 'title' => $this->faker->words(3, true), + 'title' => $this->faker->words(3, TRUE), 'su_policy_title' => $this->faker->words(4, TRUE) . '-foo-bar', 'su_policy_auto_prefix' => 1, ]); @@ -261,10 +261,12 @@ public function testPolicyHeirarcy(AcceptanceTester $I) { $I->uncheckOption('Automatic Prefix'); $I->fillField('Chapter Number', $new_prefix); $I->click('Save'); - $I->canSee($new_prefix . '. ' . $chapter_two->get('su_policy_title')->getString(), 'h1'); + $I->canSee($new_prefix . '. ' . $chapter_two->get('su_policy_title') + ->getString(), 'h1'); $I->amOnPage($article_one->toUrl()->toString()); - $I->canSee($new_prefix . '.A ' . $article_one->get('su_policy_title')->getString()); + $I->canSee($new_prefix . '.A ' . $article_one->get('su_policy_title') + ->getString()); $new_title = $this->faker->words(4, TRUE); $I->amOnPage($article_one->toUrl('edit-form')->toString()); diff --git a/tests/codeception/acceptance/Content/PublicationsCest.php b/tests/codeception/acceptance/Content/PublicationsCest.php index ca2a42a1..aabdd00b 100644 --- a/tests/codeception/acceptance/Content/PublicationsCest.php +++ b/tests/codeception/acceptance/Content/PublicationsCest.php @@ -139,7 +139,6 @@ public function testListSort(AcceptanceTester $I) { $I->click('Save'); $I->canSee($this->values['a_node_title'], 'h1'); - $I->amOnPage('/node/add/stanford_publication'); $I->fillField('Title', $this->values['b_node_title']); $I->selectOption('su_publication_citation[actions][bundle]', 'Other'); diff --git a/tests/codeception/acceptance/Content/SearchBlockCest.php b/tests/codeception/acceptance/Content/SearchBlockCest.php index 322c8c9c..5dbdfcb5 100644 --- a/tests/codeception/acceptance/Content/SearchBlockCest.php +++ b/tests/codeception/acceptance/Content/SearchBlockCest.php @@ -1,5 +1,6 @@ faker = Factory::create(); } + public function __before() { + if ($cp = ConfigPages::load('stanford_basic_site_settings')) { + $cp->delete(); + } + } + /** * Site managers should be able to disable the search block. */ @@ -26,8 +33,7 @@ public function testHideSearchBlock(AcceptanceTester $I) { ], 'taxonomy_term'); $I->logInWithRole('site_manager'); - $I->amOnPage('/'); - $I->seeElement('.su-site-search__input'); + $I->amOnPage('/admin/config/system/basic-site-settings'); $I->see('Hide Site Search'); $I->checkOption('Hide Site Search'); @@ -37,13 +43,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 has 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', '.messages-list'); $I->amOnPage('/'); $I->seeElement('.su-site-search__input'); } diff --git a/tests/codeception/acceptance/Contrib/ViewsBulkEditCest.php b/tests/codeception/acceptance/Contrib/ViewsBulkEditCest.php index 28bd6fab..8b4bb079 100644 --- a/tests/codeception/acceptance/Contrib/ViewsBulkEditCest.php +++ b/tests/codeception/acceptance/Contrib/ViewsBulkEditCest.php @@ -37,15 +37,15 @@ public function testBulkEdits(AcceptanceTester $I) { $this->createEvents($I); $event_foo_bar_baz = $I->createEntity([ - 'name' => $this->faker->words(3, true), + 'name' => $this->faker->words(3, TRUE), 'vid' => 'stanford_event_types', ], 'taxonomy_term'); - $news_foo_bar_baz= $I->createEntity([ - 'name' => $this->faker->words(3, true), + $news_foo_bar_baz = $I->createEntity([ + 'name' => $this->faker->words(3, TRUE), 'vid' => 'stanford_news_topics', ], 'taxonomy_term'); $pubs_foo_bar_baz = $I->createEntity([ - 'name' => $this->faker->words(3, true), + 'name' => $this->faker->words(3, TRUE), 'vid' => 'stanford_publication_topics', ], 'taxonomy_term'); diff --git a/tests/codeception/acceptance/GlobalMessage/GlobalMessageCest.php b/tests/codeception/acceptance/GlobalMessage/GlobalMessageCest.php index 23364c47..f4339396 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 has 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 has been', '.messages-list'); + $I->amOnPage("/"); $I->seeElement(".su-alert--error"); } diff --git a/tests/codeception/acceptance/HomePageCest.php b/tests/codeception/acceptance/HomePageCest.php index 6a773e50..d9ffb0a1 100644 --- a/tests/codeception/acceptance/HomePageCest.php +++ b/tests/codeception/acceptance/HomePageCest.php @@ -21,7 +21,7 @@ public function testHomepage(AcceptanceTester $I) { /** * Users can't unpublish the homepage. */ - public function testUnpublishingHomepage(AcceptanceTester $I){ + public function testUnpublishingHomepage(AcceptanceTester $I) { $I->logInWithRole('site_manager'); $I->amOnPage('/'); $I->click('Edit', '.tabs'); diff --git a/tests/codeception/acceptance/LocalFooter/LocalFooterCest.php b/tests/codeception/acceptance/LocalFooter/LocalFooterCest.php index d1890469..afc47be2 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,17 +125,18 @@ 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()); - $I->amOnPage('/admin/config/system/local-footer'); $I->checkOption('Enabled'); $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 20a8bae0..f020b226 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 1227048d..4d6e839b 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,13 +178,15 @@ 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"); $I->canSee("Tertiary title line"); } - /** + /** * Test the lockup settings overrides. */ public function testLockupSettingsM(AcceptanceTester $I) { @@ -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/Media/MediaCest.php b/tests/codeception/acceptance/Media/MediaCest.php index cf54fd33..68042c4a 100644 --- a/tests/codeception/acceptance/Media/MediaCest.php +++ b/tests/codeception/acceptance/Media/MediaCest.php @@ -142,7 +142,6 @@ public function testAllowedEmbedCodes(AcceptanceTester $I) { $I->click('Save'); $I->canSee('has been created'); } - } /** diff --git a/tests/codeception/acceptance/Media/MediaFormsCest.php b/tests/codeception/acceptance/Media/MediaFormsCest.php index da7fe679..c28d83a3 100644 --- a/tests/codeception/acceptance/Media/MediaFormsCest.php +++ b/tests/codeception/acceptance/Media/MediaFormsCest.php @@ -30,7 +30,7 @@ public function testFormAlters(AcceptanceTester $I) { $I->amOnPage('/user/logout'); $I->logInWithRole('administrator'); $I->amOnPage('/media/add/embeddable'); - $name = $this->faker->words(3, true); + $name = $this->faker->words(3, TRUE); $I->fillField('Name', $name); $I->fillField('Embed Code', '
test
'); $I->click('Save'); diff --git a/tests/codeception/acceptance/Paragraphs/Issue2901390Cest.php b/tests/codeception/acceptance/Paragraphs/Issue2901390Cest.php index 8dbb4922..f2f2d401 100644 --- a/tests/codeception/acceptance/Paragraphs/Issue2901390Cest.php +++ b/tests/codeception/acceptance/Paragraphs/Issue2901390Cest.php @@ -32,7 +32,7 @@ public function testLayoutBuilderParagraph(AcceptanceTester $I) { $I->logInAs($user->id()); $node = $I->createEntity([ 'type' => 'stanford_page', - 'title' => $this->faker->text(20), + 'title' => $this->faker->text(20), ]); $I->amOnPage($node->toUrl()->toString()); $I->click('Layout'); diff --git a/tests/codeception/acceptance/Paragraphs/ListsCest.php b/tests/codeception/acceptance/Paragraphs/ListsCest.php index 7226fabf..37de1721 100644 --- a/tests/codeception/acceptance/Paragraphs/ListsCest.php +++ b/tests/codeception/acceptance/Paragraphs/ListsCest.php @@ -279,7 +279,6 @@ public function testEmptyResultsListEvents(AcceptanceTester $I) { $I->canSee($headline_text); $I->cantSee($message); - /** @var \Drupal\paragraphs\ParagraphInterface $paragraph */ $paragraph = $I->createEntity([ 'type' => 'stanford_lists', @@ -491,7 +490,6 @@ public function testListParagraphEventFiltersNoFilter(AcceptanceTester $I) { 'items_to_display' => 100, ]); - $I->amOnPage($node->toUrl()->toString()); $I->canSee($event->label()); } @@ -527,7 +525,6 @@ public function testListParagraphEventFiltersRandomFilter(AcceptanceTester $I) { 'arguments' => $random_term->label(), ]); - $I->amOnPage($node->toUrl()->toString()); $I->cantSee($event->label()); } @@ -654,7 +651,6 @@ public function testListParagraphPeopleFilters(AcceptanceTester $I) { 'items_to_display' => 100, ]); - $I->amOnPage($node->toUrl()->toString()); $I->canSee($news->label()); } @@ -685,7 +681,6 @@ public function testListParagraphPeopleFiltersRandomFilter(AcceptanceTester $I) 'arguments' => $random_term->label(), ]); - $I->amOnPage($node->toUrl()->toString()); $I->cantSee($news->label()); } @@ -718,7 +713,6 @@ public function testListParagraphPeopleFiltersTypeFilter(AcceptanceTester $I) { 'arguments' => $type_term->label(), ]); - $I->amOnPage($node->toUrl()->toString()); $I->canSee($news->label()); } @@ -776,7 +770,6 @@ public function testListParagraphBasicPageTypesFilter(AcceptanceTester $I) { * @return bool|\Drupal\node\NodeInterface */ protected function getNodeWithList(AcceptanceTester $I, array $view) { - $paragraph = $I->createEntity([ 'type' => 'stanford_lists', 'su_list_view' => $view, diff --git a/tests/codeception/acceptance/SubThemeCest.php b/tests/codeception/acceptance/SubThemeCest.php index 3a187e4e..c18abc20 100644 --- a/tests/codeception/acceptance/SubThemeCest.php +++ b/tests/codeception/acceptance/SubThemeCest.php @@ -52,7 +52,7 @@ public function _before(AcceptanceTester $I) { public function _after(AcceptanceTester $I) { $this->runConfigImport($I, TRUE); $info_path = $this->themePath . '/' . strtolower($this->themeName) . '.info.yml'; - if (file_exists($info_path)){ + if (file_exists($info_path)) { unlink($info_path); rmdir($this->themePath); } @@ -60,6 +60,7 @@ public function _after(AcceptanceTester $I) { /** * Enable the subtheme and the config should reflect the changes done. + * * @group minimal-subtheme-test2 */ public function testSubTheme(AcceptanceTester $I) { @@ -87,9 +88,10 @@ public function testSubTheme(AcceptanceTester $I) { $I->canSeeResponseCodeIs(200); } -/** - * Enable the minimally branded subtheme and the config should reflect the changes done. - * Test the changes are there. + /** + * Enable the minimally branded subtheme and the config should reflect the + * changes done. Test the changes are there. + * * @group minimal-subtheme-test */ public function testMinimalSubtheme(AcceptanceTester $I) { @@ -125,7 +127,8 @@ protected function runConfigImport(AcceptanceTester $I, $disable_config_ignore = protected function createTheme() { if (!file_exists("{$this->themePath}/{$this->themeName}.info.yml")) { mkdir($this->themePath, 0777, TRUE); - $info = file_get_contents(\Drupal::service('extension.list.theme')->getPath('stanford_basic') . '/stanford_basic.info.yml'); + $info = file_get_contents(\Drupal::service('extension.list.theme') + ->getPath('stanford_basic') . '/stanford_basic.info.yml'); $info = Yaml::decode($info); $info['name'] = $this->themeName; $info['base theme'] = 'stanford_basic'; diff --git a/tests/codeception/acceptance/SuperFooter/SuperFooterCest.php b/tests/codeception/acceptance/SuperFooter/SuperFooterCest.php index 0ca24e32..2fe60f60 100644 --- a/tests/codeception/acceptance/SuperFooter/SuperFooterCest.php +++ b/tests/codeception/acceptance/SuperFooter/SuperFooterCest.php @@ -5,7 +5,7 @@ */ class SuperFooterCest { - public function _after(AcceptanceTester $I){ + public function _after(AcceptanceTester $I) { $config_page = \Drupal::entityTypeManager() ->getStorage('config_pages') ->load('stanford_super_footer'); @@ -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 a2ebf330..af847bdb 100644 --- a/tests/codeception/acceptance/SystemSiteConfigCest.php +++ b/tests/codeception/acceptance/SystemSiteConfigCest.php @@ -53,6 +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', '.messages-list'); $I->amOnPage('/user/logout'); $I->amOnPage('/'); @@ -62,6 +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', '.messages-list'); $I->amOnPage('/'); $I->cantSee('Foo Bar Site'); } @@ -104,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 has been', '.messages-list'); drupal_flush_all_caches(); $setting = \Drupal::config('system.site')->get('page.front'); @@ -120,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 has been', '.messages-list'); $I->amOnPage('/'); $I->canSeeResponseCodeIs(200); @@ -131,13 +133,26 @@ public function testSitePages(AcceptanceTester $I) { * Google Analytics account should be added for anonymous users. */ protected function experimentalTestGoogleAnalytics(AcceptanceTester $I) { + $org_term = $I->createEntity([ + 'vid' => 'site_owner_orgs', + 'name' => $this->faker->words(2, TRUE), + ], 'taxonomy_term'); + $I->logInWithRole('site_manager'); $I->amOnPage('/admin/config/system/basic-site-settings'); $I->fillField('Google Analytics Account', 'abcdefg'); + + $I->fillField('Site Owner Contact (value 1)', $this->faker->email); + $I->fillField('Technical Contact (value 1)', $this->faker->email); + $I->fillField('Accessibility Contact (value 1)', $this->faker->email); + $I->selectOption('Org Code', $org_term->id()); + $I->click('Save'); $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', '.messages-list'); + $I->amOnPage('/user/logout'); $I->amOnPage('/'); $I->canSee('UA-123456-12'); @@ -145,6 +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', '.messages-list'); $I->amOnPage('/user/logout'); $I->amOnPage('/'); $I->cantSee('UA-12456-12'); diff --git a/tests/codeception/acceptance/TextFormatsCest.php b/tests/codeception/acceptance/TextFormatsCest.php index 3d51f631..464ad3e2 100644 --- a/tests/codeception/acceptance/TextFormatsCest.php +++ b/tests/codeception/acceptance/TextFormatsCest.php @@ -38,7 +38,6 @@ public function testBasicHtml(AcceptanceTester $I) { $I->canSee('Image style: Thumbnail Square (100x100)'); $I->amOnPage('/admin/structure/media/manage/image/display/thumbnail'); $I->canSee('Image style: Thumbnail (100 wide)'); - } } diff --git a/tests/codeception/acceptance/Users/IntranetCest.php b/tests/codeception/acceptance/Users/IntranetCest.php index 09c76957..44a45226 100644 --- a/tests/codeception/acceptance/Users/IntranetCest.php +++ b/tests/codeception/acceptance/Users/IntranetCest.php @@ -24,7 +24,6 @@ class IntranetCest { */ protected $fileUploadsWasEnabled = FALSE; - /** * Save the original state. */ diff --git a/tests/codeception/acceptance/Users/RolesCest.php b/tests/codeception/acceptance/Users/RolesCest.php index d97224da..abb39307 100644 --- a/tests/codeception/acceptance/Users/RolesCest.php +++ b/tests/codeception/acceptance/Users/RolesCest.php @@ -25,7 +25,7 @@ public function testRolesExist(AcceptanceTester $I) { /** * Stanford Staff role should be very limited. */ - public function testStaffRole(AcceptanceTester $I){ + public function testStaffRole(AcceptanceTester $I) { $I->logInWithRole('stanford_staff'); // D8CORE-2538 Staff and students without additional roles shouldn't see // the admin toolbar. @@ -36,7 +36,7 @@ public function testStaffRole(AcceptanceTester $I){ /** * Stanford Staff role should be very limited. */ - public function testStudentRole(AcceptanceTester $I){ + public function testStudentRole(AcceptanceTester $I) { $I->logInWithRole('stanford_student'); // D8CORE-2538 Staff and students without additional roles shouldn't see // the admin toolbar. @@ -47,7 +47,7 @@ public function testStudentRole(AcceptanceTester $I){ /** * Stanford Staff role should be very limited. */ - public function testFacultyRole(AcceptanceTester $I){ + public function testFacultyRole(AcceptanceTester $I) { $I->logInWithRole('stanford_faculty'); // D8CORE-2538 Staff and students without additional roles shouldn't see // the admin toolbar. @@ -223,7 +223,6 @@ protected function runAccessCheck(AcceptanceTester $I, array $pages = [], $statu */ protected function runLinkExistCheck(AcceptanceTester $I, array $links, $can_see = TRUE) { foreach ($links as $path => $link_text) { - $path = is_int($path) ? NULL : $path; if ($can_see) { $I->canSeeLink($link_text, $path); diff --git a/tests/codeception/functional/Content/BasicPageParagraphsCest.php b/tests/codeception/functional/Content/BasicPageParagraphsCest.php index 952642c7..e0a9fbac 100644 --- a/tests/codeception/functional/Content/BasicPageParagraphsCest.php +++ b/tests/codeception/functional/Content/BasicPageParagraphsCest.php @@ -25,18 +25,18 @@ public function __construct() { * Test the card component data is displayed correctly. */ public function testCardParagraph(FunctionalTester $I) { - $card_values =[ - 'superhead' => $this->faker->words(3, true), - 'headline' => $this->faker->words(3, true), + $card_values = [ + 'superhead' => $this->faker->words(3, TRUE), + 'headline' => $this->faker->words(3, TRUE), 'uri' => $this->faker->url, - 'title' => $this->faker->words(3, true), + 'title' => $this->faker->words(3, TRUE), ]; $paragraph = $I->createEntity(['type' => 'stanford_card'], 'paragraph'); $node = $I->createEntity([ 'type' => 'stanford_page', - 'title' => $this->faker->words(3, true), + 'title' => $this->faker->words(3, TRUE), 'su_page_components' => [ 'target_id' => $paragraph->id(), 'entity' => $paragraph, diff --git a/tests/codeception/functional/Content/StanfordNewsCest.php b/tests/codeception/functional/Content/StanfordNewsCest.php index 242ac747..cb272ae9 100644 --- a/tests/codeception/functional/Content/StanfordNewsCest.php +++ b/tests/codeception/functional/Content/StanfordNewsCest.php @@ -60,7 +60,7 @@ public function testTermOrder(FunctionalTester $I) { $I->click('Save'); $I->canSee($node->label(), 'h1'); - $I->canSee($first_term->label() . ', ' . $second_term->label() . ', '. $third_term->label()); + $I->canSee($first_term->label() . ', ' . $second_term->label() . ', ' . $third_term->label()); $I->amOnPage($node->toUrl('edit-form')->toString()); $I->waitForElementVisible('.form-item--su-news-topics-2-target-id select.simpler-select'); @@ -70,7 +70,7 @@ public function testTermOrder(FunctionalTester $I) { $I->click('Save'); $I->canSee($node->label(), 'h1'); - $I->canSee($second_term->label() . ', ' . $first_term->label() . ', '. $third_term->label()); + $I->canSee($second_term->label() . ', ' . $first_term->label() . ', ' . $third_term->label()); $I->amOnPage($node->toUrl('edit-form')->toString()); $I->waitForElementVisible('.form-item--su-news-topics-2-target-id select.simpler-select'); @@ -80,7 +80,7 @@ public function testTermOrder(FunctionalTester $I) { $I->click('Save'); $I->canSee($node->label(), 'h1'); - $I->canSee($third_term->label() . ', ' . $second_term->label() . ', '. $first_term->label()); + $I->canSee($third_term->label() . ', ' . $second_term->label() . ', ' . $first_term->label()); $I->amOnPage($node->toUrl('edit-form')->toString()); $I->waitForElementVisible('.form-item--su-news-topics-2-target-id select.simpler-select'); @@ -90,7 +90,7 @@ public function testTermOrder(FunctionalTester $I) { $I->click('Save'); $I->canSee($node->label(), 'h1'); - $I->canSee($third_term->label() . ', ' . $first_term->label() . ', '. $second_term->label()); + $I->canSee($third_term->label() . ', ' . $first_term->label() . ', ' . $second_term->label()); } } diff --git a/tests/codeception/functional/Contrib/ExtLinkCest.php b/tests/codeception/functional/Contrib/ExtLinkCest.php index 4caa570a..9a5d90a4 100644 --- a/tests/codeception/functional/Contrib/ExtLinkCest.php +++ b/tests/codeception/functional/Contrib/ExtLinkCest.php @@ -1,5 +1,6 @@ _after($I); } + /** + * Test Constructor. + */ + public function __construct() { + $this->faker = Factory::create(); + } + /** * Always cleanup the config after testing. * @@ -37,10 +51,22 @@ public function _after(FunctionalTester $I) { * Test external links get the added class and svg. */ public function testExtLink(FunctionalTester $I) { + $org_term = $I->createEntity([ + 'vid' => 'site_owner_orgs', + 'name' => $this->faker->words(2, TRUE), + ], 'taxonomy_term'); + $I->logInWithRole('site_manager'); $I->amOnPage('/admin/config/system/basic-site-settings'); $I->uncheckOption('Hide External Link Icons'); + + $I->click('Contact Details'); + $I->fillField('Site Owner Contact (value 1)', $this->faker->email); + $I->fillField('Technical Contact (value 1)', $this->faker->email); + $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', '.messages-list'); $I->amOnPage('/admin/config/system/local-footer'); $I->checkOption('#edit-su-footer-enabled-value'); @@ -62,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 25138414..d47e5315 100644 --- a/tests/codeception/functional/Navigation/NavigationDropDownsCest.php +++ b/tests/codeception/functional/Navigation/NavigationDropDownsCest.php @@ -6,7 +6,6 @@ * Test for the lockup settings. * * @group navigation - * @group foobar */ class NavigationDropDownsCest { @@ -65,12 +64,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', '.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', '.messages-list'); $node_title = Factory::create()->text(20); diff --git a/tests/codeception/functional/Paragraphs/EntityReferenceCest.php b/tests/codeception/functional/Paragraphs/EntityReferenceCest.php index c947df7f..e34010e4 100644 --- a/tests/codeception/functional/Paragraphs/EntityReferenceCest.php +++ b/tests/codeception/functional/Paragraphs/EntityReferenceCest.php @@ -32,7 +32,6 @@ public function __construct() { * News items should display in the list paragraph. */ public function testEntityReference(FunctionalTester $I) { - $news = $I->createEntity([ 'type' => 'stanford_news', 'title' => $this->faker->words(3, TRUE), @@ -47,7 +46,7 @@ public function testEntityReference(FunctionalTester $I) { $I->click('Edit', '.lpb-controls'); $I->waitForText('Content Item(s)'); - $I->fillField('[name="su_entity_item[0][target_id]"]', $news->label() . ' (' .$news->id(). ')'); + $I->fillField('[name="su_entity_item[0][target_id]"]', $news->label() . ' (' . $news->id() . ')'); $I->click('Save', '.ui-dialog-buttonpane'); $I->waitForElementNotVisible('.ui-dialog'); @@ -85,7 +84,7 @@ public function testPublicationTeasers(FunctionalTester $I) { $I->click('Edit', '.lpb-controls'); $I->waitForText('Content Item(s)'); - $I->fillField('[name="su_entity_item[0][target_id]"]', $publication->label() . ' (' .$publication->id(). ')'); + $I->fillField('[name="su_entity_item[0][target_id]"]', $publication->label() . ' (' . $publication->id() . ')'); $I->click('Save', '.ui-dialog-buttonpane'); $I->waitForElementNotVisible('.ui-dialog'); diff --git a/tests/codeception/functional/Paragraphs/GalleryCest.php b/tests/codeception/functional/Paragraphs/GalleryCest.php index 8b4512e3..bb3bab49 100644 --- a/tests/codeception/functional/Paragraphs/GalleryCest.php +++ b/tests/codeception/functional/Paragraphs/GalleryCest.php @@ -27,7 +27,6 @@ public function __construct() { * Create a basic page with a gallery and check the colorbox actions. */ public function testGallery(FunctionalTester $I) { - $I->logInWithRole('contributor'); $node = $this->getNode($I); @@ -76,7 +75,7 @@ public function testGallery(FunctionalTester $I) { $I->assertNotEquals($first_image_src, $second_image_src); } - protected function getNode(FunctionalTester $I){ + protected function getNode(FunctionalTester $I) { $paragraph = $I->createEntity([ 'type' => 'stanford_gallery', ], 'paragraph'); diff --git a/tests/codeception/functional/Paragraphs/SpacerCest.php b/tests/codeception/functional/Paragraphs/SpacerCest.php index 806aa244..02cd0e6b 100644 --- a/tests/codeception/functional/Paragraphs/SpacerCest.php +++ b/tests/codeception/functional/Paragraphs/SpacerCest.php @@ -1,5 +1,6 @@ faker = Factory::create(); } - /** - * The spacer paragraph has one custom field, to set the size of the bottom margin. + * The spacer paragraph has one custom field, to set the size of the bottom + * margin. */ public function testSpacerParagraph(FunctionalTester $I) { - $paragraph = $I->createEntity([ 'type' => 'stanford_spacer', ], 'paragraph'); @@ -66,7 +66,6 @@ public function testSpacerParagraph(FunctionalTester $I) { $I->waitForElementNotVisible('.ui-dialog'); $I->click('Save'); $I->seeElementInDOM('.su-spacer-minimal'); - } } diff --git a/tests/codeception/functional/Paragraphs/WYSIWYGCest.php b/tests/codeception/functional/Paragraphs/WYSIWYGCest.php index 9e86c320..ec84f494 100644 --- a/tests/codeception/functional/Paragraphs/WYSIWYGCest.php +++ b/tests/codeception/functional/Paragraphs/WYSIWYGCest.php @@ -54,7 +54,6 @@ public function testFilteredHtml(FunctionalTester $I) { $I->canSee('Level 05 Heading', 'h5'); $I->cantSeeElement('h6'); - # Text Tags $I->canSee('A small paragraph', 'p'); $I->canSee('Normal Link', 'a'); @@ -144,7 +143,7 @@ public function testEmbeddedImage(FunctionalTester $I) { $I->waitForText('Decorative Image'); $I->click('Save and insert', '.media-library-widget-modal .ui-dialog-buttonset'); $I->waitForElementNotVisible('.media-library-widget-modal'); - $I->wait(1); + $I->wait(2); $I->click('Save', '.ui-dialog-buttonpane'); $I->waitForAjaxToFinish(); @@ -156,7 +155,7 @@ public function testEmbeddedImage(FunctionalTester $I) { /** * Test media category taxonomy field. */ - public function testImageCategory(FunctionalTester $I){ + public function testImageCategory(FunctionalTester $I) { $node = $this->getNodeWithParagraph($I); /** @var \Drupal\Core\File\FileSystemInterface $file_system */ @@ -214,7 +213,7 @@ public function testImageCategory(FunctionalTester $I){ $I->waitForAjaxToFinish(); $I->cantSee($media->label()); - $I->selectOption('Category', '-'. $child_term->label()); + $I->selectOption('Category', '-' . $child_term->label()); $I->click('Apply filters'); $I->waitForAjaxToFinish(); $I->canSee($media->label()); diff --git a/tests/codeception/functional/Users/RolesCest.php b/tests/codeception/functional/Users/RolesCest.php index 2ccac4a4..419e16d0 100644 --- a/tests/codeception/functional/Users/RolesCest.php +++ b/tests/codeception/functional/Users/RolesCest.php @@ -1,5 +1,7 @@ state as $key => $value) { \Drupal::state()->set($key, $value); } + drupal_flush_all_caches(); + } + + public function __construct() { + $this->faker = Factory::create(); } /** @@ -52,11 +59,11 @@ protected function saveStateValue($key) { public function testBulkDeleteHomePage(FunctionalTester $I) { $test_home = $I->createEntity([ 'type' => 'stanford_page', - 'title' => 'Foo Bar Home', + 'title' => $this->faker->words(3, true), ]); $I->createEntity([ 'type' => 'stanford_page', - 'title' => 'Another Page', + 'title' => $this->faker->words(3, true), ]); $test_home_url = $test_home->toUrl()->toString(); \Drupal::state()->set('stanford_profile.front_page', $test_home_url); @@ -74,7 +81,7 @@ public function testBulkDeleteHomePage(FunctionalTester $I) { $I->canSee('Access denied (1)'); $I->runDrush('cache-rebuild'); $I->amOnPage('/'); - $I->canSee('Foo Bar Home', 'h1'); + $I->canSee($test_home->label(), 'h1'); } /**