This repository has been archived by the owner on Jun 3, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create behat.yml file with individual suites for DKAN and Custom Tests (
#3) * Refactor behat configurations to use suites. REF CIVIC-4257 Changes to be committed: new file: ../config/tests/behat.custom.yml new file: ../config/tests/features/bootstrap/CustomContext.php new file: ../config/tests/features/custom.feature modified: ../dkan/test/behat.yml modified: behat.circleci.yml new file: behat.data_starter.yml modified: behat.docker.yml deleted: behat.yml deleted: features new file: features/bootstrap/custom new file: features/bootstrap/dkan renamed: ../config/tests/features/general.feature -> features/general.feature renamed: ../config/tests/features/resources.feature -> features/resources.feature * Use one script for all tests. REF CIVIC-4257 Now we've added some suite configurations for the different types of tests we can pass a suite parameter to run our tests using the same script. Changes to be committed: modified: ../../circle.yml modified: .scripts/behat-parse-params.rb modified: .scripts/circle-behat.rb new file: tests/behat-parse-params.rb * Update selenium google drivers. REF https://jira.govdelivery.com/browse/CIVIC-4312 Fixes bug. * Fix clamav tests. * Run fix-permissions after deploy. REF CIVIC-4312 Some recline tests are failing because public://general directory is not accessible. * Disable clamav completely. REF CIVIC-4212. * Add assets folder, enable clamav tests. * Fix artifacts folder and run one failing scenario. * Consolidate all files in one place. MinkExtesion is not suite aware so only knows the location of one files folder per profile. I could have done a PR to fix this in MinkExtension but instead I've decided that the easiest course of action is to use a convention of files/<test_suite> location and symlink back to appropriate sections as needed. TODO: maybe as a good deed I should consider doing a PR to make MinkExtension suite aware. * Cleaup cirle.yml * Update references to data_starter. * Use default file path. Since now by convention all folders are tests files folder are the same we can reference the in the same way. * Fix test.
- Loading branch information
Showing
28 changed files
with
185 additions
and
162 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# behat.yml | ||
default: | ||
suites: | ||
custom: | ||
paths: | ||
- %paths.base%/../config/tests/features | ||
contexts: | ||
- CustomContext | ||
- FeatureContext #Temporary overrides only! | ||
- Drupal\DrupalExtension\Context\MinkContext | ||
- Drupal\DrupalExtension\Context\DrupalContext | ||
- Drupal\DrupalExtension\Context\MessageContext |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<?php | ||
use Drupal\DrupalExtension\Context\RawDrupalContext; | ||
use Behat\Behat\Context\SnippetAcceptingContext; | ||
use Behat\Gherkin\Node\PyStringNode; | ||
use Behat\Gherkin\Node\TableNode; | ||
|
||
/** | ||
* Defines application features from the specific context. | ||
*/ | ||
class CustomContext extends RawDrupalContext implements SnippetAcceptingContext { | ||
|
||
/** | ||
* Initializes context. | ||
* | ||
* Every scenario gets its own context instance. | ||
* You can also pass arbitrary arguments to the | ||
* context constructor through behat.yml. | ||
*/ | ||
public function __construct() { | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
|
||
Feature: Custom Example | ||
|
||
|
||
################################################################## | ||
# ALL ( ANONYMOUS + AUTHENTICATED ) | ||
################################################################## | ||
|
||
@api | ||
Scenario: See custom about page | ||
Given I am on the homepage | ||
When I click "Datasets" | ||
Then I should see "Content Types" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
require "minitest/autorun" | ||
require "./.scripts/behat-parse-params.rb" | ||
|
||
class TestBehatParseParams < MiniTest::Unit::TestCase | ||
|
||
def test_behat_parse_suite | ||
# return dkan for dkan features | ||
expected = "dkan" | ||
actual = behat_parse_suite "/var/www/dkan/test/features/my.feature" | ||
assert_equal expected, actual | ||
|
||
expected = "dkan" | ||
actual = behat_parse_suite "dkan/test/features/my.feature" | ||
assert_equal expected, actual | ||
|
||
# returns custom for custom features. | ||
expected = "custom" | ||
actual = behat_parse_suite "/var/www/config/tests/features/my.feature" | ||
assert_equal expected, actual | ||
|
||
expected = "custom" | ||
actual = behat_parse_suite "config/tests/features/my.feature" | ||
assert_equal expected, actual | ||
|
||
# returns dkan_starter for dkan_starter features or by default | ||
expected = "dkan_starter" | ||
actual = behat_parse_suite "/var/www/tests/features/my.feature" | ||
assert_equal expected, actual | ||
|
||
expected = "dkan_starter" | ||
actual = behat_parse_suite "tests/features/my.feature" | ||
assert_equal expected, actual | ||
|
||
expected = "dkan_starter" | ||
actual = behat_parse_suite nil | ||
assert_equal expected, actual | ||
end | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
# this default param refers to a profile level configuration | ||
default: | ||
# autoloads can only be handled in behat using PS-0 at the profile level | ||
# otherwise use composer.json and PS-3 | ||
autoload: | ||
# PS-0 forces us to use a symlink inside of the profile level bootstrap | ||
- %paths.base%/features/bootstrap/custom | ||
- %paths.base%/features/bootstrap/dkan | ||
- %paths.base%/features/bootstrap | ||
suites: | ||
# this default parram is for a suite level configuration | ||
dkan_starter: | ||
paths: | ||
- %paths.base%/features | ||
contexts: | ||
- FeatureContext | ||
- Drupal\DrupalExtension\Context\MinkContext | ||
- Drupal\DrupalExtension\Context\DrupalContext | ||
- Drupal\DrupalExtension\Context\MessageContext | ||
- Drupal\DrupalExtension\Context\MarkupContext | ||
- Drupal\DKANExtension\Context\DKANContext | ||
- Drupal\DKANExtension\Context\MailContext | ||
- Drupal\DKANExtension\Context\PageContext | ||
- Drupal\DKANExtension\Context\GroupContext | ||
- Drupal\DKANExtension\Context\WorkflowContext | ||
- Drupal\DKANExtension\Context\DatasetContext | ||
- Drupal\DKANExtension\Context\DataDashboardContext | ||
- Drupal\DKANExtension\Context\ResourceContext | ||
- Drupal\DKANExtension\Context\DatastoreContext | ||
- Drupal\DKANExtension\Context\SearchAPIContext: | ||
search_forms: | ||
default: | ||
form_css: '#dkan-sitewide-dataset-search-form' | ||
form_field: 'edit-search' | ||
form_button: 'edit-submit' | ||
results_css: '.view-dkan-datasets' | ||
result_item_css: '.views-row' | ||
- Devinci\DevinciExtension\Context\JavascriptContext: | ||
maximum_wait: 30 | ||
dkan: | ||
# handle dkan path here to maintain backwards compatibility | ||
paths: | ||
- %paths.base%/../dkan/test/features |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.