Tobias Gritschacher has uploaded a new change for review.
https://gerrit.wikimedia.org/r/110966
Change subject: Browsertests for statements with item values
..
Browsertests for statements with item values
Change-Id: I8c31e1a68b3bd3c96b42e47d74ccf13324f7e55e
---
A tests/browser/features/statements_item.feature
M tests/browser/features/statements_string.feature
M tests/browser/features/step_definitions/statement_steps.rb
M tests/browser/features/support/modules/statement_module.rb
M tests/browser/features/support/modules/wikibase_api_module.rb
5 files changed, 61 insertions(+), 12 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase
refs/changes/66/110966/1
diff --git a/tests/browser/features/statements_item.feature
b/tests/browser/features/statements_item.feature
new file mode 100644
index 000..cc82c32
--- /dev/null
+++ b/tests/browser/features/statements_item.feature
@@ -0,0 +1,38 @@
+# Wikidata UI tests
+#
+# Author:: Tobias Gritschacher (tobias.gritschac...@wikimedia.de)
+# License:: GNU GPL v2+
+#
+# feature definition for item type statements tests
+
+@wikidata.beta.wmflabs.org
+Feature: Creating statements of type item
+
+ Background:
+Given I am on an item page
+ And The copyright warning has been dismissed
+ And Anonymous edit warnings are disabled
+
+ @repo_login @modify_entity
+ Scenario Outline: Adding a statement of type item
+Given There are properties with the following handles and datatypes:
+ | itemprop | wikibase-item |
+Given There are items with the following handles:
+ | item1 |
+When I click the statement add button
+ And I select the property itemprop
+ And I enter the label of the item with handle as statement
value
+ And I
+Then Statement add button should be there
+And Statement cancel button should not be there
+And Statement save button should not be there
+And Entity selector input element should not be there
+And Statement value input element should not be there
+And Statement edit button for claim 1 in group 1 should be there
+And Statement name of group 1 should be the label of itemprop
+And Statement value of claim 1 in group 1 should be the label of the item
with handle
+
+ Examples:
+| itemhandle | save|
+#| item1 | click the statement save button |
+| item1 | press the RETURN key in the statement value input field |
diff --git a/tests/browser/features/statements_string.feature
b/tests/browser/features/statements_string.feature
index 8b8274e..7414629 100644
--- a/tests/browser/features/statements_string.feature
+++ b/tests/browser/features/statements_string.feature
@@ -3,10 +3,10 @@
# Author:: Tobias Gritschacher (tobias.gritschac...@wikimedia.de)
# License:: GNU GPL v2+
#
-# feature definition for statements tests
+# feature definition for string type statements tests
@wikidata.beta.wmflabs.org
-Feature: Creating statements
+Feature: Creating statements of type string
Background:
Given I am on an item page
@@ -19,7 +19,7 @@
| stringprop | string |
When I click the statement add button
And I select the property stringprop
- And I enter as string statement value
+ And I enter the string as statement value
And I
Then Statement add button should be there
And Statement cancel button should not be there
@@ -41,7 +41,7 @@
| stringprop | string |
When I click the statement add button
And I select the property stringprop
- And I enter it's a string as string statement value
+ And I enter the string it's a string as statement value
And I click the statement save button
And I reload the page
Then Statement add button should be there
diff --git a/tests/browser/features/step_definitions/statement_steps.rb
b/tests/browser/features/step_definitions/statement_steps.rb
index cc67233..44967c9 100644
--- a/tests/browser/features/step_definitions/statement_steps.rb
+++ b/tests/browser/features/step_definitions/statement_steps.rb
@@ -37,8 +37,16 @@
end
end
-When /^I enter (.+) as string statement value$/ do |value|
+When /^I enter the string (.+) as statement value$/ do |value|
on(ItemPage).statement_value_input_field = value
+end
+
+When /^I enter the label of the item with handle (.+) as statement value$/ do
|handle|
+ on(ItemPage) do |page|
+page.statement_value_input_field_element.clear
+page.statement_value_input_field = @items[handle]["label"]
+page.ajax_wait
+ end
end
When /^I enter a too long string as statement value$/ do
@@ -114,3 +122,7 @@
Then /^Statement string value of claim (.+) in group (.+) should be (.+)$/ do
|claim_index, group_index, value|
on(ItemPage).statement_string_value_element(group_index,
claim_index).attribute_value