diff --git a/.editorconfig b/.editorconfig index 4bbbf9c..a5ea69a 100644 --- a/.editorconfig +++ b/.editorconfig @@ -10,7 +10,7 @@ indent_style = space insert_final_newline = true trim_trailing_whitespace = true -[{*.yml,package.json,*.js,*.scss}] +[{*.yml,package.json,*.js,*.scss,*.feature}] indent_size = 2 # The indent size used in the package.json file cannot be changed: diff --git a/.travis.yml b/.travis.yml index abbe63d..3558479 100644 --- a/.travis.yml +++ b/.travis.yml @@ -29,6 +29,12 @@ jobs: - REQUIRE_INSTALLER="4.7.x-dev" - PHPUNIT_TEST=1 - PHPCS_TEST=1 + - php: 7.3 + env: + - DB=MYSQL + - REQUIRE_INSTALLER="4.7.x-dev" + - BEHAT_TEST=1 + - BEHAT_SUITE="userforms" - php: 7.4 env: - DB=MYSQL diff --git a/behat.yml b/behat.yml new file mode 100644 index 0000000..d4d0103 --- /dev/null +++ b/behat.yml @@ -0,0 +1,34 @@ +# Run asset-admin behat tests with this command (installed with silverstripe/installer) +# Note that asset-admin behat tests require CMS module +# ========================================================================= # +# vendor/bin/selenium-server-standalone -Dwebdriver.firefox.bin="/Applications/Firefox31.app/Contents/MacOS/firefox-bin" +# vendor/bin/serve --bootstrap-file vendor/silverstripe/cms/tests/behat/serve-bootstrap.php +# vendor/bin/behat @asset-admin +# ========================================================================= # +default: + suites: + userforms: + paths: + - "%paths.modules.userforms%/tests/behat/features" + contexts: + - SilverStripe\UserForms\Tests\Behat\Context\FeatureContext + - SilverStripe\Framework\Tests\Behaviour\CmsFormsContext + - SilverStripe\Framework\Tests\Behaviour\CmsUiContext + - SilverStripe\BehatExtension\Context\BasicContext + - SilverStripe\BehatExtension\Context\EmailContext + - SilverStripe\BehatExtension\Context\LoginContext + - + SilverStripe\UserForms\Tests\Behat\Context\FixtureContext: + - "%paths.modules.userforms%/tests/behat/files/" + extensions: + SilverStripe\BehatExtension\Extension: + bootstrap_file: vendor/silverstripe/cms/tests/behat/serve-bootstrap.php + screenshot_path: "%paths.base%/artifacts/screenshots" + retry_seconds: 4 # default is 2 + SilverStripe\BehatExtension\MinkExtension: + default_session: facebook_web_driver + javascript_session: facebook_web_driver + facebook_web_driver: + browser: chrome + wd_host: "http://127.0.0.1:9515" #chromedriver port + browser_name: chrome diff --git a/code/Control/UserDefinedFormController.php b/code/Control/UserDefinedFormController.php index 6ef9b7d..1e73ad6 100644 --- a/code/Control/UserDefinedFormController.php +++ b/code/Control/UserDefinedFormController.php @@ -548,6 +548,7 @@ JS $operations = implode(" {$conjunction} ", $rule['operations']); $target = $rule['targetFieldID']; $holder = $rule['holder']; + $isFormStep = strpos($target, 'EditableFormStep') !== false; $result .= <<