Plavi has uploaded a new change for review.
https://gerrit.wikimedia.org/r/86740
Change subject: Created the MEDIAWIKI_USER environment variable
......................................................................
Created the MEDIAWIKI_USER environment variable
Bug: 54523
Change-Id: I9a754ae8b10651329e077b4df57b95e0cb12ba50
---
M README.md
M config/config.yml
M docs/jenkins.md
M features/step_definitions/login_steps.rb
M features/step_definitions/upload_wizard_steps.rb
M features/support/env.rb
6 files changed, 8 insertions(+), 8 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/qa/browsertests
refs/changes/40/86740/1
diff --git a/README.md b/README.md
index 9711cd7..5215ac6 100644
--- a/README.md
+++ b/README.md
@@ -14,8 +14,10 @@
If you're not using RVM to manage your Ruby versions, you will need to run the
commands as root (using `sudo`).
-Environment variable MEDIAWIKI_PASSWORD is required for tests tagged `@login`.
For local testing, create a user named `Selenium_user` on your local wiki and
export the password as the value for this variable.
+Environment variables MEDIAWIKI_USER and MEDIAWIKI_PASSWORD are required for
tests tagged `@login`. For local testing, create a test user on your local wiki
and export the user and password as the values for those variables.
For example:
+ export MEDIAWIKI_USER=<username here> # Linux/Unix/Mac
+ set MEDIAWIKI_USER=<username here> # Windows
export MEDIAWIKI_PASSWORD=<password here> # Linux/Unix/Mac
set MEDIAWIKI_PASSWORD=<password here> # Windows
diff --git a/config/config.yml b/config/config.yml
index 17db808..02ed528 100644
--- a/config/config.yml
+++ b/config/config.yml
@@ -1,5 +1,3 @@
-mediawiki_username: Selenium_user
-
chrome:
name: chrome
platform: Linux
diff --git a/docs/jenkins.md b/docs/jenkins.md
index df52b1a..35738bf 100644
--- a/docs/jenkins.md
+++ b/docs/jenkins.md
@@ -22,6 +22,7 @@
- Jenkins > Manage Jenkins > Configure System > Global properties >
Environment variables > List of key-value pairs
- name
+ - MEDIAWIKI_USER
- MEDIAWIKI_PASSWORD
- SAUCE_ONDEMAND_ACCESS_KEY
- SAUCE_ONDEMAND_USERNAME
diff --git a/features/step_definitions/login_steps.rb
b/features/step_definitions/login_steps.rb
index 2bd5acd..ba8eb96 100644
--- a/features/step_definitions/login_steps.rb
+++ b/features/step_definitions/login_steps.rb
@@ -3,7 +3,7 @@
end
When(/^I log in with incorrect password$/) do
- on(LoginPage).login_with(@mediawiki_username, 'incorrect password')
+ on(LoginPage).login_with(ENV['MEDIAWIKI_USER'], 'incorrect password')
end
When(/^I log in with incorrect username$/) do
on(LoginPage).login_with('incorrect username', ENV['MEDIAWIKI_PASSWORD'])
@@ -12,7 +12,7 @@
on(LoginPage).login_with('', '')
end
When(/^I log in without entering password$/) do
- on(LoginPage).login_with(@mediawiki_username, '')
+ on(LoginPage).login_with(ENV['MEDIAWIKI_USER'], '')
end
When(/^Log in as (.+)$/) do |username|
on(LoginPage).login_with(username, ENV['MEDIAWIKI_PASSWORD'])
diff --git a/features/step_definitions/upload_wizard_steps.rb
b/features/step_definitions/upload_wizard_steps.rb
index 8690224..dd8ec84 100644
--- a/features/step_definitions/upload_wizard_steps.rb
+++ b/features/step_definitions/upload_wizard_steps.rb
@@ -1,5 +1,5 @@
Given(/^I am logged in$/) do
- visit(LoginPage).login_with(@mediawiki_username, ENV['MEDIAWIKI_PASSWORD'])
+ visit(LoginPage).login_with(ENV['MEDIAWIKI_USER'], ENV['MEDIAWIKI_PASSWORD'])
end
When(/^click button Continue$/) do
diff --git a/features/support/env.rb b/features/support/env.rb
index 57040ef..8adaf56 100644
--- a/features/support/env.rb
+++ b/features/support/env.rb
@@ -90,9 +90,9 @@
end
config = YAML.load_file('config/config.yml')
-mediawiki_username = config['mediawiki_username']
Before('@login') do
+ puts "MEDIAWIKI_USER environment variable is not defined! Please export a
value for that variable before proceeding." unless ENV['MEDIAWIKI_USER']
puts "MEDIAWIKI_PASSWORD environment variable is not defined! Please export
a value for that variable before proceeding." unless ENV['MEDIAWIKI_PASSWORD']
end
@@ -104,7 +104,6 @@
Before do |scenario|
@config = config
@random_string = Random.new.rand.to_s
- @mediawiki_username = mediawiki_username
@browser = browser(environment, test_name(scenario), 'default') unless
@language
$session_id = @browser.driver.instance_variable_get(:@bridge).session_id
end
--
To view, visit https://gerrit.wikimedia.org/r/86740
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I9a754ae8b10651329e077b4df57b95e0cb12ba50
Gerrit-PatchSet: 1
Gerrit-Project: qa/browsertests
Gerrit-Branch: master
Gerrit-Owner: Plavi <[email protected]>
Gerrit-Reviewer: jenkins-bot
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits