Update testcase to be more concise [MAILPOET-3309]

[MAILPOET-3309]
This commit is contained in:
Veljko V
2020-11-18 11:43:40 +01:00
parent 2ddbf8f2af
commit 1c300ccdef
2 changed files with 5 additions and 11 deletions

View File

@@ -39,7 +39,6 @@ const SegmentSelectEdit = ({ attributes, setAttributes }) => {
return ( return (
<ParagraphEdit className={attributes.className}> <ParagraphEdit className={attributes.className}>
<div data-automation-id="mailpoet_list_selection_block">
<Settings <Settings
label={attributes.label} label={attributes.label}
onLabelChanged={(label) => (setAttributes({ label }))} onLabelChanged={(label) => (setAttributes({ label }))}
@@ -52,11 +51,10 @@ const SegmentSelectEdit = ({ attributes, setAttributes }) => {
]), ]),
})} })}
/> />
<span className="mailpoet_segment_label"> <span className="mailpoet_segment_label" data-automation-id="mailpoet_list_selection_block">
{attributes.label} {attributes.label}
</span> </span>
{renderValues()} {renderValues()}
</div>
</ParagraphEdit> </ParagraphEdit>
); );
}; };

View File

@@ -43,7 +43,10 @@ class FormEditorAddListSelectionCest {
// Reload the page and check that data were saved // Reload the page and check that data were saved
$i->reloadPage(); $i->reloadPage();
$this->checkListSelectionInForm($i); $i->waitForElement('[data-automation-id="mailpoet_list_selection_block"]');
$i->click('[data-automation-id="mailpoet_list_selection_block"]');
$i->seeInField('[data-automation-id="settings_first_name_label_input"]', 'Choose your list:');
$i->waitForText($secondSegmentName);
// Go back to the forms list and verify the attached list // Go back to the forms list and verify the attached list
$i->amOnMailpoetPage('Forms'); $i->amOnMailpoetPage('Forms');
@@ -51,11 +54,4 @@ class FormEditorAddListSelectionCest {
$i->waitForText('User choice:'); $i->waitForText('User choice:');
$i->waitForText($secondSegmentName); $i->waitForText($secondSegmentName);
} }
private function checkListSelectionInForm($i) {
$i->waitForElement('[data-automation-id="mailpoet_list_selection_block"]');
$i->click('[data-automation-id="mailpoet_list_selection_block"]');
$i->seeInField('[data-automation-id="settings_first_name_label_input"]', 'Choose your list:');
$i->seeOptionIsSelected('[data-automation-id="select_list_selections_list"]', $secondSegmentName);
}
} }