Zfilipin has uploaded a new change for review. https://gerrit.wikimedia.org/r/92875
Change subject: WIP Move UploadWizard tests to UploadWizard repository ...................................................................... WIP Move UploadWizard tests to UploadWizard repository Bug: 56419 Change-Id: Ie6f9e1c8c963c8ae9b54e4434fb3bec90e9064da --- M features/step_definitions/login_steps.rb D features/step_definitions/upload_wizard_steps.rb D features/support/pages/upload_wizard_page.rb D features/upload_wizard.feature 4 files changed, 3 insertions(+), 228 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/qa/browsertests refs/changes/75/92875/1 diff --git a/features/step_definitions/login_steps.rb b/features/step_definitions/login_steps.rb index 91e5e63..793ee5f 100644 --- a/features/step_definitions/login_steps.rb +++ b/features/step_definitions/login_steps.rb @@ -12,6 +12,9 @@ Given(/^I am at Log in page$/) do visit LoginPage end +Given(/^I am logged in$/) do + visit(LoginPage).login_with(ENV['MEDIAWIKI_USER'], ENV['MEDIAWIKI_PASSWORD']) +end When(/^I log in with incorrect password$/) do on(LoginPage).login_with(ENV['MEDIAWIKI_USER'], 'incorrect password') diff --git a/features/step_definitions/upload_wizard_steps.rb b/features/step_definitions/upload_wizard_steps.rb deleted file mode 100644 index df8d2a9..0000000 --- a/features/step_definitions/upload_wizard_steps.rb +++ /dev/null @@ -1,94 +0,0 @@ -# -# This file is subject to the license terms in the LICENSE file found in the -# qa-browsertests top-level directory and at -# https://git.wikimedia.org/blob/qa%2Fbrowsertests/HEAD/LICENSE. No part of -# qa-browsertests, including this file, may be copied, modified, propagated, or -# distributed except according to the terms contained in the LICENSE file. -# -# Copyright 2012-2013 by the Mediawiki developers. See the CREDITS file in the -# qa-browsertests top-level directory and at -# https://git.wikimedia.org/blob/qa%2Fbrowsertests/HEAD/CREDITS -# -Given(/^I am logged in$/) do - visit(LoginPage).login_with(ENV['MEDIAWIKI_USER'], ENV['MEDIAWIKI_PASSWORD']) -end - -When(/^click button Continue$/) do - on(UploadPage).continue_element.when_present.click -end -When(/^I click Next button$/) do - on(UploadWizardPage).next_element.when_present.click -end -When(/^I click Next button at Describe page$/) do - sleep 1 # todo # I can not figure out at the moment how to make this work without using sleep - on(DescribePage).next_element.click -end -When(/^I click Next button at Learn page$/) do - on(LearnPage).next_element.when_present(15).click -end -When(/^I click Next button at Release rights page$/) do - on(ReleaseRightsPage).next_element.when_present.click -end -When(/^I click This file is my own work$/) do - on(ReleaseRightsPage).select_my_own_work -end -When(/^I enter category$/) do - on(DescribePage).category = 'Test' -end -When(/^I enter description$/) do - on(DescribePage).description = 'description' -end -When(/^I enter title$/) do - on(DescribePage).title = "Title #{Random.new.rand}" -end -When(/^I navigate to Upload Wizard$/) do - visit UploadWizardPage -end -When(/^thumbnail should be visible$/) do - on(ReleaseRightsPage).thumbnail_element.when_present.should be_visible -end -When(/^upload file (.+)$/) do |file_name| - require 'tempfile' - path = "#{Dir.tmpdir}/#{file_name}" - - require 'chunky_png' - ChunkyPNG::Image.new(Random.new.rand(255), Random.new.rand(255), Random.new.rand(255)).save path - - if @browser.driver.browser == :chrome - @browser.execute_script 'document.getElementsByName("file")[0].removeAttribute("class");' - @browser.execute_script 'document.getElementsByName("file")[0].removeAttribute("style");' - end - - on(UploadPage).select_file = path -end -Then(/^(.+) checkbox should be there$/) do |_| - on(LearnPage).skip_element.when_present.should be_visible -end -Then(/^Describe page should open$/) do - @browser.url.should match /Special:UploadWizard/ -end -Then(/^Learn page should appear$/) do - @browser.url.should match /Special:UploadWizard/ -end -Then(/^Release rights page should open$/) do - @browser.url.should match /Special:UploadWizard/ -end -Then(/^Select a media file to donate button should be there$/) do - sleep 1 - on(UploadPage).select_file_element.when_present.should be_visible -end -Then(/^title text field should be there$/) do - on(DescribePage).title_element.when_present.should be_visible -end -Then(/^Upload more files button should be there$/) do - on(UsePage) do |page| - page.upload_more_files_element.when_present - page.upload_more_files_element.should be_visible - end -end -Then(/^Upload page should appear$/) do - @browser.url.should match /Special:UploadWizard/ -end -Then(/^Use page should open$/) do - @browser.url.should match /Special:UploadWizard/ -end diff --git a/features/support/pages/upload_wizard_page.rb b/features/support/pages/upload_wizard_page.rb deleted file mode 100644 index 7fc0d3a..0000000 --- a/features/support/pages/upload_wizard_page.rb +++ /dev/null @@ -1,77 +0,0 @@ -# -# This file is subject to the license terms in the LICENSE file found in the -# qa-browsertests top-level directory and at -# https://git.wikimedia.org/blob/qa%2Fbrowsertests/HEAD/LICENSE. No part of -# qa-browsertests, including this file, may be copied, modified, propagated, or -# distributed except according to the terms contained in the LICENSE file. -# -# Copyright 2012-2013 by the Mediawiki developers. See the CREDITS file in the -# qa-browsertests top-level directory and at -# https://git.wikimedia.org/blob/qa%2Fbrowsertests/HEAD/CREDITS -# -class UploadWizardPage - include PageObject - - include URL - def self.url - URL.url('Special:UploadWizard') - end - page_url url - - text_field(:add_categories, id: 'categories0') - text_field(:altitude, id: 'location-altitude0') - text_field(:author, name: 'author2') - textarea(:author, name: 'author') # todo # fix duplicate - radio(:believe_free, id: 'license2_13') - a(:categories, text: 'Add categories and more information ...') - a(:cc, text: 'The copyright holder published this work with the right Creative Commons license') - radio(:cc_cc, id: 'license1_2') - radio(:cc_waiver, id: 'license2_4') - radio(:cca2, id: 'license2_3') - radio(:cca3, id: 'license1_1') - radio(:cca3_2, id: 'license2_2') - radio(:cca_2_2, id: 'license2_6') - radio(:cca_sa, id: 'license1_0') - radio(:cca_sa2, id: 'license2_1') - radio(:cca_sa20, id: 'license2_5') - radio(:cca_sa3, id: 'license2_0') - button(:continue_button, xpath: '//div[2]/div[2]/div/button') - # todo # replace xpath # button(:continue_button, class: 'mwe-upwiz-button-next ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only') - text_field(:date_created, id: 'dateInput0') - textarea(:description_field, name: 'description1') - a(:different_license, text: 'Use a different license') - a(:expired, text: 'The copyright has definitely expired in the USA') - a(:flickr, text: 'The copyright holder published their photo or video on Flickr with the right license') - a(:found_it, text: "I found it on the Internet -- I'm not sure") - radio(:free_form, id: 'license2_12') - textarea(:free_lic, id: 'license2_12_custom') - select(:language, name: 'lang') - text_field(:latitude, id: 'location-latitude0') - # todo # check if legal_* links actually go the right place https://bugzilla.wikimedia.org/show_bug.cgi?id=35702 - a(:legal_code_cc_sa25, href: 'https://creativecommons.org/licenses/by-sa/2.5/') - a(:legal_code_cc_sa3, href: 'https://creativecommons.org/licenses/by-sa/3.0/') - a(:legal_code_cc_waiver, href: 'https://creativecommons.org/publicdomain/zero/1.0/') - a(:legal_code_cca25, href: 'https://creativecommons.org/licenses/by/2.5/') - a(:legal_code_cca3, href: 'https://creativecommons.org/licenses/by/3.0/') - a(:legal_code_recommended, href: 'https://creativecommons.org/licenses/by-sa/3.0/') - a(:logged_in, text: 'logged in') - text_field(:longitude, id: 'location-longitude0') - radio(:nasa, id: 'license2_11') - span(:next, text: 'Next') - button(:next_button, xpath: '//div[4]/button') - a(:not_mentioned, text: 'Another reason not mentioned above') - textarea(:other_information, id: 'otherInformation0') - radio(:own_work_button, id: 'deedChooser1-ownwork') - radio(:pre_1923, id: 'license2_8') - a(:recommended_license, text: 'Use the recommended license') - radio(:repro, id: 'license2_9') - file_field(:select_file, name: 'file') - checkbox(:skip_radio, id: 'mwe-upwiz-skip') - textarea(:source, name: 'source') - radio(:third_party_button, id: 'deedChooser1-thirdparty') - text_field(:title_field, id: 'title0') - div(:tutorial_map, id: 'mwe-upwiz-tutorial') - a(:us_govt, text: 'This work was made by the United States government') - radio(:us_govt_2, id: 'license2_7') - radio(:us_govt_3, id: 'license2_10') -end diff --git a/features/upload_wizard.feature b/features/upload_wizard.feature deleted file mode 100644 index 9361a48..0000000 --- a/features/upload_wizard.feature +++ /dev/null @@ -1,57 +0,0 @@ -# -# This file is subject to the license terms in the LICENSE file found in the -# qa-browsertests top-level directory and at -# https://git.wikimedia.org/blob/qa%2Fbrowsertests/HEAD/LICENSE. No part of -# qa-browsertests, including this file, may be copied, modified, propagated, or -# distributed except according to the terms contained in the LICENSE file. -# -# Copyright 2012-2013 by the Mediawiki developers. See the CREDITS file in the -# qa-browsertests top-level directory and at -# https://git.wikimedia.org/blob/qa%2Fbrowsertests/HEAD/CREDITS -# [email protected] @ie6-bug @ie7-bug @ie8-bug @login @test2.wikipedia.org -Feature: UploadWizard - - Background: - Given I am logged in - When I navigate to Upload Wizard - - Scenario: Navigate to Learn page - Then Learn page should appear - And Skip this step in the future checkbox should be there - - Scenario: Navigate to Upload page - When I click Next button at Learn page - Then Upload page should appear - - - Scenario: Navigate to Release rights page - When I click Next button at Learn page - And upload file image.png - And click button Continue - Then Release rights page should open - And thumbnail should be visible - - - Scenario: Navigate to Describe page - When I click Next button at Learn page - And upload file image.png - And click button Continue - And I click This file is my own work - And I click Next button at Release rights page - Then Describe page should open - And title text field should be there - - @ie6-bug @ie7-bug @ie8-bug - Scenario: Navigate to Use page - When I click Next button at Learn page - And upload file image.png - And click button Continue - And I click This file is my own work - And I click Next button at Release rights page - And I enter title - And I enter description - And I enter category - And I click Next button at Describe page - Then Use page should open - And Upload more files button should be there -- To view, visit https://gerrit.wikimedia.org/r/92875 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ie6f9e1c8c963c8ae9b54e4434fb3bec90e9064da Gerrit-PatchSet: 1 Gerrit-Project: qa/browsertests Gerrit-Branch: master Gerrit-Owner: Zfilipin <[email protected]> _______________________________________________ MediaWiki-commits mailing list [email protected] https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
