diff --git a/tests/codeception/acceptance/Content/PublicationsCest.php b/tests/codeception/acceptance/Content/PublicationsCest.php index 44f6d8ba..aabdd00b 100644 --- a/tests/codeception/acceptance/Content/PublicationsCest.php +++ b/tests/codeception/acceptance/Content/PublicationsCest.php @@ -31,7 +31,7 @@ public function __construct() { } /** - * + * Create a book citation */ public function testBookCitation(AcceptanceTester $I) { $this->values['term_name'] = $this->faker->words(3, TRUE); diff --git a/tests/codeception/acceptance/Contrib/XmlsitemapCest.php b/tests/codeception/acceptance/Contrib/XmlsitemapCest.php index a7fce599..85ec58bb 100644 --- a/tests/codeception/acceptance/Contrib/XmlsitemapCest.php +++ b/tests/codeception/acceptance/Contrib/XmlsitemapCest.php @@ -1,14 +1,14 @@ logInWithRole('administrator'); $I->amOnPage("/admin/config/search/xmlsitemap/rebuild"); $I->click('Save configuration'); diff --git a/tests/codeception/acceptance/Paragraphs/StanfordCardCest.php b/tests/codeception/acceptance/Paragraphs/StanfordCardCest.php index 444959cd..78b90007 100644 --- a/tests/codeception/acceptance/Paragraphs/StanfordCardCest.php +++ b/tests/codeception/acceptance/Paragraphs/StanfordCardCest.php @@ -24,7 +24,7 @@ public function __construct() { /** * Test a card with a button link. */ - public function testCardButtonLinkText(AcceptanceTester $I) { + public function testCardButtonLinkText(\AcceptanceTester $I) { $node = $this->createNodeWithLink($I); $I->amOnPage($node->toUrl()->toString()); $I->canSeeLink('It\'s a "test" link & title', 'http://google.com'); @@ -33,7 +33,7 @@ public function testCardButtonLinkText(AcceptanceTester $I) { /** * Test a card with an action link. */ - public function testCardActionLinkText(AcceptanceTester $I) { + public function testCardActionLinkText(\AcceptanceTester $I) { $node = $this->createNodeWithLink($I, 'action'); $I->amOnPage($node->toUrl()->toString()); $I->canSeeLink('It\'s a "test" link & title', 'http://google.com'); @@ -42,7 +42,7 @@ public function testCardActionLinkText(AcceptanceTester $I) { /** * Generate a node with a paragraph that contains a link. */ - protected function createNodeWithLink(AcceptanceTester $I, $link_type = 'button') { + protected function createNodeWithLink(\AcceptanceTester $I, $link_type = 'button') { /** @var \Drupal\paragraphs\ParagraphInterface $paragraph */ $paragraph = $I->createEntity([ 'type' => 'stanford_card', diff --git a/tests/codeception/acceptance/Paragraphs/StanfordStoriesCest.php b/tests/codeception/acceptance/Paragraphs/StanfordStoriesCest.php index 1a959964..7997206f 100644 --- a/tests/codeception/acceptance/Paragraphs/StanfordStoriesCest.php +++ b/tests/codeception/acceptance/Paragraphs/StanfordStoriesCest.php @@ -73,8 +73,6 @@ protected function createNodeWithParagraph(AcceptanceTester $I) { /** * Test the CTA List paragraph in the page. - * - * @group foobar */ public function testStories(AcceptanceTester $I) { $node = $this->createNodeWithParagraph($I); diff --git a/tests/codeception/functional/Contrib/ExtLinkCest.php b/tests/codeception/functional/Contrib/ExtLinkCest.php index b5ba0a6f..9a5d90a4 100644 --- a/tests/codeception/functional/Contrib/ExtLinkCest.php +++ b/tests/codeception/functional/Contrib/ExtLinkCest.php @@ -11,24 +11,18 @@ class ExtLinkCest { /** - * External link config settings. - * - * @var array + * @var Faker */ - protected $extLinkSettings = []; + protected $faker; /** * Start with a clean config page. - * Modify the extlink settings first. * * @param \AcceptanceTester $I * Tester. */ public function _before(FunctionalTester $I) { $this->_after($I); - $config = \Drupal::configFactory()->getEditable('extlink.settings'); - $this->extLinkSettings = $config->getRawData(); - $config->set('extlink_class', 'su-link su-link--external')->save(); } /** @@ -48,21 +42,8 @@ public function _after(FunctionalTester $I) { if ($config_page = ConfigPages::load('stanford_local_footer')) { $config_page->delete(); } - - $config_page = ConfigPages::create([ - 'type' => 'stanford_local_footer', - 'su_local_foot_use_loc' => TRUE, - 'su_local_foot_use_logo' => TRUE, - 'su_local_foot_loc_op' => 'a', - 'context' => 'a:0:{}', - ]); - $config_page->save(); - - if ($this->extLinkSettings) { - \Drupal::configFactory() - ->getEditable('extlink.settings') - ->setData($this->extLinkSettings) - ->save(); + if ($config_page = ConfigPages::load('stanford_basic_site_settings')) { + $config_page->delete(); } } @@ -111,14 +92,11 @@ public function testExtLink(FunctionalTester $I) { // Validate email links. $I->amOnPage('/'); - - // $mails = $I->grabMultiple('a.mailto svg.mailto'); - // $I->assertEquals(count($mails), 3); + $I->waitForElementVisible('a.mailto svg.mailto'); + $I->canSeeNumberOfElements('a.mailto svg.mailto', 3); // External Links in the page-content region. - // $pageExternals = $I->grabMultiple('#page-content a.su-link--external svg.su-link--external'); - // $I->assertEquals(count($pageExternals), 1); - + $I->canSeeNumberOfElements('#page-content a.su-link--external svg.su-link--external', 1); // External links in the local footer. $I->canSeeNumberOfElements('.su-local-footer__cell2 a.su-link--external svg.su-link--external', 4); }