It was also necessary to add an if condition to check the type of a
variable before calling one of the methods of one of the documented
properties.
[MAILPOET-4363]
Doing this for consistency and to make it more clear that $sendingTask
contains an instance of \MailPoet\Tasks\Sending and not an instance of
\MailPoet\Models\SendingQueue.
[MAILPOET-4363]
Doing this for consistency and to better makr that this property
contains an instance of \MailPoet\Tasks\Sending and not an instance
of \MailPoet\Models\SendingQueue.
[MAILPOET-4363]
This commit changes the SendingQueueTest test class to always use a real
NewslettersRepository object instead of a mock object when instantiating
SendingQueue. This is necessary to prevent false errors in the tests.
Using a mock of the NewslettersRepository in this test class means that
all code inside SendingQueue that uses this repository could behave in
unpredictable ways. As it was happening with a few tests incorrectly
failing after dd6e02e2c16a3a0ef7ad2c12479917e33c312c77:
https://app.circleci.com/pipelines/github/mailpoet/mailpoet/11132/workflows/7b4df151-5a10-48f0-9711-dd590a764880/jobs/192389/tests#failed-test-0
In this case, the code was not changing the status of the newsletter
because findOneById() was returning an empty Newsletter entity instead
of the real Newsletter entity that corresponds to the object in the
database. And, thus, $newsletter->getType() was returning `null` instead
of `standard`.
This problem was already partially addressed in the commit below that
removed some of the usages of the NewslettersRepository mock:
5042cdd15e
[MAILPOET-4363]
This is an addition to previous changes in clicks.
I want to make sure the click on the All filter was successful.
It may give us a better insight into what failed in case the test fails in the future.
[MAILPOET-4556]
This test started failing after updating to newer Chrome.
It seems that the text can no longer be used in the array of attributes when
checking an element.
[MAILPOET-4556]
The previous fix with with multiple retries didn't help with the flakiness.
I'm trying to improve the click functionality by hovering on the specific table cell instead of the row
and adding wait for the action link being clickable.
I also tried to make our custom click method more robust.
[MAILPOET-4556]