Karima Rafes has uploaded a new change for review.
https://gerrit.wikimedia.org/r/71917
Change subject: I forget to remove gems
......................................................................
I forget to remove gems
Change-Id: Id0b02a5b00e93cf7019893dc61a244d4c232922b
---
M Gemfile
A features/step_definitions/tables_steps.rb
M features/support/env.rb
A features/table.feature
4 files changed, 39 insertions(+), 0 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/qa/browsertests
refs/changes/17/71917/1
diff --git a/Gemfile b/Gemfile
index 3e7af91..e95cac8 100755
--- a/Gemfile
+++ b/Gemfile
@@ -9,3 +9,6 @@
gem 'rake'
gem 'rspec-expectations'
gem 'syntax'
+gem 'nokogiri'
+
+
diff --git a/features/step_definitions/tables_steps.rb
b/features/step_definitions/tables_steps.rb
new file mode 100644
index 0000000..361a55e
--- /dev/null
+++ b/features/step_definitions/tables_steps.rb
@@ -0,0 +1,11 @@
+When(/^I enter the wikitext:$/) do |wikiText|
+ on(EditPage).article_text = wikiText
+end
+
+Then(/^table should be there:$/) do |table|
+ nodesTR = Nokogiri::HTML(@browser.html).css(".wikitable tr")
+ tableResult = nodesTR.map {|tr| tr.css("th,td").map {|cell|
cell.text.strip}}
+# p tableResult
+# p table.raw()
+ table.diff!(tableResult)
+end
\ No newline at end of file
diff --git a/features/support/env.rb b/features/support/env.rb
index 26e8562..a3c398e 100644
--- a/features/support/env.rb
+++ b/features/support/env.rb
@@ -1,9 +1,11 @@
# before all
+#require 'rubygems'
require 'bundler/setup'
require 'page-object'
require 'page-object/page_factory'
require 'watir-webdriver'
require 'yaml'
+require 'nokogiri'
World(PageObject::PageFactory)
diff --git a/features/table.feature b/features/table.feature
new file mode 100644
index 0000000..2a1833e
--- /dev/null
+++ b/features/table.feature
@@ -0,0 +1,23 @@
+@login
+Feature: table
+
+ Background:
+ Given I am logged in
+
+ Scenario: Create a table
+ Given I am at page that does not exist
+ When I click link Create source
+ And I enter the wikitext:
+ """
+{| class="wikitable sortable"
+|-
+!x!!y!!z
+|-
+|1||2||3
+|}
+ """
+ And I click Save page button
+ Then newly created page should open
+ And table should be there:
+ | x | y | z |
+ | 1 | 2 | 3 |
\ No newline at end of file
--
To view, visit https://gerrit.wikimedia.org/r/71917
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Id0b02a5b00e93cf7019893dc61a244d4c232922b
Gerrit-PatchSet: 1
Gerrit-Project: qa/browsertests
Gerrit-Branch: master
Gerrit-Owner: Karima Rafes <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits