This commit adds the method withStatus() to the newsletter factory
class so that it is possible to pass a variable with the status to the
factory. Before this change, it was necessary to class methods like
withActiveStatus() which make it impossible to create newsletters with
different status in the same call. This will be used in a subsequent
commit that is part of the same ticket to refactor
AuthorizedEmailsControllerTest.
[MAILPOET-4347]
The legend html was not escaped and was ignoring block settings coming
from the form editor.
This commit adds a new helper function for rendering legend that respects
applies block settings and also escapes the output.
[MAILPOET-4471]
Previously the reset was applied to .mailpoet_form class but manage subscription form
which also uses these form blocks doesn't have the class.
This commit moves the reset to an internal class that wraps every input and is used
also in the manage subscription page.
[MAILPOET-4471]
Added a 'type-message' for Parsley to display an error message when the input field is filled in incorrectly.
Also removed the global Parsley message to prevent it from overruling the 'required-message'.
[MAILPOET-4471]
Add styling for the fieldsets to avoid getting the default styling with the black border and unecessary padding and margin.
Applying default or theme styles would cause a BC break for existing forms.
[MAILPOET-4471]
Made checkboxes in a form accessible according to the WCAG-standards by adding a fieldset around them and adding a legend describing the fieldset's purpose
(name).
[MAILPOET-4471]
The default scheduled tasks should be setup so that there is no need to run cron and no background job is triggered in tests.
The previous setup was not covering case when MSS is set as active.
[MAILPOET-4274]
This was causing flakiness of acceptance test ReinstallFromScratchCest.php:reinstallFromScratch
and also potential issue for production.
In Activator::deactivate we remove MailPoet's DB tables. This takes some time.
In case there is another request during the deletion it may detect some tables are missing and trigger activation
and we end up creating MailPoet tables and removing them at the same time.
This commit adds locking to deactivate method so that any other attempt for activation ends up with an error.
[MAILPOET-4274]
We use action_scheduler_maximum_execution_time_likely_to_be_exceeded filter for reading remaining execution limit
tracked in the Action Scheduler runner.
Then we use the remaining limit minus safety margin for the daemon execution.
[MAILPOET-4274]
Clicking on Send button triggers ActionScheduler and it may take longer
then 2 seconds. In such case the test ends up reloading on send page instead of
newsletter listing page.
This commit fixes the issue by adding wait for newsletter listing.
[MAILPOET-4724]
This commit adds waiting for listing to finish loading before checking presence of
a customer email. We do it in other tests that work with listing, but it was missing
in this place.
[MAILPOET-4274]
The test was randomly failing when asserting subscriber state within subscriber edit form
and was also failing when attempting to click inactive subscribers filter in subscribers listing.
I found that both these issues were related to the web driver clicking too early when the form or
the list was still being rendered by React.
In this commit, I fixed those by adding some waiting on some elements and making sure the subscriber edit form is
already rendered.
The failures were flaky, and I could not identify what exactly caused these tests to start failing.
It is possible that some changes on the backend slightly affected API requests duration and the change in timing of rendering
was big enough to cause the flakiness.
[MAILPOET-4274]