Skip to content

Commit

Permalink
check fo successful saving
Browse files Browse the repository at this point in the history
  • Loading branch information
pookmish committed Oct 20, 2023
1 parent ec29d69 commit c5ce118
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 1 deletion.
1 change: 1 addition & 0 deletions tests/codeception/acceptance/Content/SearchBlockCest.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ public function testHideSearchBlock(AcceptanceTester $I) {
$I->amOnPage('/admin/config/system/basic-site-settings');
$I->uncheckOption('Hide Site Search');
$I->click('Save');
$I->canSee('Site Settings has been');
$I->amOnPage('/');
$I->seeElement('.su-site-search__input');
}
Expand Down
16 changes: 16 additions & 0 deletions tests/codeception/acceptance/SystemSiteConfigCest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');

$I->amOnPage('/user/logout');
$I->amOnPage('/');
Expand All @@ -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');
$I->amOnPage('/');
$I->cantSee('Foo Bar Site');
}
Expand Down Expand Up @@ -131,20 +133,34 @@ 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');

$I->amOnPage('/user/logout');
$I->amOnPage('/');
$I->canSee('UA-123456-12');
$I->logInWithRole('site_manager');
$I->amOnPage('/admin/config/system/basic-site-settings');
$I->fillField('Google Analytics Account', '');
$I->click('Save');
$I->canSee('Site Settings has been');
$I->amOnPage('/user/logout');
$I->amOnPage('/');
$I->cantSee('UA-12456-12');
Expand Down
2 changes: 1 addition & 1 deletion tests/codeception/functional/Contrib/ExtLinkCest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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('has been updated');
$I->canSee('Site Settings has been');

$I->amOnPage('/admin/config/system/local-footer');
$I->checkOption('#edit-su-footer-enabled-value');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,14 @@ 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->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');

$node_title = Factory::create()->text(20);

Expand Down

0 comments on commit c5ce118

Please sign in to comment.