Re: [Freeipa-devel] [TESTS][PATCH 0010] WebUI tests - ID views

2016-03-11 Thread Martin Basti



On 11.03.2016 10:12, Pavel Vomacka wrote:



On 03/08/2016 02:34 PM, Lenka Doudova wrote:



On 03/08/2016 12:43 PM, Pavel Vomacka wrote:



On 02/23/2016 03:20 PM, Lenka Doudova wrote:

Hi,

attached is patch providing missing test coverage for ID views in 
webUI.


Lenka



Hi,

Thank you for your patch. I have small one comment: The 
delete_associtaion() function duplicates code, it would be good to 
create auxiliary function and move that code there. NACK.


--
Pavel^3 Vomacka



Hi,

thanks for review, fixed patch attached.

Lenka



Thank you, ACK.

--
Pavel^3 Vomacka



Pushed to master: 904db149e9f99b9a318441bc50972a8336a5b4c0

-- 
Manage your subscription for the Freeipa-devel mailing list:
https://www.redhat.com/mailman/listinfo/freeipa-devel
Contribute to FreeIPA: http://www.freeipa.org/page/Contribute/Code

Re: [Freeipa-devel] [TESTS][PATCH 0010] WebUI tests - ID views

2016-03-11 Thread Pavel Vomacka



On 03/08/2016 02:34 PM, Lenka Doudova wrote:



On 03/08/2016 12:43 PM, Pavel Vomacka wrote:



On 02/23/2016 03:20 PM, Lenka Doudova wrote:

Hi,

attached is patch providing missing test coverage for ID views in 
webUI.


Lenka



Hi,

Thank you for your patch. I have small one comment: The 
delete_associtaion() function duplicates code, it would be good to 
create auxiliary function and move that code there. NACK.


--
Pavel^3 Vomacka



Hi,

thanks for review, fixed patch attached.

Lenka



Thank you, ACK.

--
Pavel^3 Vomacka
-- 
Manage your subscription for the Freeipa-devel mailing list:
https://www.redhat.com/mailman/listinfo/freeipa-devel
Contribute to FreeIPA: http://www.freeipa.org/page/Contribute/Code

Re: [Freeipa-devel] [TESTS][PATCH 0010] WebUI tests - ID views

2016-03-08 Thread Lenka Doudova



On 03/08/2016 12:43 PM, Pavel Vomacka wrote:



On 02/23/2016 03:20 PM, Lenka Doudova wrote:

Hi,

attached is patch providing missing test coverage for ID views in webUI.

Lenka



Hi,

Thank you for your patch. I have small one comment: The 
delete_associtaion() function duplicates code, it would be good to 
create auxiliary function and move that code there. NACK.


--
Pavel^3 Vomacka



Hi,

thanks for review, fixed patch attached.

Lenka
From 1b705000574722e57850b51792254f8e1f96b88f Mon Sep 17 00:00:00 2001
From: Lenka Doudova 
Date: Fri, 19 Feb 2016 14:59:19 +0100
Subject: [PATCH] WebUI test: ID views

Provides missing test coverage for ID views web UI.
---
 ipatests/test_webui/data_idviews.py |  20 ++
 ipatests/test_webui/test_idviews.py | 127 
 ipatests/test_webui/ui_driver.py|  66 ++-
 3 files changed, 195 insertions(+), 18 deletions(-)
 create mode 100644 ipatests/test_webui/data_idviews.py
 create mode 100644 ipatests/test_webui/test_idviews.py

