Cmcmahon has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/74075


Change subject: Basic test for Hotcat gadget test2wiki only for now
......................................................................

Basic test for Hotcat gadget test2wiki only for now

Change-Id: Ie6c8b066aaa7adc10451935ee8c4c0957410767f
---
A features/hotcat.feature
A features/step_definitions/hotcat_steps.rb
A features/support/pages/hotcat_page.rb
3 files changed, 66 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/qa/browsertests 
refs/changes/75/74075/1

diff --git a/features/hotcat.feature b/features/hotcat.feature
new file mode 100644
index 0000000..da210fb
--- /dev/null
+++ b/features/hotcat.feature
@@ -0,0 +1,21 @@
[email protected] @login
+
+Feature: Hotcat
+
+  Background:
+    Given I am logged in
+      And I am at random page
+
+  Scenario: Hotcat category link
+    When I click the Categories link
+    Then I am taken to the Special:Categories page
+  
+  Scenario: Hotcat Modify several categories
+    When I click the Modify several categories button
+    Then a Save button is visible
+      And an Add new categories link is visible
+
+  Scenario: Hotcat Add category
+    When I click the Add a new category link
+    Then I can click OK and click Add new category
+      And I can click Cancel and Add new category
diff --git a/features/step_definitions/hotcat_steps.rb 
b/features/step_definitions/hotcat_steps.rb
new file mode 100644
index 0000000..29ae36a
--- /dev/null
+++ b/features/step_definitions/hotcat_steps.rb
@@ -0,0 +1,35 @@
+When(/^I click the Add a new category link$/) do
+  on(HotcatPage).add_new_category_element.when_present.click
+end
+
+When(/^I click the Categories link$/) do
+  on(HotcatPage).categories_link
+end
+
+When(/^I click the Modify several categories button$/) do
+  on(HotcatPage).modify_several_categories
+end
+
+Then(/^a Save button is visible$/) do
+  on(HotcatPage).save_button_element.should be_visible
+end
+
+Then(/^an Add new categories link is visible$/) do
+  on(HotcatPage).add_new_category_element.when_present.should be_visible
+end
+
+Then(/^I am taken to the Special:Categories page$/) do
+  @browser.url.should match Regexp.escape('Special:Categories')
+end
+
+Then(/^I can click Cancel and Add new category$/) do
+  on(HotcatPage).cancel
+  step 'I click the Add a new category link'
+end
+
+Then(/^I can click OK and click Add new category$/) do
+  on(HotcatPage).ok
+  step 'I click the Add a new category link'
+end
+
+
diff --git a/features/support/pages/hotcat_page.rb 
b/features/support/pages/hotcat_page.rb
new file mode 100644
index 0000000..126205a
--- /dev/null
+++ b/features/support/pages/hotcat_page.rb
@@ -0,0 +1,10 @@
+class HotcatPage
+  include PageObject
+  
+  a(:add_new_category, title: 'Add a new category')
+  button(:cancel, value: 'Cancel')
+  a(:categories_link, text: 'Categories')
+  a(:modify_several_categories, title: 'Modify several categories')
+  button(:ok, value: 'OK')
+  button(:save_button, value: 'Save')
+end

-- 
To view, visit https://gerrit.wikimedia.org/r/74075
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie6c8b066aaa7adc10451935ee8c4c0957410767f
Gerrit-PatchSet: 1
Gerrit-Project: qa/browsertests
Gerrit-Branch: master
Gerrit-Owner: Cmcmahon <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to