Acceptance test

[MAILPOET-2452]
This commit is contained in:
Pavel Dohnal
2019-12-05 09:16:21 +01:00
committed by Rostislav Wolný
parent 1f5666ccd1
commit 90d9ea8f1e
2 changed files with 42 additions and 1 deletions

View File

@@ -0,0 +1,42 @@
<?php
namespace MailPoet\Test\Acceptance;
use MailPoet\Features\FeaturesController;
use MailPoet\Test\DataFactories\Features;
use MailPoet\Test\DataFactories\Form;
use MailPoet\Test\DataFactories\Segment;
class FormEditorAddNamesCest {
function addNamesToAForm(\AcceptanceTester $I) {
$segment_factory = new Segment();
$segment_name = 'Fancy List';
$segment = $segment_factory->withName($segment_name)->create();
$form_name = 'My fancy form';
$form = new Form();
$form->withName($form_name)->withSegments([$segment])->create();
$features = new Features();
$features->withFeatureEnabled(FeaturesController::NEW_FORM_EDITOR);
$I->wantTo('Add first and last name to the editor');
$I->login();
$I->amOnMailPoetPage('Forms');
$I->waitForText($form_name);
$I->clickItemRowActionByItemName($form_name, 'Edit');
$I->waitForElement('[data-automation-id="form_title_input"]');
$I->click('.block-list-appender button');// CLICK the big button that adds new blocks
$I->waitForElement('.editor-inserter__results .components-panel__body-toggle');
$I->click('.editor-inserter__results .components-panel__body-toggle'); // toggle fields
$I->click('.editor-block-list-item-mailpoet-form-first-name-input'); // add first name block to the editor
$I->click('.block-list-appender button');// CLICK the big button that adds new blocks
$I->waitForElement('.editor-inserter__results .components-panel__body-toggle');
$I->click('.editor-inserter__results div:nth-child(2) .components-panel__body-toggle'); // toggle fields, get the second field, first one is now "Most Used"
$I->click('.editor-block-list-item-mailpoet-form-last-name-input'); // add last name block to the editor
$I->click('[data-automation-id="form_save_button"]');
$I->waitForText('Form saved', 10, '.automation-dismissible-notices');
$I->seeNoJSErrors();
}
}

View File

@@ -3,7 +3,6 @@
namespace MailPoet\Test\Acceptance;
class FormsCreationCest {
function createForm(\AcceptanceTester $I) {
$I->wantTo('Create a new Form');