Skip to content

Commit

Permalink
OPENEUROPA-1500: Backup analytics configs for behat and fix test.
Browse files Browse the repository at this point in the history
  • Loading branch information
nagyad committed Jan 10, 2019
1 parent 64565e7 commit e615e06
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
13 changes: 13 additions & 0 deletions tests/Behat/WebtoolsConfigContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,4 +64,17 @@ public function backupLacoConfigs() {
}
}

/**
* Backup configs that need to be reverted in AfterScenario by ConfigContext.
*
* @BeforeScenario @BackupAnalyticsConfigs
*/
public function backupAnalyticsConfigs() {
$name = 'oe_webtools_analytics.settings';
$configs = $this->getDriver()->getCore()->configGet($name);
foreach ($configs as $key => $value) {
$this->configContext->setConfig($name, $key, $value);
}
}

}
3 changes: 2 additions & 1 deletion tests/features/analytics.feature
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@ Feature: Webtools Analytics
I need to be able to configure the settings

Background:
Given I am logged in as a user with the "administer site configuration" permission
Given I am logged in as a user with the "administer webtools analytics" permission

@BackupAnalyticsConfigs
Scenario: Create Webtools Analytics settings
Given I am on "admin/config/system/oe_webtools_analytics"
Then I should see "Webtools Analytics settings"
Expand Down

0 comments on commit e615e06

Please sign in to comment.