diff --git a/ipatests/test_webui/data_idviews.py b/ipatests/test_webui/data_idviews.py
new file mode 100644
index ..9d62f33fe47dcf2cbde525d687ddd80c50b367e0
--- /dev/null
+++ b/ipatests/test_webui/data_idviews.py
@@ -0,0 +1,20 @@
+#
+# Copyright (C) 2015  FreeIPA Contributors see COPYING for license
+#
+
+ENTITY = 'idview'
+USER_FACET = 'idoverrideuser'
+GROUP_FACET = 'idoverridegroup'
+HOST_FACET = 'appliedtohosts'
+
+PKEY = 'itest-view'
+DATA = {
+'pkey': PKEY,
+'add': [
+('textbox', 'cn', PKEY),
+('textarea', 'description', 'Description of ID view'),
+],
+'mod': [
+('textarea', 'description', 'Different description'),
+],
+}
diff --git a/ipatests/test_webui/test_idviews.py b/ipatests/test_webui/test_idviews.py
new file mode 100644
index ..b7f5c312eb2a5a7680b55126ae91446b5010a5b8
--- /dev/null
+++ b/ipatests/test_webui/test_idviews.py
@@ -0,0 +1,127 @@
+#
+# Copyright (C) 2015  FreeIPA Contributors see COPYING for license
+#
+
+from ipatests.test_webui.ui_driver import UI_driver
+from ipatests.test_webui.ui_driver import screenshot
+import ipatests.test_webui.data_idviews as idview
+import ipatests.test_webui.data_user as user
+import ipatests.test_webui.data_group as group
+import ipatests.test_webui.data_hostgroup as hostgroup
+from ipatests.test_webui.test_host import host_tasks, ENTITY as HOST_ENTITY
+import pytest
+
+DATA_USER = {
+'pkey': user.PKEY,
+'add': [
+('combobox', 'ipaanchoruuid', user.PKEY),
+('textbox', 'uid', 'iduser'),
+('textbox', 'gecos', 'id user'),
+('textbox', 'uidnumber', 1),
+('textbox', 'gidnumber', 1),
+('textbox', 'loginshell', 'shell'),
+('textbox', 'homedirectory', 'home'),
+('textarea', 'description', 'desc'),
+],
+'mod': [
+('textbox', 'uid', 'moduser'),
+('textbox', 'uidnumber', 3),
+],
+}
+
+DATA_GROUP = {
+'pkey': group.PKEY,
+'add': [
+('combobox', 'ipaanchoruuid', group.PKEY),
+('textbox', 'cn', 'idgroup'),
+('textbox', 'gidnumber', 2),
+('textarea', 'description', 'desc'),
+],
+'mod': [
+('textbox', 'cn', 'modgroup'),
+('textbox', 'gidnumber', 3),
+],
+}
+
+
+@pytest.mark.tier1
+class test_idviews(UI_driver):
+
+@screenshot
+def test_crud(self):
+"""
+Basic CRUD: ID view
+"""
+self.init_app()
+self.basic_crud(
+idview.ENTITY, idview.DATA, default_facet=idview.USER_FACET)
+
+@screenshot
+def test_overrides(self):
+"""
+User and group overrides
+"""
+self.init_app()
+
+self.add_record(user.ENTITY, user.DATA, navigate=False)
+self.add_record(group.ENTITY, group.DATA)
+self.add_record(idview.ENTITY, idview.DATA)
+
+self.navigate_to_record(idview.PKEY)
+parent_entity = 'idview'
+
+# user override
+self.add_record(parent_entity, DATA_USER, facet=idview.USER_FACET)
+self.navigate_to_record(user.PKEY)
+self.mod_record(idview.USER_FACET, DATA_USER)
+self.delete_action(idview.ENTITY, user.PKEY)
+
+# group override
+self.navigate_to_record(idview.PKEY)
+self.switch_to_facet(idview.GROUP_FACET)
+self.add_record(parent_entity, DATA_GROUP, facet=idview.GROUP_FACET)
+self.navigate_to_record(group.PKEY)
+self.mod_record(idview.GROUP_FACET, DATA_GROUP)
+self.delete_action(idview.ENTITY, group.PKEY)
+
+# cleanup
+self.delete(idview.ENTITY, [idview.DATA])
+self.delete(user.ENTITY, [user.DATA])
+self.delete(group.ENTITY, [group.DATA])
+
+@screenshot
+def test_hosts(self):
+"""
+Apply to hosts and host groups
+"""
+self.init_app()
+host = host_tasks()
+host.setup(self.

Re: [Freeipa-devel] [TESTS][PATCH 0010] WebUI tests - ID views

2016-03-08 Thread Pavel Vomacka



On 02/23/2016 03:20 PM, Lenka Doudova wrote:

Hi,

attached is patch providing missing test coverage for ID views in webUI.

Lenka



Hi,

Thank you for your patch. I have small one comment: The 
delete_associtaion() function duplicates code, it would be good to 
create auxiliary function and move that code there. NACK.


--
Pavel^3 Vomacka
-- 
Manage your subscription for the Freeipa-devel mailing list:
https://www.redhat.com/mailman/listinfo/freeipa-devel
Contribute to FreeIPA: http://www.freeipa.org/page/Contribute/Code