From e4a9b6c62cdc2076d15ccd3a377d92d7b30aadb7 Mon Sep 17 00:00:00 2001 From: Gilles Dubuc Date: Thu, 24 Apr 2014 16:52:13 +0200 Subject: [PATCH] User custom user agent to identify production test runs It's important that when we generate the graphs based on EventLogging data, we have a foolproof way to filter out local runs that happened during development. Change-Id: Ifc65d3b4bfb96946a8e8d59d080a6c5ee6552533 Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/509 --- tests/browser/features/mmv_performance.feature | 3 ++- .../features/step_definitions/mmv_performance_steps.rb | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/tests/browser/features/mmv_performance.feature b/tests/browser/features/mmv_performance.feature index e56c9d059..dd14cef1f 100644 --- a/tests/browser/features/mmv_performance.feature +++ b/tests/browser/features/mmv_performance.feature @@ -2,7 +2,8 @@ Feature: Multimedia Viewer performance Background: - Given I am at a wiki article with at least two embedded pictures + Given I am using a custom user agent + And I am at a wiki article with at least two embedded pictures Scenario: Commons with warm cache Given I visit an unrelated Commons page to warm up the browser cache diff --git a/tests/browser/features/step_definitions/mmv_performance_steps.rb b/tests/browser/features/step_definitions/mmv_performance_steps.rb index bb1fa7d99..cfeda94fd 100644 --- a/tests/browser/features/step_definitions/mmv_performance_steps.rb +++ b/tests/browser/features/step_definitions/mmv_performance_steps.rb @@ -19,6 +19,10 @@ Given /^I have a large browser window$/ do @browser.window.resize_to 1920, 1080 end +Given /^I am using a custom user agent$/ do + @browser = browser(test_name(@scenario), {user_agent: ENV["BROWSER_USERAGENT"]}) +end + Then /^the File: page image is loaded$/ do on(CommonsPage) do |page| wait_for_image_load page, ".fullImageLink img"