Among other things, this is a regression test for
https://bugzilla.wikimedia.org/show_bug.cgi?id=54443

We merged this test today:  https://gerrit.wikimedia.org/r/#/c/87620

The interesting part is in the steps file:

When(/^I send right arrow times (\d+)$/) do |number|
  on(VisualEditorPage) do |page|
    page.content_element.when_present.fire_event('onfocus')
    number.to_i.times do
      page.content_element.send_keys :arrow_right
      page.content_element.fire_event('onblur') #gerrit 86800/86801
    end
  end

Before we do anything, we have to fire an 'onfocus' event for the
contentEditable area of VE, in order for the Save page button to become
enabled.

Then every time we send an arrow_right command we also have to send a
corresponding 'onblur' event. (Or at least we do when we move the cursor
onto an "object".)

If the test does not send the onblur event, then upon encountering an
"object" like a reference or a link or a transclusion, the cursor
repositions itself at the beginning of the contentEditable field. It's fun
to watch, but it's not a good test. :-)

If you investigate those 86800/86801 commits in gerrit, you can see how VE
keeps track of where the cursor is.
_______________________________________________
QA mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/qa

Reply via email to