Closed kraftner closed 7 years ago
@kraftner I'm a bit confused when you say that the test fail the other half of the time?
As far as I can see clicking the Media Library tab if you're already there doesn't change anything, you'll stay in the Media Library and the tests proceed as expected.
Are you experiencing different results or am I misreading the issue?
The reason the test failed for me was that when the tab is already active it doesn't only have the media-menu-item
class but also the active
class. And as you used
a[@class='media-menu-item' and text()='Media Library']
instead of
a[contains(@class, 'media-menu-item') and text()='Media Library']
it only matched if the class property was exactly media-menu-item
.
Fixed by #43
So #34 also changed the Nightwatch test for the Image Field.
https://github.com/Yoast/yoast-acf-analysis/blob/0307dcb051f56061b3815d70eabbdf73cc6ab3d2/tests/js/system/tests/general/content.js#L71-L75
The reasoning was
I was already wondering about this because the tests seemed to run fine until then for everyone. So now when I looked at it again - it now failed for me.
After some looking I realised that the media modal seems to remember which tab it had opened last. So this is why for me it opened up on another tab than it apparently did for @herregroen. The problem is that the change of the test didn't fix the issue, it just made it fail for the other half of the time. :grin: