From 0382a98d30fc4f607ab2e72fe5f02ea7253a0d2d Mon Sep 17 00:00:00 2001 From: Menaka Jayawardena Date: Mon, 9 Jan 2017 12:59:26 +0530 Subject: [PATCH 1/5] Enabling Integration tests in parent pom --- pom.xml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index cb465bd1..d16132af 100644 --- a/pom.xml +++ b/pom.xml @@ -39,6 +39,7 @@ modules/core modules/analytics modules/distribution + modules/integration @@ -1104,7 +1105,7 @@ selenium-android-driver - test + compile com.opera From 52290cf485aa0baa9bd78f176894500708043564 Mon Sep 17 00:00:00 2001 From: Menaka Jayawardena Date: Mon, 9 Jan 2017 13:29:05 +0530 Subject: [PATCH 2/5] Disabling UI tests in build time by default. --- modules/integration/tests-iot-web-ui/pom.xml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/modules/integration/tests-iot-web-ui/pom.xml b/modules/integration/tests-iot-web-ui/pom.xml index 84e6b404..c1c52683 100644 --- a/modules/integration/tests-iot-web-ui/pom.xml +++ b/modules/integration/tests-iot-web-ui/pom.xml @@ -48,9 +48,9 @@ src/test/resources/testng.xml + ${skipTests} - true maven.test.haltafterfailure false @@ -267,5 +267,8 @@ + + true + From 370ed5fd98c7fbf0584a20945442a55a79cf5387 Mon Sep 17 00:00:00 2001 From: Menaka Jayawardena Date: Mon, 9 Jan 2017 14:06:05 +0530 Subject: [PATCH 3/5] Changing pom versions to match with parent. --- modules/integration/pom.xml | 2 +- modules/integration/tests-artifacts/pom.xml | 2 +- modules/integration/tests-common/admin-clients/pom.xml | 2 +- modules/integration/tests-common/integration-test-utils/pom.xml | 2 +- modules/integration/tests-common/pom.xml | 2 +- modules/integration/tests-common/ui-pages/pom.xml | 2 +- modules/integration/tests-common/web-ui-pages/pom.xml | 2 +- modules/integration/tests-integration-old/pom.xml | 2 +- modules/integration/tests-integration/pom.xml | 2 +- modules/integration/tests-iot-web-ui/pom.xml | 2 +- modules/integration/tests-platform/pom.xml | 2 +- modules/integration/tests-ui-integration/pom.xml | 2 +- 12 files changed, 12 insertions(+), 12 deletions(-) diff --git a/modules/integration/pom.xml b/modules/integration/pom.xml index 0e081ed9..e9ae64e3 100644 --- a/modules/integration/pom.xml +++ b/modules/integration/pom.xml @@ -23,7 +23,7 @@ org.wso2.iot wso2iot-parent - 3.0.1-SNAPSHOT + 3.0.0-SNAPSHOT ../../pom.xml diff --git a/modules/integration/tests-artifacts/pom.xml b/modules/integration/tests-artifacts/pom.xml index 821347eb..3892c74b 100644 --- a/modules/integration/tests-artifacts/pom.xml +++ b/modules/integration/tests-artifacts/pom.xml @@ -22,7 +22,7 @@ org.wso2.iot wso2iot-integration - 3.0.1-SNAPSHOT + 3.0.0-SNAPSHOT ../pom.xml diff --git a/modules/integration/tests-common/admin-clients/pom.xml b/modules/integration/tests-common/admin-clients/pom.xml index b914a906..49b77374 100644 --- a/modules/integration/tests-common/admin-clients/pom.xml +++ b/modules/integration/tests-common/admin-clients/pom.xml @@ -22,7 +22,7 @@ org.wso2.iot tests-common - 3.0.1-SNAPSHOT + 3.0.0-SNAPSHOT ../pom.xml diff --git a/modules/integration/tests-common/integration-test-utils/pom.xml b/modules/integration/tests-common/integration-test-utils/pom.xml index 066ecd95..cc62f18c 100644 --- a/modules/integration/tests-common/integration-test-utils/pom.xml +++ b/modules/integration/tests-common/integration-test-utils/pom.xml @@ -22,7 +22,7 @@ org.wso2.iot tests-common - 3.0.1-SNAPSHOT + 3.0.0-SNAPSHOT ../pom.xml diff --git a/modules/integration/tests-common/pom.xml b/modules/integration/tests-common/pom.xml index 8bb599fe..4692faac 100644 --- a/modules/integration/tests-common/pom.xml +++ b/modules/integration/tests-common/pom.xml @@ -21,7 +21,7 @@ org.wso2.iot wso2iot-integration - 3.0.1-SNAPSHOT + 3.0.0-SNAPSHOT ../pom.xml diff --git a/modules/integration/tests-common/ui-pages/pom.xml b/modules/integration/tests-common/ui-pages/pom.xml index eac92118..13d5dcd2 100644 --- a/modules/integration/tests-common/ui-pages/pom.xml +++ b/modules/integration/tests-common/ui-pages/pom.xml @@ -24,7 +24,7 @@ org.wso2.iot tests-common - 3.0.1-SNAPSHOT + 3.0.0-SNAPSHOT ../pom.xml diff --git a/modules/integration/tests-common/web-ui-pages/pom.xml b/modules/integration/tests-common/web-ui-pages/pom.xml index 6112b597..9a855057 100644 --- a/modules/integration/tests-common/web-ui-pages/pom.xml +++ b/modules/integration/tests-common/web-ui-pages/pom.xml @@ -24,7 +24,7 @@ org.wso2.iot tests-common - 3.0.1-SNAPSHOT + 3.0.0-SNAPSHOT ../pom.xml diff --git a/modules/integration/tests-integration-old/pom.xml b/modules/integration/tests-integration-old/pom.xml index 40c53944..aa4d7c95 100644 --- a/modules/integration/tests-integration-old/pom.xml +++ b/modules/integration/tests-integration-old/pom.xml @@ -23,7 +23,7 @@ org.wso2.iot wso2iot-integration - 3.0.1-SNAPSHOT + 3.0.0-SNAPSHOT ../pom.xml diff --git a/modules/integration/tests-integration/pom.xml b/modules/integration/tests-integration/pom.xml index 40c53944..aa4d7c95 100644 --- a/modules/integration/tests-integration/pom.xml +++ b/modules/integration/tests-integration/pom.xml @@ -23,7 +23,7 @@ org.wso2.iot wso2iot-integration - 3.0.1-SNAPSHOT + 3.0.0-SNAPSHOT ../pom.xml diff --git a/modules/integration/tests-iot-web-ui/pom.xml b/modules/integration/tests-iot-web-ui/pom.xml index c1c52683..5ac0f64b 100644 --- a/modules/integration/tests-iot-web-ui/pom.xml +++ b/modules/integration/tests-iot-web-ui/pom.xml @@ -22,7 +22,7 @@ org.wso2.iot wso2iot-integration - 3.0.1-SNAPSHOT + 3.0.0-SNAPSHOT ../pom.xml diff --git a/modules/integration/tests-platform/pom.xml b/modules/integration/tests-platform/pom.xml index 6c9618b8..e1dfefd0 100644 --- a/modules/integration/tests-platform/pom.xml +++ b/modules/integration/tests-platform/pom.xml @@ -21,7 +21,7 @@ org.wso2.iot wso2iot-integration - 3.0.1-SNAPSHOT + 3.0.0-SNAPSHOT ../pom.xml diff --git a/modules/integration/tests-ui-integration/pom.xml b/modules/integration/tests-ui-integration/pom.xml index 2852c1b2..e2f3503c 100644 --- a/modules/integration/tests-ui-integration/pom.xml +++ b/modules/integration/tests-ui-integration/pom.xml @@ -22,7 +22,7 @@ org.wso2.iot wso2iot-integration - 3.0.1-SNAPSHOT + 3.0.0-SNAPSHOT ../pom.xml From 07e7cb4a0aac2cf3e817ad6ed37faba7b1604707 Mon Sep 17 00:00:00 2001 From: madhawap Date: Mon, 9 Jan 2017 14:56:59 +0530 Subject: [PATCH 4/5] fixes to plugins-deployer.xml --- .../src/resources/plugins/plugins-deployer.xml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/modules/distribution/src/resources/plugins/plugins-deployer.xml b/modules/distribution/src/resources/plugins/plugins-deployer.xml index 66dee97a..834de06b 100644 --- a/modules/distribution/src/resources/plugins/plugins-deployer.xml +++ b/modules/distribution/src/resources/plugins/plugins-deployer.xml @@ -52,22 +52,22 @@ true - org.wso2.carbon.devicemgt-plugins:org.wso2.carbon.device.mgt.iot.androidsense.feature:/${carbon.device.mgt.plugin.version} + org.wso2.carbon.devicemgt-plugins:org.wso2.carbon.device.mgt.iot.androidsense.feature:\${carbon.device.mgt.plugin.version} - org.wso2.carbon.devicemgt-plugins:org.wso2.carbon.device.mgt.iot.arduino.feature:/${carbon.device.mgt.plugin.version} + org.wso2.carbon.devicemgt-plugins:org.wso2.carbon.device.mgt.iot.arduino.feature:\${carbon.device.mgt.plugin.version} - org.wso2.carbon.devicemgt-plugins:org.wso2.carbon.device.mgt.iot.raspberrypi.feature:/${carbon.device.mgt.plugin.version} + org.wso2.carbon.devicemgt-plugins:org.wso2.carbon.device.mgt.iot.raspberrypi.feature:\${carbon.device.mgt.plugin.version} - org.wso2.carbon.devicemgt-plugins:org.wso2.carbon.device.mgt.iot.virtualfirealarm.feature:/${carbon.device.mgt.plugin.version} + org.wso2.carbon.devicemgt-plugins:org.wso2.carbon.device.mgt.iot.virtualfirealarm.feature:\${carbon.device.mgt.plugin.version} - org.wso2.carbon.devicemgt-plugins:org.wso2.carbon.device.mgt.mobile.android.feature:/${carbon.device.mgt.plugin.version} + org.wso2.carbon.devicemgt-plugins:org.wso2.carbon.device.mgt.mobile.android.feature:\${carbon.device.mgt.plugin.version} - org.wso2.carbon.devicemgt-plugins:org.wso2.carbon.device.mgt.mobile.windows.feature:/${carbon.device.mgt.plugin.version} + org.wso2.carbon.devicemgt-plugins:org.wso2.carbon.device.mgt.mobile.windows.feature:\${carbon.device.mgt.plugin.version} From ae8aec6a4e08388b99eddfc568b70040f16eaf7c Mon Sep 17 00:00:00 2001 From: Menaka Jayawardena Date: Mon, 9 Jan 2017 16:59:05 +0530 Subject: [PATCH 5/5] Fixing the existing UI integration tests. --- .../ui/pages/groups/DeviceGroupsPage.java | 7 +++---- .../iot/integration/ui/pages/uesr/AddUserPage.java | 2 +- .../src/main/resources/mapper.properties | 14 +++++++------- .../tests-iot-web-ui/src/test/resources/testng.xml | 8 ++++---- 4 files changed, 15 insertions(+), 16 deletions(-) diff --git a/modules/integration/tests-common/web-ui-pages/src/main/java/org/wso2/iot/integration/ui/pages/groups/DeviceGroupsPage.java b/modules/integration/tests-common/web-ui-pages/src/main/java/org/wso2/iot/integration/ui/pages/groups/DeviceGroupsPage.java index 8a05cd55..becb12fa 100644 --- a/modules/integration/tests-common/web-ui-pages/src/main/java/org/wso2/iot/integration/ui/pages/groups/DeviceGroupsPage.java +++ b/modules/integration/tests-common/web-ui-pages/src/main/java/org/wso2/iot/integration/ui/pages/groups/DeviceGroupsPage.java @@ -41,8 +41,7 @@ public class DeviceGroupsPage { this.uiElementMapper = UIElementMapper.getInstance(); WebDriverWait webDriverWait = new WebDriverWait(driver, UIUtils.webDriverTimeOut); - if (!webDriverWait.until(ExpectedConditions.textToBePresentInElement(driver.findElement(By.xpath( - uiElementMapper.getElement("iot.device.groups.view.header.xpath"))), "GROUP"))) { + if (!webDriverWait.until(ExpectedConditions.titleContains(uiElementMapper.getElement("cdmf.groups.page")))) { throw new IllegalStateException("This is not the Groups page"); } } @@ -64,8 +63,8 @@ public class DeviceGroupsPage { * @return : True if the group is visible. False otherwise. */ public boolean isGroupCreated(String groupName) { - WebElement table = driver.findElement(By.id(uiElementMapper.getElement("iot.device.table.id"))); - List allGroupNames = table.findElements(By.tagName("h4")); + WebElement table = driver.findElement(By.xpath(uiElementMapper.getElement("iot.device.table.id"))); + List allGroupNames = table.findElements(By.tagName("td")); for (WebElement name : allGroupNames) { if (name.getText().contains(groupName)){ diff --git a/modules/integration/tests-common/web-ui-pages/src/main/java/org/wso2/iot/integration/ui/pages/uesr/AddUserPage.java b/modules/integration/tests-common/web-ui-pages/src/main/java/org/wso2/iot/integration/ui/pages/uesr/AddUserPage.java index 02fce92f..3305fbda 100644 --- a/modules/integration/tests-common/web-ui-pages/src/main/java/org/wso2/iot/integration/ui/pages/uesr/AddUserPage.java +++ b/modules/integration/tests-common/web-ui-pages/src/main/java/org/wso2/iot/integration/ui/pages/uesr/AddUserPage.java @@ -41,7 +41,7 @@ public class AddUserPage { this.uiElementMapper = UIElementMapper.getInstance(); WebDriverWait webDriverWait = new WebDriverWait(driver, UIUtils.webDriverTimeOut); - if (!webDriverWait.until(ExpectedConditions.titleContains("User Management | IoT Server"))) { + if (!webDriverWait.until(ExpectedConditions.titleContains(uiElementMapper.getElement("cdmf.user.add.page")))) { throw new IllegalStateException("This is not the Add User page"); } } diff --git a/modules/integration/tests-common/web-ui-pages/src/main/resources/mapper.properties b/modules/integration/tests-common/web-ui-pages/src/main/resources/mapper.properties index e212e65e..edba2fed 100644 --- a/modules/integration/tests-common/web-ui-pages/src/main/resources/mapper.properties +++ b/modules/integration/tests-common/web-ui-pages/src/main/resources/mapper.properties @@ -23,6 +23,7 @@ cdmf.register.page=Register | CDMF cdmf.error.page=Error | CDMF cdmf.user.home.page=Device Management | CDMF cdmf.groups.page=Group Management | CDMF +cdmf.user.add.page=User Management | Add User | CDMF # User registration and login details----------------------------------------------------------------------------------- @@ -105,11 +106,11 @@ iot.device.groups.view.header.xpath=/html/body/div[3]/div[2]/div/h1[1] #/html/body/div[3]/div[2]/div/div[3]/div/div/div[1]/label iot.device.groups.add.emptyfrom.error=/html/body/div[3]/div[2]/div/div[3]/div/div/div[1]/label -iot.device.table.id=group-grid +iot.device.table.id=//*[@id="ast-container"] #Add user -------------------------------------------------------------------------------------------------------------- -iot.admin.user.addButton.xpath=/html/body/div[3]/div[2]/div[1]/div[3]/div/div/div[2]/div[2]/span[2]/a[2]/span/i[2] -iot.admin.user.viewButton.xpath=/html/body/div[3]/div[2]/div[1]/div[3]/div/div/div[2]/div[2]/span[2]/a[1]/span/i[2] +iot.admin.user.addButton.xpath=/html/body/div[3]/div[2]/div/div[3]/div[3]/div/div[2]/div[2]/span[2]/a[2] +iot.admin.user.viewButton.xpath=/html/body/div[3]/div[2]/div/div[3]/div[3]/div/div[2]/div[2]/span[2]/a[1] iot.admin.user.added.page.subtitle.xpath="//p[@class='page-sub-title']" iot.admin.user.listing.page.subtitle.xpath="//span[@class='page-sub-title']" @@ -123,10 +124,9 @@ iot.admin.addUser.roles.id=roles iot.admin.addUser.add.btn.xpath=//*[@id="add-user-btn"] iot.admin.addUser.view.btn.xpath=//*[@id="user-created-msg"]/div/button -iot.admin.deleteUser.btn.xpath=//*[@id="user1"]/td[5]/a[3]/span[1]/i[2] -iot.admin.deleteUser.yes.link.xpath=//a[@id="remove-user-yes-link"] -iot.admin.deleteUser.success.link.xpath=//a[@id="remove-user-success-link"] - +iot.admin.deleteUser.btn.xpath=//*[@id="user-user1"]/td[5]/a[3]/span[1]/i[2] +iot.admin.deleteUser.yes.link.xpath=//*[@id="remove-user-yes-link"] +iot.admin.deleteUser.success.link.xpath=//*[@id="modal-footer-content"]/div/a iot.admin.addUser.formError.xpath=//*[@id="user-create-error-msg"] #----- User view page heading ------------------------------------------------------------------------------------------ diff --git a/modules/integration/tests-iot-web-ui/src/test/resources/testng.xml b/modules/integration/tests-iot-web-ui/src/test/resources/testng.xml index 5ff41446..73139933 100644 --- a/modules/integration/tests-iot-web-ui/src/test/resources/testng.xml +++ b/modules/integration/tests-iot-web-ui/src/test/resources/testng.xml @@ -31,10 +31,10 @@ - - - - + + + +