Talk:Automatic cross-language screenshots

Jump to navigation Jump to search


Hello. If you plan to use it for any MediaWiki-related thing, please create a wiki-specific category or tag on your blog and then ask addition of it to m:Planet Wikimedia. --Nemo 08:49, 11 June 2014 (UTC)[]

So, how do we capture screenshots?[edit]

It looks like the GSOC is finished and the feature merged (yay!), so... how?

VisualEditor browser tests have:

Then(/^I should see pull-down menu containing Page Settings$/) do
   on(VisualEditorPage).page_settings_element.when_present.should be_visible
   step "I take screenshot of Visual Editor insert menu"


Then(/^I take screenshot of Visual Editor insert menu$/) do
  capture_screenshot("#{}-#{ENV['LANGUAGE_SCREENSHOT_CODE']}.png", [@current_page.tool
s_menu_element, @current_page.page_option_menu_element])

where is capture_screenshot() documented?

Ping User:Vikassy, User:Amire80 :) --Elitre (WMF) (talk) 15:23, 3 February 2015 (UTC)[]
It's not documented very well, I admit, though not very complicated either. The code is at modules/ve-mw/tests/browser/features/support/language_screenshot.rb. I made a few patches last week that make this function clearer, and I'm patiently waiting for Željko to merge them. After that I plan to do some further improvements.
The longer-term plan is to move all the generic screenshot-taking functionality into an independent Ruby gem that can be used in any extension (or maybe even any web application). I can't commit to a date, because it's a little pet project to which Željko and I dedicate no more than a couple of hours a week, and sometimes not even that. If you can find anybody who knows Ruby and can help us accomplish this, it will be very useful to us all :) --Amir E. Aharoni (talk) 18:30, 3 February 2015 (UTC)[]
Thanks a lot for replying to User:SPage (WMF)'s question. How can we update the main page for this project so that results, current status and an appeal to a Ruby expert are highlighted? --Elitre (WMF) (talk) 09:50, 4 February 2015 (UTC)[]
Update: Zeljko and I managed to refactor the screenshot functionality into a gem, so now it's reusable. It was easier than I thought. See this patch in Gerrit. To use it, the extension must be set up to run Selenium/Cucumber browser tests like VisualEditor is, and to use the 'screenshot' gem.
We still have to refactor the uploading functionality - see this Phab task. --Amir E. Aharoni (talk) 15:11, 17 February 2015 (UTC)[]
... Aaaand, we did that, too! Thanks a lot to User:ZFilipin (WMF).
User:AKoval (WMF), User:SPage (WMF), User:Elitre (WMF) - this should now be usable for any MediaWiki feature, whether in core or extensions. The following files in the mediawiki/extensions/VisualEditor repo provide examples:
  • modules/ve-mw/tests/browser/features/language_screenshot.feature (the Cucumber scenarios)
  • modules/ve-mw/tests/browser/features/step_definitions/language_screenshot_steps.feature (the implementation of the Cucumber steps)
  • modules/ve-mw/tests/browser/upload.rb (just two lines, and maybe we can get rid of them, too)
  • Some little things in modules/ve-mw/tests/browser/features/support/env.rb and modules/ve-mw/tests/browser/features/support/hooks.rb (now that I think of it, I'm not even sure that they are needed).
... And that's really it!
I hope to find time to do this for the ContentTranslation extension some time soon, so there will be even more examples.
I'm available for questions. Thanks for your interest! --Amir E. Aharoni (talk) 13:13, 19 February 2015 (UTC)[]
My question was "How can we update the main page for this project so that results, current status and an appeal to a Ruby expert are highlighted?" Do you think you or Zeljko could mentor someone else in GSOC this year to make this move forward? Hope this makes sense: thank you for everything. --Elitre (WMF) (talk) 13:26, 19 February 2015 (UTC)[]
Just doing the same thing that was done for VE for a new extension shouldn't take a whole GSoC project. For somebody who starts from scratch and has to learn everything it shouldn't take more than three weeks (full time). For somebody experienced - even less.
Doing it for several extensions - e.g. Flow, Echo, Translate, Wikidata, MobileFrontend and maybe some core features - sounds more like a fuller GSoC project. (I hope to have ContentTranslation ready already before the summer :) )
An even better GSoC project would be to make the whole process smarter and more automated. For example, Zeljko had an idea to fully automate screenshot taking so that a screenshot would be shown for every qqq documentation message in translatewiki. --Amir E. Aharoni (talk) 13:36, 19 February 2015 (UTC)[]