Page MenuHomePhabricator

"page should be previewable" core selenium test fails if CodeMirror is enabled
Open, LowPublic

Description

Seen at r703632:

[0-0] AssertionError [ERR_ASSERTION] in "Page should be previewable"
AssertionError [ERR_ASSERTION]: Input A expected to strictly equal input B:
+ expected - actual

- ''
+ 'beforeEach-content-0.6710607933501649-Iñtërnâtiônàlizætiøn'
    at Context.<anonymous> (/workspace/src/tests/selenium/specs/page.js:31:10)

I've tested this locally a lot of times, but kept getting inconsistent results. I managed to get 3 of the 4 assertions in that test to fail in different runs, without changing anything. This leads me to suspect a timing issue.

Then the screenshot for the selenium run also show the VE welcome dialog being visible on the preview page. I think this might be responsible for some failures (e.g. elements not visible). Also, locally I have to run window.localStorage.removeItem('ve-beta-welcome-dialog') before running the tests to get a failure, otherwise it will pass most of the times (but not always!). OTOH, I don't see how enabling CodeMirror can have the effect of making the VE dialog persistent.

Last but not least, I think at least one assertion can never succeed (unless, maybe, it runs before CodeMirror does its thing):

assert( EditPage.content.isDisplayed(), 'editor is still present' );

this checks the content of $('#wpTextbox1'), but CM hides it via CSS and adds a different div with syntax highlighting.

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript

Last but not least, I think at least one assertion can never succeed …

This can be disregarded now since we won't be enabling CodeMirror by default. More at T286270#7211233