Tobias Gritschacher has submitted this change and it was merged. Change subject: Dismiss copyright warning in Selenium tests ......................................................................
Dismiss copyright warning in Selenium tests - to avoid errors caused by bubble covering other elements Change-Id: Ia61441e2b8170c82ae6d3d6859f1248b665bf0e3 --- M selenium/lib/pages/create_item_page.rb M selenium/lib/pages/create_property_page.rb M selenium/lib/pages/entity_page.rb 3 files changed, 13 insertions(+), 2 deletions(-) Approvals: Tobias Gritschacher: Verified; Looks good to me, approved diff --git a/selenium/lib/pages/create_item_page.rb b/selenium/lib/pages/create_item_page.rb index dde2007..edc220d 100644 --- a/selenium/lib/pages/create_item_page.rb +++ b/selenium/lib/pages/create_item_page.rb @@ -10,10 +10,13 @@ include PageObject page_url WIKI_REPO_URL + "Special:NewItem" - def create_new_item(label, description, switch_lang = true) + def create_new_item(label, description, switch_lang = true, dismiss_copyright = true) if switch_lang self.uls_switch_language(LANGUAGE_CODE, LANGUAGE_NAME) end + if dismiss_copyright + self.set_copyright_ack_cookie + end self.createEntityLabelField = label self.createEntityDescriptionField = description createEntitySubmit diff --git a/selenium/lib/pages/create_property_page.rb b/selenium/lib/pages/create_property_page.rb index a5738de..65e8f04 100644 --- a/selenium/lib/pages/create_property_page.rb +++ b/selenium/lib/pages/create_property_page.rb @@ -12,10 +12,13 @@ select_list(:newPropertyDatatype, :id => 'wb-newproperty-datatype' ) - def create_new_property(label, description, datatype = "Item", switch_lang = true) + def create_new_property(label, description, datatype = "Item", switch_lang = true, dismiss_copyright = true) if switch_lang self.uls_switch_language(LANGUAGE_CODE, LANGUAGE_NAME) end + if dismiss_copyright + self.set_copyright_ack_cookie + end self.createEntityLabelField = label self.createEntityDescriptionField = description self.newPropertyDatatype = datatype diff --git a/selenium/lib/pages/entity_page.rb b/selenium/lib/pages/entity_page.rb index 7bc7ae7..06a1e02 100644 --- a/selenium/lib/pages/entity_page.rb +++ b/selenium/lib/pages/entity_page.rb @@ -114,4 +114,9 @@ wbErrorDetailsDiv? == true end end + + def set_copyright_ack_cookie + cookie = "$.cookie( 'wikibase.acknowledgedentitycopyright.en', 'By clicking \"save\", you agree to the terms of use, and you irrevocably agree to release your contribution under the [ ].', { 'expires': null, 'path': '/' } );" + @browser.execute_script(cookie) + end end -- To view, visit https://gerrit.wikimedia.org/r/65105 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ia61441e2b8170c82ae6d3d6859f1248b665bf0e3 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Wikibase Gerrit-Branch: master Gerrit-Owner: Tobias Gritschacher <tobias.gritschac...@wikimedia.de> Gerrit-Reviewer: Tobias Gritschacher <tobias.gritschac...@wikimedia.de> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits