Skip to content
Snippets Groups Projects
Commit abac0e99 authored by Lily Yan's avatar Lily Yan Committed by Igor Biki
Browse files

ISTWCMS-4763 Test Default background colour field

parent 797a14de
No related branches found
No related tags found
3 merge requests!433ISTWCMS-6296 Create test for all event dates test cases,!136Istwcms 4725 ebremner config sync,!128ISTWCMS-4763 Test Default background colour field
...@@ -1326,6 +1326,17 @@ class UwWcmsBasicTest extends BrowserTestBase { ...@@ -1326,6 +1326,17 @@ class UwWcmsBasicTest extends BrowserTestBase {
$this->clickLink('Facts and figures'); $this->clickLink('Facts and figures');
// The top-level remove button doesn't exist. // The top-level remove button doesn't exist.
$this->assertNoFieldByName('settings_block_form_field_uw_ff_fact_figure_0_remove'); $this->assertNoFieldByName('settings_block_form_field_uw_ff_fact_figure_0_remove');
// Check 'Default background colour' field help text.
$this->assertSession()->pageTextContains('When gold is selected, the default colour will always be black.');
// Check 'Default background colour' field default value.
$this->assertFieldByXPath('//option[@value="grey" and @selected="selected"]', NULL, 'Grey is selected.');
$this->assertFieldByName('settings[block_form][field_uw_ff_fact_figure][0][subform][field_uw_ff_def_color]');
// Select 'gold', then 'Default background colour' field is gone.
$this->getSession()->getPage()->selectFieldOption('settings[block_form][field_uw_ff_fact_figure][0][subform][field_uw_ff_dbg_color]', 'gold');
$this->assertTrue($this->assertSession()->optionExists('Default background colour', 'gold')->isSelected());
// Select 'black', then 'Default background colour' field shows.
$this->getSession()->getPage()->selectFieldOption('settings[block_form][field_uw_ff_fact_figure][0][subform][field_uw_ff_dbg_color]', 'black');
$this->assertTrue($this->assertSession()->optionExists('Default background colour', 'black')->isSelected());
// The default color is 'Default[uWaterloo]' and not have "none" option. // The default color is 'Default[uWaterloo]' and not have "none" option.
$options = $this->getOptions('settings[block_form][field_uw_ff_fact_figure][0][subform][field_uw_ff_def_color]'); $options = $this->getOptions('settings[block_form][field_uw_ff_fact_figure][0][subform][field_uw_ff_def_color]');
foreach ($options as $option) { foreach ($options as $option) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment