Commit Graph

15690 Commits

Author SHA1 Message Date
Rostislav Wolny
ddb63bfa9f Setup integration test to run without action scheduler cron
Action Scheduler was running in background causing random test failures.
[MAILPOET-4274]
2022-08-03 10:36:57 +02:00
Rostislav Wolny
b525f9f876 Deactivate action scheduler actions when another method is active
[MAILPOET-4274]
2022-08-03 10:36:57 +02:00
Rostislav Wolny
138354cfd8 Improve stability of SubscribeOnRegistrationPage acceptance test
This commit adds waiting for confirmation that settings were really saved before continuing with next steps.
[MAILPOET-4274]
2022-08-03 10:36:57 +02:00
Rostislav Wolny
95ed809db0 Improve stability of WooCommerceSetupPageCest acceptance test
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]
2022-08-03 10:36:57 +02:00
Rostislav Wolny
28f497ec61 Improve ManageSubscribers acceptance test stability
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]
2022-08-03 10:36:57 +02:00
Rostislav Wolny
272e875643 Deactivate action scheduler recurring actions on plugin deactivation
We need to cleanup these recurring actions otherwise they would be rescheduled indefinitely.
[MAILPOET-4274]
2022-08-03 10:36:57 +02:00
Rostislav Wolny
e3fbf2421d Move action scheduler initialization to Initializer as one of first actions
[MAILPOET-4274]
2022-08-03 10:36:57 +02:00
Rostislav Wolny
791a0631b5 Add Acceptance test helper for triggering background job
It may take up to one minute for Action Scheduler to start.
This commit adds a helper method that sets WP Cron trigger for action scheduler and
MailPoet action in Action Scheduler to run immediately and triggers WP Cron
that triggers action scheduler by page reload.

[MAILPOET-4274]
2022-08-03 10:36:57 +02:00
Rostislav Wolny
2c2c9dba6a Make sure WP Cron is not locked when acceptance tests start
Action Scheduler uses WP Cron as trigger.
When it is initially locked it takes more time for Action Scheduler to start
and some tests that rely on background job fail with timeout.
[MAILPOET-4274]
2022-08-03 10:36:57 +02:00
Rostislav Wolny
eedc18bb7f Trigger action scheduler runner immediately when starting sending
When users click send email in UI, they need to wait a minute or more to
see some emails started going out.

This commit adds additional trigger into sending queue API.
If emails is set to send it triggers Action Scheduler immediately.
Users will get immediate feedback that emails are sending.
[MAILPOET-4274]
2022-08-03 10:36:57 +02:00
Rostislav Wolny
5deea8a724 Fix CronWorkerRunner integration test
CronWorkerRunner sets internal timer in its constructor function.
This works fine in classic web page request. But in integration tests
in might be created and cached in DI, so for some late running tests
it throws timeout exception.
This commit fixes the issue by using fresh instance of CronWorkerRunner
instead of "cached" one from DI container.

[MAILPOET-4274]
2022-08-03 10:36:57 +02:00
Rostislav Wolny
b979c76445 Switch acceptance tests to use Action Scheduler instead of Wordpress visitors
[MAILPOET-4274]
2022-08-03 10:36:57 +02:00
Rostislav Wolny
b02aa1e1a6 Add Action scheduler status into on help page
[MAILPOET-4274]
2022-08-03 10:36:57 +02:00
Rostislav Wolny
86562e99b9 Trigger additional executor only when MailPoet daemon runs
In afterProcess callback we trigger a new runner when there are still some scheduled tasks
to process. Before this change we did this for every action scheduler run and it was causing that
we triggered more HTTP requests than needed.
[MAILPOET-4274]
2022-08-03 10:36:57 +02:00
Rostislav Wolny
f59945d483 Add wrapper class for action scheduler in cron
The class add GROUP ID so that all MailPoet cron tasks are stored under the same group.
[MAILPOET-4274]
2022-08-03 10:36:57 +02:00
Rostislav Wolny
7e5d632148 Make Action Scheduler the default method for MailPoet background job
[MAILPOET-4274]
2022-08-03 10:36:57 +02:00
Rostislav Wolny
8d05da2c37 Add Action Scheduler as WordPress cron into advanced settings
[MAILPOET-4274]
2022-08-03 10:36:57 +02:00
Rostislav Wolny
2b44684c38 Add action scheduler method to cron trigger
[MAILPOET-4274]
2022-08-03 10:36:57 +02:00
Rostislav Wolny
ccfdd229ec Add action scheduler daemon runner
This commit adds a class that handles continuous processing of MailPoet cron daemon
using Action Scheduler's recurring actions.
[MAILPOET-4274]
2022-08-03 10:36:57 +02:00
Sam Najian
0ac617abf7 Check guzzlehttp/guzzle version before attempting to patch
[PREMIUM-199]
2022-08-02 15:01:42 +02:00
Sam Najian
b2a5f47da7 Override http_build_query for in guzzle package
The http_build_query used in guzzle/src/Client.php
is not compatible with PHPv8.0+ since it accepts null as
second parameter while in newer versions of PHP this is
either deprecated or removed

[PREMIUM-199]
2022-08-02 15:01:42 +02:00
David Remer
c9a464c4c9 Make 'HOURS' the default when creating a delay step
[MAILPOET-4418]
2022-08-02 14:39:33 +02:00
David Remer
ace82c9abb Change delayType signature.
Adds subtitle callback and removes singular and plural properties.

[MAILPOET-4418]
2022-08-02 14:39:33 +02:00
David Remer
c6164ad88f Center icon in ColoredIcon vertically
[MAILPOET-4418]
2022-08-02 14:39:33 +02:00
David Remer
78460bd248 Use ComponentType instead of JSX.Element for icon, use @wordpress/component icons
[MAILPOET-4418]
2022-08-02 14:39:33 +02:00
David Remer
39ca2343b8 Simplify the DOM and CSS of ColorIcon component
[MAILPOET-4418]
2022-08-02 14:39:33 +02:00
David Remer
1fbf29b7f6 Resize ColoredIcon
[MAILPOET-4418]
2022-08-02 14:39:33 +02:00
David Remer
7fe4104af8 Use email icon without "padding"
[MAILPOET-4418]
2022-08-02 14:39:33 +02:00
David Remer
3e0b5b0f76 Change delay icon
[MAILPOET-4418]
2022-08-02 14:39:33 +02:00
David Remer
7f6159501a Extend ColorIcon to enable a distinct background color
[MAILPOET-4418]
2022-08-02 14:39:33 +02:00
David Remer
81b1c70a28 Use mailpoet-automation prefix in class names
[MAILPOET-4418]
2022-08-02 14:39:33 +02:00
David Remer
9a7e99602a Make type of delay field numeric
[MAILPOET-4418]
2022-08-02 14:39:33 +02:00
David Remer
7f428c0c7a Change variable name from type to key
[MAILPOET-4418]
2022-08-02 14:39:33 +02:00
David Remer
ec58c24228 Allow for JSX.Element in subtitle
[MAILPOET-4418]
2022-08-02 14:39:33 +02:00
David Remer
e8d3edcc23 Remove unused icons
[MAILPOET-4418]
2022-08-02 14:39:33 +02:00
David Remer
03bf653432 Enable a colored icon
This commit introduces a <ColoredIcon /> component with which you can define the
color and background of the circle behind the colored icon.

The SVG's have been adjusted and the StepType has now a color attribute, with
which the color can be defined.

[MAILPOET-4418]
2022-08-02 14:39:33 +02:00
David Remer
83c7f7bc7f Update configuration arguments and invalidate 2 years of waiting
[MAILPOET-4418]
2022-08-02 14:39:33 +02:00
David Remer
a9a35333c4 Add delay step settings
[MAILPOET-4418]
2022-08-02 14:39:33 +02:00
David Remer
a7bda3f465 Make step subtitle dynamic
This commit enables us to render the subtitle of a step
dynamically depending on a given step configuration. This enables us to render
a subtitle like 'Wait for 4 days'.

[MAILPOET-4418]
2022-08-02 14:39:33 +02:00
David Remer
e0f6751538 Introduce getStepType selector
[MAILPOET-4418]
2022-08-02 14:39:33 +02:00
Sam Najian
db112dc03f Release 3.93.1 2022-08-02 14:35:08 +02:00
Jan Lysý
e706110230 Fix new subscriber notifications
[MAILPOET-4518]
2022-08-02 12:57:05 +02:00
Sam Najian
b2718940df Remove models from SegmentsExporterTest
[MAILPOET-4348]
2022-08-01 14:18:59 +02:00
Sam Najian
3ef32787cc Remove models from NewslettersExporterTest
[MAILPOET-4348]
2022-08-01 14:18:59 +02:00
Sam Najian
5b0e7128c6 Remove usages of StatisticsNewsletters in newsletter exporter
[MAILPOET-4348]
2022-08-01 14:18:59 +02:00
Sam Najian
31aa18868b Remove traces of older models in PersonalDataExports namespace
[MAILPOET-4348]
2022-08-01 14:18:59 +02:00
Sam Najian
10d4eb5d7f Remove old models from SegmentsExporter
[MAILPOET-4348]
2022-08-01 14:18:59 +02:00
Sam Najian
6b12255bb8 Move PersonalDataExporters to DI
[MAILPOET-4348]
2022-08-01 14:18:59 +02:00
Jan Lysý
84a6401590 Remove email signup step from Welcome Wizard
[MAILPOET-4497]
2022-08-01 13:44:44 +02:00
Jan Lysý
381565fc1f Improve integration ManageTest class
[MAILPOET-4350]
2022-08-01 13:28:57 +02:00