From 6a2f641cf44b9eb0440b54d79314aa3b4ef3de9c Mon Sep 17 00:00:00 2001 From: Sam Smith Date: Tue, 13 Dec 2016 14:38:57 +0000 Subject: [PATCH] Hygiene: Remove RL-related step High-level acceptance tests shouldn't expose low-level concepts such as the Resource Loader ("RL"). Merge the "And the RL module has loaded" step into the "Given I am on the test page" step as they are only ever used together. Changes: * Use the ArticlePage#wait_until_rl_module_ready helper method provided by mediawiki_selenium@1.7.3. * Update and include the Gemfile.lock. Change-Id: Ic81eae5dc0caa8ec51c91b21aef544f52d8c49e1 --- Gemfile.lock | 124 ++++++++++++++++++ tests/browser/features/previews.feature | 1 - .../support/step_definitions/common_steps.rb | 10 +- 3 files changed, 126 insertions(+), 9 deletions(-) create mode 100644 Gemfile.lock diff --git a/Gemfile.lock b/Gemfile.lock new file mode 100644 index 000000000..5703a5daa --- /dev/null +++ b/Gemfile.lock @@ -0,0 +1,124 @@ +GEM + remote: https://rubygems.org/ + specs: + ast (2.3.0) + astrolabe (1.3.1) + parser (~> 2.2) + builder (3.2.2) + childprocess (0.5.9) + ffi (~> 1.0, >= 1.0.11) + chunky_png (1.3.8) + cucumber (1.3.20) + builder (>= 2.1.2) + diff-lcs (>= 1.1.3) + gherkin (~> 2.12) + multi_json (>= 1.7.5, < 2.0) + multi_test (>= 0.1.2) + data_magic (1.0) + faker (>= 1.1.2) + yml_reader (>= 0.6) + diff-lcs (1.2.5) + dimensions (1.2.0) + domain_name (0.5.20161129) + unf (>= 0.0.5, < 1.0.0) + faker (1.6.6) + i18n (~> 0.5) + faraday (0.10.0) + multipart-post (>= 1.2, < 3) + faraday-cookie_jar (0.0.6) + faraday (>= 0.7.4) + http-cookie (~> 1.0.0) + faraday_middleware (0.10.1) + faraday (>= 0.7.4, < 1.0) + ffi (1.9.14) + gherkin (2.12.2) + multi_json (~> 1.3) + headless (2.3.1) + http-cookie (1.0.3) + domain_name (~> 0.5) + i18n (0.7.0) + jsduck (5.3.4) + dimensions (~> 1.2.0) + json (~> 1.8.0) + parallel (~> 0.7.1) + rdiscount (~> 2.1.6) + rkelly-remix (~> 0.0.4) + json (1.8.3) + mediawiki_api (0.7.0) + faraday (~> 0.9, >= 0.9.0) + faraday-cookie_jar (~> 0.0, >= 0.0.6) + faraday_middleware (~> 0.10, >= 0.10.0) + mediawiki_selenium (1.7.3) + cucumber (~> 1.3, >= 1.3.20) + headless (~> 2.0, >= 2.1.0) + json (~> 1.8, >= 1.8.1) + mediawiki_api (~> 0.7, >= 0.7.0) + page-object (~> 1.0) + rest-client (~> 1.6, >= 1.6.7) + rspec-core (~> 2.14, >= 2.14.4) + rspec-expectations (~> 2.14, >= 2.14.4) + selenium-webdriver (< 3) + syntax (~> 1.2, >= 1.2.0) + thor (~> 0.19, >= 0.19.1) + mime-types (2.99.3) + multi_json (1.12.1) + multi_test (0.1.2) + multipart-post (2.0.0) + net-http-persistent (2.9.4) + netrc (0.11.0) + page-object (1.2.2) + net-http-persistent (~> 2.9.4) + page_navigation (>= 0.9) + selenium-webdriver (>= 2.53.0) + watir-webdriver (>= 0.6.11, < 0.9.9) + page_navigation (0.10) + data_magic (>= 0.22) + parallel (0.7.1) + parser (2.3.3.1) + ast (~> 2.2) + powerpack (0.1.1) + rainbow (2.1.0) + rake (10.5.0) + rdiscount (2.1.8) + rest-client (1.8.0) + http-cookie (>= 1.0.2, < 2.0) + mime-types (>= 1.16, < 3.0) + netrc (~> 0.7) + rkelly-remix (0.0.7) + rspec-core (2.99.2) + rspec-expectations (2.99.2) + diff-lcs (>= 1.1.3, < 2.0) + rubocop (0.29.1) + astrolabe (~> 1.3) + parser (>= 2.2.0.1, < 3.0) + powerpack (~> 0.1) + rainbow (>= 1.99.1, < 3.0) + ruby-progressbar (~> 1.4) + ruby-progressbar (1.8.1) + rubyzip (1.2.0) + selenium-webdriver (2.53.4) + childprocess (~> 0.5) + rubyzip (~> 1.0) + websocket (~> 1.0) + syntax (1.2.1) + thor (0.19.4) + unf (0.1.4) + unf_ext + unf_ext (0.0.7.2) + watir-webdriver (0.9.3) + selenium-webdriver (>= 2.46.2) + websocket (1.2.3) + yml_reader (0.7) + +PLATFORMS + ruby + +DEPENDENCIES + chunky_png (~> 1.3.4) + jsduck (~> 5.3.4) + mediawiki_selenium (~> 1.7, >= 1.7.1) + rake (~> 10.4, >= 10.4.2) + rubocop (~> 0.29.1) + +BUNDLED WITH + 1.12.5 diff --git a/tests/browser/features/previews.feature b/tests/browser/features/previews.feature index 94154ee59..06922f83f 100644 --- a/tests/browser/features/previews.feature +++ b/tests/browser/features/previews.feature @@ -4,7 +4,6 @@ Feature: Previews Given I am logged in And I have enabled the beta feature And I am on the test page - And the RL module has loaded Scenario: Dwelling on a valid link shows a preview When I dwell on the first valid link diff --git a/tests/browser/features/support/step_definitions/common_steps.rb b/tests/browser/features/support/step_definitions/common_steps.rb index ff8b59c86..f2b8fee47 100644 --- a/tests/browser/features/support/step_definitions/common_steps.rb +++ b/tests/browser/features/support/step_definitions/common_steps.rb @@ -7,13 +7,7 @@ end Given(/^I am on the test page$/) do api.create_page TEST_PAGE_TITLE, File.read('fixtures/test_page.wikitext') - visit(ArticlePage, using_params: { article_name: TEST_PAGE_TITLE }) -end - -Given(/^the RL module has loaded$/) do - on(ArticlePage) do |page| - page.wait_until do - browser.execute_script("return mw.loader.getState('ext.popups') === 'ready'") - end + visit(ArticlePage, using_params: { article_name: TEST_PAGE_TITLE }) do |page| + page.wait_until_rl_module_ready('ext.popups') end end