Tobias Gritschacher has submitted this change and it was merged. Change subject: Update browser tests from most recent wikidata/browsertests ......................................................................
Update browser tests from most recent wikidata/browsertests Change-Id: I95b109403643af63c9ec3c79dfb86e6ce2a6797a --- M tests/browser/ci.yml M tests/browser/environments.yml M tests/browser/features/aliases.feature M tests/browser/features/description.feature M tests/browser/features/edit_tab.feature M tests/browser/features/empty_label_and_description.feature M tests/browser/features/header.feature M tests/browser/features/label.feature M tests/browser/features/non_existing_item.feature M tests/browser/features/reference.feature M tests/browser/features/sitelinks.feature M tests/browser/features/sitelinks_badge.feature M tests/browser/features/special_set_label.feature M tests/browser/features/statement.feature M tests/browser/features/statements_geo.feature M tests/browser/features/statements_item.feature M tests/browser/features/statements_monolingual.feature M tests/browser/features/statements_quantity.feature M tests/browser/features/statements_rank.feature M tests/browser/features/statements_snaktype.feature M tests/browser/features/statements_string.feature M tests/browser/features/statements_time.feature M tests/browser/features/statements_url.feature M tests/browser/features/step_definitions/badges_steps.rb M tests/browser/features/support/modules/entity_module.rb 25 files changed, 47 insertions(+), 97 deletions(-) Approvals: Tobias Gritschacher: Looks good to me, approved jenkins-bot: Verified diff --git a/tests/browser/ci.yml b/tests/browser/ci.yml index 8c9865e..0902f17 100644 --- a/tests/browser/ci.yml +++ b/tests/browser/ci.yml @@ -3,6 +3,7 @@ MEDIAWIKI_ENVIRONMENT: - beta + - test PLATFORM: - Linux diff --git a/tests/browser/environments.yml b/tests/browser/environments.yml index 9b6279a..3b28ccd 100644 --- a/tests/browser/environments.yml +++ b/tests/browser/environments.yml @@ -31,7 +31,7 @@ beta: language_code: en browser: firefox - mediawiki_url: http://wikidata.beta.wmflabs.org/wiki/ + mediawiki_url: https://wikidata.beta.wmflabs.org/wiki/ mediawiki_user: Selenium_user # mediawiki_password: SET THIS IN THE ENVIRONMENT! diff --git a/tests/browser/features/aliases.feature b/tests/browser/features/aliases.feature index 9d05308..8a5f965 100644 --- a/tests/browser/features/aliases.feature +++ b/tests/browser/features/aliases.feature @@ -5,7 +5,7 @@ # # feature definition for item aliases tests -@chrome @firefox @internet_explorer_10 @internet_explorer_11 @local_config @wikidata.beta.wmflabs.org +@chrome @firefox @internet_explorer_10 @internet_explorer_11 @local_config @test.wikidata.org @wikidata.beta.wmflabs.org Feature: Edit aliases Background: diff --git a/tests/browser/features/description.feature b/tests/browser/features/description.feature index 7a92bd1..3f1893f 100644 --- a/tests/browser/features/description.feature +++ b/tests/browser/features/description.feature @@ -5,7 +5,7 @@ # # feature definition for item description tests -@chrome @firefox @internet_explorer_10 @internet_explorer_11 @local_config @wikidata.beta.wmflabs.org +@chrome @firefox @internet_explorer_10 @internet_explorer_11 @local_config @test.wikidata.org @wikidata.beta.wmflabs.org Feature: Edit description Background: diff --git a/tests/browser/features/edit_tab.feature b/tests/browser/features/edit_tab.feature index 0af982a..8c5ef3c 100644 --- a/tests/browser/features/edit_tab.feature +++ b/tests/browser/features/edit_tab.feature @@ -4,7 +4,7 @@ # # feature the functionality of the edit tab function -@chrome @firefox @internet_explorer_10 @internet_explorer_11 @local_config @wikidata.beta.wmflabs.org +@chrome @firefox @internet_explorer_10 @internet_explorer_11 @local_config @test.wikidata.org @wikidata.beta.wmflabs.org Feature: Edit tab Scenario: Edit tab diff --git a/tests/browser/features/empty_label_and_description.feature b/tests/browser/features/empty_label_and_description.feature index 99df8d6..2b700a0 100644 --- a/tests/browser/features/empty_label_and_description.feature +++ b/tests/browser/features/empty_label_and_description.feature @@ -5,7 +5,7 @@ # # feature definition for item description tests -@chrome @firefox @internet_explorer_10 @internet_explorer_11 @local_config @wikidata.beta.wmflabs.org +@chrome @firefox @internet_explorer_10 @internet_explorer_11 @local_config @test.wikidata.org @wikidata.beta.wmflabs.org Feature: Empty label and description behaviour Background: diff --git a/tests/browser/features/header.feature b/tests/browser/features/header.feature index 7f8a9ca..54e850e 100644 --- a/tests/browser/features/header.feature +++ b/tests/browser/features/header.feature @@ -5,7 +5,7 @@ # # feature definition for item header tests -@chrome @firefox @internet_explorer_10 @internet_explorer_11 @local_config @wikidata.beta.wmflabs.org +@chrome @firefox @internet_explorer_10 @internet_explorer_11 @local_config @test.wikidata.org @wikidata.beta.wmflabs.org Feature: Use header Background: diff --git a/tests/browser/features/label.feature b/tests/browser/features/label.feature index 8230c22..ad1d914 100644 --- a/tests/browser/features/label.feature +++ b/tests/browser/features/label.feature @@ -5,7 +5,7 @@ # # feature definition for item label tests -@chrome @firefox @internet_explorer_10 @internet_explorer_11 @local_config @wikidata.beta.wmflabs.org +@chrome @firefox @internet_explorer_10 @internet_explorer_11 @local_config @test.wikidata.org @wikidata.beta.wmflabs.org Feature: Edit label Background: diff --git a/tests/browser/features/non_existing_item.feature b/tests/browser/features/non_existing_item.feature index d831599..7dd655c 100644 --- a/tests/browser/features/non_existing_item.feature +++ b/tests/browser/features/non_existing_item.feature @@ -4,7 +4,7 @@ # # feature the functionality of a non existing item page -@integration @chrome @firefox @internet_explorer_10 @internet_explorer_11 @local_config @wikidata.beta.wmflabs.org +@integration @chrome @firefox @internet_explorer_10 @internet_explorer_11 @local_config @test.wikidata.org @wikidata.beta.wmflabs.org Feature: Non existing item Scenario: Edit tab diff --git a/tests/browser/features/reference.feature b/tests/browser/features/reference.feature index a67e562..4ec7064 100644 --- a/tests/browser/features/reference.feature +++ b/tests/browser/features/reference.feature @@ -5,7 +5,7 @@ # # feature definition for references -@chrome @firefox @internet_explorer_10 @internet_explorer_11 @local_config @wikidata.beta.wmflabs.org +@chrome @firefox @internet_explorer_10 @internet_explorer_11 @local_config @test.wikidata.org @wikidata.beta.wmflabs.org Feature: Adding references to statements Background: @@ -51,6 +51,7 @@ Scenario Outline: Cancel reference When I click the statement edit button And I click the reference add button + And I close the entity selector popup if present And I <cancel> And I click the statement edit button Then Reference add button should be there diff --git a/tests/browser/features/sitelinks.feature b/tests/browser/features/sitelinks.feature index 4a91301..2e4b4ca 100644 --- a/tests/browser/features/sitelinks.feature +++ b/tests/browser/features/sitelinks.feature @@ -13,7 +13,7 @@ And The copyright warning has been dismissed And Anonymous edit warnings are disabled - @ui_only + @ui_only @test.wikidata.org Scenario: Sitelink UI has all required elements Then wikipedia sitelink section should be there And Sitelink heading should be there @@ -21,7 +21,7 @@ And Sitelink counter should be there And There should be 0 sitelinks in the list - @ui_only + @ui_only @test.wikidata.org Scenario: Click edit button When I click the sitelink edit button Then Sitelink edit button should not be there @@ -32,7 +32,7 @@ And Sitelink siteid input field should be there And Sitelink pagename input field should not be there - @ui_only + @ui_only @test.wikidata.org Scenario Outline: Type site id When I click the sitelink edit button And I type <siteid> into the 1. siteid input field @@ -48,7 +48,7 @@ | en | English | | he | עברית | - @ui_only + @ui_only @test.wikidata.org Scenario Outline: Type site id and page name When I click the sitelink edit button And I type <siteid> into the 1. siteid input field @@ -64,7 +64,7 @@ | en | Main Page | Main Page | | he | עמוד ראשי | עמוד ראשי | - @ui_only + @ui_only @test.wikidata.org Scenario: Type site id and page name and change site id to something senseless When I click the sitelink edit button And I type en into the 1. siteid input field @@ -75,7 +75,7 @@ And Sitelink remove button should be disabled And Sitelink pagename input field should not be there - @ui_only + @ui_only @test.wikidata.org Scenario Outline: Cancel sitelink during siteid selection When I click the sitelink edit button And I <cancel> @@ -91,7 +91,7 @@ | click the sitelink cancel button | | press the ESC key in the siteid input field | - @ui_only + @ui_only @test.wikidata.org Scenario Outline: Cancel sitelink during pagename selection When I click the sitelink edit button And I type en into the 1. siteid input field @@ -108,7 +108,7 @@ | click the sitelink cancel button | | press the ESC key in the pagename input field | - @modify_entity @save_sitelink @smoke + @modify_entity @save_sitelink @smoke @test.wikidata.org Scenario Outline: Save sitelink Given The following sitelinks do not exist: | enwiki | Asia | @@ -123,7 +123,7 @@ | click the sitelink save button | | press the RETURN key in the pagename input field | - @modify_entity @save_sitelink + @modify_entity @save_sitelink @test.wikidata.org Scenario Outline: Save sitelink and reload Given The following sitelinks do not exist: | enwiki | Asia | @@ -139,7 +139,7 @@ | click the sitelink save button | | press the RETURN key in the pagename input field | - @modify_entity @save_sitelink + @modify_entity @save_sitelink @test.wikidata.org Scenario: Edit sitelink Given The following sitelinks do not exist: | enwiki | Asia | @@ -155,7 +155,7 @@ And Sitelink save button should not be there And Sitelink remove button should not be there - @modify_entity @save_sitelink + @modify_entity @save_sitelink @test.wikidata.org Scenario Outline: Add sitelink Given The following sitelinks do not exist: | enwiki | Asia | @@ -179,7 +179,7 @@ | en | Asia | Asia | | sq | wikipedia | Wikipedia | - @modify_entity @save_sitelink + @modify_entity @save_sitelink @test.wikidata.org Scenario: Add multiple sitelinks Given The following sitelinks do not exist: | enwiki | Europe | @@ -206,7 +206,7 @@ Then There should be 0 sitelinks in the list And Sitelink edit button should be there - @modify_entity @save_sitelink + @modify_entity @save_sitelink @test.wikidata.org Scenario: List of sitelinks is complete Given The following sitelinks do not exist: | enwiki | Europe | @@ -216,7 +216,7 @@ And I click the sitelink edit button Then Sitelink siteid input field should not be there - @save_sitelink + @save_sitelink @test.wikidata.org Scenario: Add sitelink to non existent page When I click the sitelink edit button And I type en into the 1. siteid input field @@ -224,7 +224,7 @@ And I click the sitelink save button Then An error message should be displayed for sitelink group wikipedia - @save_sitelink + @save_sitelink @test.wikidata.org Scenario: Add new sitelink to already referenced site Given The following sitelinks do not exist: | enwiki | Asia | diff --git a/tests/browser/features/sitelinks_badge.feature b/tests/browser/features/sitelinks_badge.feature index 5d6a5d4..0698398 100644 --- a/tests/browser/features/sitelinks_badge.feature +++ b/tests/browser/features/sitelinks_badge.feature @@ -5,7 +5,7 @@ # # feature definition for item sitelinks tests -@chrome @firefox @internet_explorer_10 @internet_explorer_11 @local_config @wikidata.beta.wmflabs.org +@chrome @firefox @internet_explorer_10 @internet_explorer_11 @local_config @test.wikidata.org @wikidata.beta.wmflabs.org Feature: Add badges to sitelinks Background: diff --git a/tests/browser/features/special_set_label.feature b/tests/browser/features/special_set_label.feature index fb8ef08..8af7491 100644 --- a/tests/browser/features/special_set_label.feature +++ b/tests/browser/features/special_set_label.feature @@ -5,7 +5,7 @@ # # feature definition for the Special:SetLabel page tests -@chrome @firefox @internet_explorer_10 @internet_explorer_11 @local_config @special_pages @wikidata.beta.wmflabs.org +@chrome @firefox @internet_explorer_10 @internet_explorer_11 @local_config @special_pages @test.wikidata.org @wikidata.beta.wmflabs.org Feature: Special:SetLabel page @ui_only diff --git a/tests/browser/features/statement.feature b/tests/browser/features/statement.feature index 5f9ed8f..81ef8fc 100644 --- a/tests/browser/features/statement.feature +++ b/tests/browser/features/statement.feature @@ -5,7 +5,7 @@ # # feature definition for statements tests -@chrome @firefox @internet_explorer_10 @internet_explorer_11 @local_config @wikidata.beta.wmflabs.org +@chrome @firefox @internet_explorer_10 @internet_explorer_11 @local_config @test.wikidata.org @wikidata.beta.wmflabs.org Feature: Creating statements Background: diff --git a/tests/browser/features/statements_geo.feature b/tests/browser/features/statements_geo.feature index 94c5ec1..1769d8f 100644 --- a/tests/browser/features/statements_geo.feature +++ b/tests/browser/features/statements_geo.feature @@ -5,7 +5,7 @@ # # feature definition for geo type statements tests -@chrome @firefox @internet_explorer_10 @internet_explorer_11 @local_config @wikidata.beta.wmflabs.org +@chrome @firefox @internet_explorer_10 @internet_explorer_11 @local_config @test.wikidata.org @wikidata.beta.wmflabs.org Feature: Using geo properties in statements Background: diff --git a/tests/browser/features/statements_item.feature b/tests/browser/features/statements_item.feature index cb6e413..c555411 100644 --- a/tests/browser/features/statements_item.feature +++ b/tests/browser/features/statements_item.feature @@ -5,7 +5,7 @@ # # feature definition for item type statements tests -@chrome @firefox @internet_explorer_10 @internet_explorer_11 @local_config @wikidata.beta.wmflabs.org +@chrome @firefox @internet_explorer_10 @internet_explorer_11 @local_config @test.wikidata.org @wikidata.beta.wmflabs.org Feature: Creating statements of type item Background: diff --git a/tests/browser/features/statements_monolingual.feature b/tests/browser/features/statements_monolingual.feature index b8ce6a9..b47ba39 100644 --- a/tests/browser/features/statements_monolingual.feature +++ b/tests/browser/features/statements_monolingual.feature @@ -5,7 +5,7 @@ # # feature definition for monolingual type statements tests -@chrome @firefox @internet_explorer_10 @internet_explorer_11 @local_config @wikidata.beta.wmflabs.org +@chrome @firefox @internet_explorer_10 @internet_explorer_11 @local_config @test.wikidata.org @wikidata.beta.wmflabs.org Feature: Using monolingual properties in statements Background: diff --git a/tests/browser/features/statements_quantity.feature b/tests/browser/features/statements_quantity.feature index ce3a350..53d59df 100644 --- a/tests/browser/features/statements_quantity.feature +++ b/tests/browser/features/statements_quantity.feature @@ -5,7 +5,7 @@ # # feature definition for quantity type statements tests -@chrome @firefox @internet_explorer_10 @internet_explorer_11 @local_config @wikidata.beta.wmflabs.org +@chrome @firefox @internet_explorer_10 @internet_explorer_11 @local_config @test.wikidata.org @wikidata.beta.wmflabs.org Feature: Using quantity properties in statements Background: diff --git a/tests/browser/features/statements_rank.feature b/tests/browser/features/statements_rank.feature index 5848dc2..df1e908 100644 --- a/tests/browser/features/statements_rank.feature +++ b/tests/browser/features/statements_rank.feature @@ -5,7 +5,7 @@ # # feature definition for statement ranks tests -@chrome @firefox @internet_explorer_10 @internet_explorer_11 @local_config @wikidata.beta.wmflabs.org +@chrome @firefox @internet_explorer_10 @internet_explorer_11 @local_config @test.wikidata.org @wikidata.beta.wmflabs.org Feature: Setting ranks of statements Background: diff --git a/tests/browser/features/statements_snaktype.feature b/tests/browser/features/statements_snaktype.feature index 46d0ed9..442bf07 100644 --- a/tests/browser/features/statements_snaktype.feature +++ b/tests/browser/features/statements_snaktype.feature @@ -5,7 +5,7 @@ # # feature definition for statement snaktype tests -@chrome @firefox @internet_explorer_10 @internet_explorer_11 @local_config @wikidata.beta.wmflabs.org +@chrome @firefox @internet_explorer_10 @internet_explorer_11 @local_config @test.wikidata.org @wikidata.beta.wmflabs.org Feature: Setting snaktypes of statements Background: diff --git a/tests/browser/features/statements_string.feature b/tests/browser/features/statements_string.feature index 20758f5..7ab8ec6 100644 --- a/tests/browser/features/statements_string.feature +++ b/tests/browser/features/statements_string.feature @@ -5,7 +5,7 @@ # # feature definition for string type statements tests -@chrome @firefox @internet_explorer_10 @internet_explorer_11 @local_config @wikidata.beta.wmflabs.org +@chrome @firefox @internet_explorer_10 @internet_explorer_11 @local_config @test.wikidata.org @wikidata.beta.wmflabs.org Feature: Creating statements of type string Background: diff --git a/tests/browser/features/statements_time.feature b/tests/browser/features/statements_time.feature index de96266..52e5f8c 100644 --- a/tests/browser/features/statements_time.feature +++ b/tests/browser/features/statements_time.feature @@ -5,7 +5,7 @@ # # feature definition for time type statements tests -@chrome @firefox @internet_explorer_10 @internet_explorer_11 @local_config @wikidata.beta.wmflabs.org +@chrome @firefox @internet_explorer_10 @internet_explorer_11 @local_config @test.wikidata.org @wikidata.beta.wmflabs.org Feature: Using time properties in statements Background: diff --git a/tests/browser/features/statements_url.feature b/tests/browser/features/statements_url.feature index cb46f53..dd8483d 100644 --- a/tests/browser/features/statements_url.feature +++ b/tests/browser/features/statements_url.feature @@ -5,7 +5,7 @@ # # feature definition for url type statements tests -@chrome @firefox @internet_explorer_10 @internet_explorer_11 @local_config @wikidata.beta.wmflabs.org +@chrome @firefox @internet_explorer_10 @internet_explorer_11 @local_config @test.wikidata.org @wikidata.beta.wmflabs.org Feature: Using url properties in statements Background: diff --git a/tests/browser/features/step_definitions/badges_steps.rb b/tests/browser/features/step_definitions/badges_steps.rb index 964bdc2..413ddba 100644 --- a/tests/browser/features/step_definitions/badges_steps.rb +++ b/tests/browser/features/step_definitions/badges_steps.rb @@ -8,11 +8,11 @@ end When(/^I click the (\d). badge selector id item$/) do |num| - on(ItemPage).badge_selector_list[@available_badges[num.to_i]].selector_id_link_element.when_visible.click + on(ItemPage).badge_selector_list[@available_badges[num.to_i - 1]].selector_id_link_element.when_visible.click end Then(/^The (\d+)\. badge id should be attached to the sitelink$/) do |num| - expect(on(ItemPage).badge_list[@available_badges[num.to_i]].badge_element.when_visible).to be_visible + expect(on(ItemPage).badge_list[@available_badges[num.to_i - 1]].badge_element.when_visible).to be_visible end Then(/^Sitelink badge selector should be there$/) do diff --git a/tests/browser/features/support/modules/entity_module.rb b/tests/browser/features/support/modules/entity_module.rb index c2f71b5..15ac139 100644 --- a/tests/browser/features/support/modules/entity_module.rb +++ b/tests/browser/features/support/modules/entity_module.rb @@ -112,8 +112,13 @@ end def ajax_wait - Timeout.timeout(5) do - sleep(1.0 / 3) while execute_script('return jQuery.active') != 0 + sleep_period = 0.25 + timeout_seconds = 2 + timeout_loops = (timeout_seconds / sleep_period).to_i + + while execute_script('return jQuery.active') != 0 && timeout_loops > 0 + sleep(sleep_period) + timeout_loops -= 1 end sleep 1 true @@ -141,62 +146,5 @@ def set_noanonymouseditwarning_cookie cookie = "$.cookie( 'wikibase-no-anonymouseditwarning', '1', { 'expires': null, 'path': '/' } );" execute_script(cookie) - end - - # this method was moved from wikibase_api_module.rb since we are now using the mediawiki_api/wikidata gem for doing API requests - # this method is really ugly and should be refactored - def create_entity_and_properties(serialization) - wb_api = MediawikiApi::Wikidata::WikidataClient.new URL.repo_api - wb_api.log_in(ENV['MEDIAWIKI_USER'], ENV['MEDIAWIKI_PASSWORD']) - - serialization['properties'].each do |old_id, prop| - if prop['description'] && prop['description']['en']['value'] - search = prop['description']['en']['value'] - else - search = prop['labels']['en']['value'] - end - resp = wb_api.search_entities(search, 'en', 'property') - resp['search'].reject! do |found_prop| - found_prop['label'] != prop['labels']['en']['value'] - end - if resp['search'][0] - id = resp['search'][0]['id'] - else - saved_prop = wb_api.create_property(prop) - id = saved_prop['id'] - end - - serialization['entity']['claims'].each do |claim| - if claim['mainsnak']['property'] == old_id - claim['mainsnak']['property'] = id - end - if claim['qualifiers'] - claim['qualifiers'].each do |qualifier| - if qualifier['property'] == old_id - qualifier['property'] = id - end - end - end - if claim['qualifiers-order'] - claim['qualifiers-order'].map! do |p_id| - p_id == old_id ? id : p_id - end - end - if claim['references'] - claim['references'].each do |reference| - reference['snaks'].each do |snak| - if snak['property'] == old_id - snak['property'] = id - end - end - reference['snaks-order'].map! do |p_id| - p_id == old_id ? id : p_id - end - end - end - end - end - - wb_api.create_item(serialization['entity']) end end -- To view, visit https://gerrit.wikimedia.org/r/306914 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I95b109403643af63c9ec3c79dfb86e6ce2a6797a Gerrit-PatchSet: 2 Gerrit-Project: mediawiki/extensions/Wikibase Gerrit-Branch: master Gerrit-Owner: Thiemo Mättig (WMDE) <thiemo.maet...@wikimedia.de> Gerrit-Reviewer: Tobias Gritschacher <tobias.gritschac...@wikimedia.de> Gerrit-Reviewer: jenkins-bot <> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits