From d62915126646ccd0d28c7aed88b8f138bfd53bcc Mon Sep 17 00:00:00 2001 From: Serafym Tuhai Date: Mon, 26 Dec 2022 16:31:06 +0200 Subject: [PATCH 01/15] add tests on create and import device profiles --- .../server/msa/TestRestClient.java | 19 ++ .../msa/ui/base/AbstractDriverBaseTest.java | 6 + .../msa/ui/pages/OtherPageElements.java | 27 +++ .../msa/ui/pages/ProfilesPageElements.java | 93 +++++++++ .../msa/ui/pages/ProfilesPageHelper.java | 105 ++++++++++ .../msa/ui/pages/RuleChainsPageElements.java | 21 -- .../msa/ui/pages/SideBarMenuViewElements.java | 10 + .../msa/ui/pages/SideBarMenuViewHelper.java | 29 +++ .../CreateDeviceProfileImportTest.java | 98 ++++++++++ .../CreateDeviceProfileTest.java | 184 ++++++++++++++++++ .../CreateRuleChainImportTest.java | 2 +- .../server/msa/ui/utils/Const.java | 9 +- .../server/msa/ui/utils/EntityPrototypes.java | 18 ++ .../resources/deviceProfileForImport.json | 29 +++ ...forImport.json => ruleChainForImport.json} | 2 +- 15 files changed, 627 insertions(+), 25 deletions(-) create mode 100644 msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/pages/ProfilesPageElements.java create mode 100644 msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/pages/ProfilesPageHelper.java create mode 100644 msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/pages/SideBarMenuViewHelper.java create mode 100644 msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/tests/deviceProfileSmoke/CreateDeviceProfileImportTest.java create mode 100644 msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/tests/deviceProfileSmoke/CreateDeviceProfileTest.java create mode 100644 msa/black-box-tests/src/test/resources/deviceProfileForImport.json rename msa/black-box-tests/src/test/resources/{forImport.json => ruleChainForImport.json} (90%) diff --git a/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/TestRestClient.java b/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/TestRestClient.java index 46fed2c870..c809d926d2 100644 --- a/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/TestRestClient.java +++ b/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/TestRestClient.java @@ -278,6 +278,18 @@ public class TestRestClient { .as(JsonNode.class); } + public PageData getDeviceProfiles(PageLink pageLink) { + Map params = new HashMap<>(); + addPageLinkToParam(params, pageLink); + return given().spec(requestSpec).queryParams(params) + .get("/api/deviceProfiles") + .then() + .statusCode(HTTP_OK) + .extract() + .as(new TypeRef>() { + }); + } + public DeviceProfile getDeviceProfileById(DeviceProfileId deviceProfileId) { return given().spec(requestSpec).get("/api/deviceProfile/{deviceProfileId}", deviceProfileId.getId()) .then() @@ -296,6 +308,13 @@ public class TestRestClient { .as(DeviceProfile.class); } + public void deleteDeviseProfile(DeviceProfileId deviceProfileId) { + given().spec(requestSpec) + .delete("/api/deviceProfile/{deviceProfileId}", deviceProfileId.getId()) + .then() + .statusCode(HTTP_OK); + } + public Customer postCustomer(Customer customer) { return given().spec(requestSpec) .body(customer) diff --git a/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/base/AbstractDriverBaseTest.java b/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/base/AbstractDriverBaseTest.java index 121acb4e92..dfc27f7563 100644 --- a/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/base/AbstractDriverBaseTest.java +++ b/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/base/AbstractDriverBaseTest.java @@ -35,6 +35,7 @@ import org.openqa.selenium.support.ui.WebDriverWait; import org.testng.annotations.AfterMethod; import org.testng.annotations.BeforeMethod; import org.thingsboard.server.common.data.Customer; +import org.thingsboard.server.common.data.DeviceProfile; import org.thingsboard.server.common.data.page.PageLink; import org.thingsboard.server.common.data.rule.RuleChain; import org.thingsboard.server.msa.AbstractContainerTest; @@ -113,6 +114,11 @@ abstract public class AbstractDriverBaseTest extends AbstractContainerTest { .filter(x -> x.getName().equals(name)).collect(Collectors.toList()).get(0); } + public static DeviceProfile getDeviceProfileByName(String name) { + return testRestClient.getDeviceProfiles(pageLink).getData().stream() + .filter(x -> x.getName().equals(name)).collect(Collectors.toList()).get(0); + } + @SneakyThrows @Attachment(value = "Page screenshot", type = "image/png") public static byte[] captureScreen(WebDriver driver, String dirPath) { diff --git a/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/pages/OtherPageElements.java b/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/pages/OtherPageElements.java index b6ffd2a14e..ba81eae8f2 100644 --- a/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/pages/OtherPageElements.java +++ b/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/pages/OtherPageElements.java @@ -15,6 +15,7 @@ */ package org.thingsboard.server.msa.ui.pages; +import org.openqa.selenium.By; import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebElement; import org.thingsboard.server.msa.ui.base.AbstractBasePage; @@ -62,9 +63,14 @@ public class OtherPageElements extends AbstractBasePage { private static final String ERROR_MESSAGE = "//mat-error"; private static final String ENTITY_VIEW_TITLE = "//div[@class='tb-details-title']//span"; private static final String LIST_OF_ENTITY = "//div[@role='listbox']/mat-option"; + private static final String ENTITY_FROM_LIST = "//div[@role='listbox']/mat-option//span[contains(text(),'%s')]"; protected static final String ADD_ENTITY_VIEW = "//tb-add-entity-dialog"; protected static final String STATE_CONTROLLER = "//tb-entity-state-controller"; private static final String SEARCH_FIELD = "//input[contains (@data-placeholder,'Search')]"; + private static final String BROWSE_FILE = "//input[@class='file-input']"; + private static final String IMPORT_BROWSE_FILE = "//mat-dialog-container//span[contains(text(),'Import')]/.."; + private static final String IMPORTING_FILE = "//div[contains(text(),'%s')]"; + private static final String CLEAR_IMPORT_FILE_BTN = "//div[@class='tb-file-clear-container']//button"; public String getEntity(String entityName) { return String.format(ENTITY, entityName); @@ -235,6 +241,10 @@ public class OtherPageElements extends AbstractBasePage { return waitUntilElementsToBeClickable(LIST_OF_ENTITY); } + public WebElement entityFromList(String entityName) { + return waitUntilVisibilityOfElementLocated(String.format(ENTITY_FROM_LIST, entityName)); + } + public WebElement addEntityView() { return waitUntilVisibilityOfElementLocated(ADD_ENTITY_VIEW); } @@ -246,4 +256,21 @@ public class OtherPageElements extends AbstractBasePage { public WebElement searchField() { return waitUntilElementToBeClickable(SEARCH_FIELD); } + + public WebElement browseFile() { + waitUntilElementToBeClickable(BROWSE_FILE + "/preceding-sibling::button"); + return driver.findElement(By.xpath(BROWSE_FILE)); + } + + public WebElement importBrowseFileBtn() { + return waitUntilElementToBeClickable(IMPORT_BROWSE_FILE); + } + + public WebElement importingFile(String fileName) { + return waitUntilVisibilityOfElementLocated(String.format(IMPORTING_FILE, fileName)); + } + + public WebElement clearImportFileBtn() { + return waitUntilElementToBeClickable(CLEAR_IMPORT_FILE_BTN); + } } diff --git a/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/pages/ProfilesPageElements.java b/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/pages/ProfilesPageElements.java new file mode 100644 index 0000000000..47ff93fe23 --- /dev/null +++ b/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/pages/ProfilesPageElements.java @@ -0,0 +1,93 @@ +/** + * Copyright © 2016-2022 The Thingsboard Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.thingsboard.server.msa.ui.pages; + +import org.openqa.selenium.WebDriver; +import org.openqa.selenium.WebElement; +import org.w3c.dom.html.HTMLInputElement; + +public class ProfilesPageElements extends OtherPageElementsHelper { + public ProfilesPageElements(WebDriver driver) { + super(driver); + } + + private static final String CREATE_DEVICE_PROFILE_BTN = "//span[text()='Create new device profile']"; + private static final String IMPORT_PROFILE_BTN = "//span[text()='Import device profile']"; + private static final String ADD_DEVICE_PROFILE_VIEW = "//tb-add-device-profile-dialog"; + private static final String DEVICE_PROFILE_VIEW = "//tb-entity-details-panel"; + private static final String NAME_FIELD = "//input[@formcontrolname='name']"; + private static final String RULE_CHAIN_FIELD = "//input[@formcontrolname='ruleChainId']"; + private static final String DASHBOARD_FIELD = "//input[@formcontrolname='dashboard']"; + private static final String QUEUE_FIELD = "//input[@formcontrolname='queueName']"; + private static final String DESCRIPTION_FIELD = "//textarea[@formcontrolname='description']"; + private static final String ADD_DEVICE_PROFILE_ADD_BTN = ADD_DEVICE_PROFILE_VIEW + "//span[text() = 'Add']/.."; + + public WebElement createNewDeviceProfileBtn() { + return waitUntilElementToBeClickable(CREATE_DEVICE_PROFILE_BTN); + } + + public WebElement importDeviceProfileBtn() { + return waitUntilElementToBeClickable(IMPORT_PROFILE_BTN); + } + + public WebElement addDeviceProfileView() { + return waitUntilElementToBeClickable(ADD_DEVICE_PROFILE_VIEW); + } + + public WebElement addDeviceProfileNameField() { + return waitUntilElementToBeClickable(ADD_DEVICE_PROFILE_VIEW + NAME_FIELD); + } + + public WebElement profileViewNameField() { + return waitUntilVisibilityOfElementLocated(DEVICE_PROFILE_VIEW + NAME_FIELD); + } + + public WebElement addDeviceProfileRuleChainField() { + return waitUntilElementToBeClickable(ADD_DEVICE_PROFILE_VIEW + RULE_CHAIN_FIELD); + } + + public WebElement profileViewRuleChainField() { + return waitUntilVisibilityOfElementLocated(DEVICE_PROFILE_VIEW + RULE_CHAIN_FIELD); + } + + public WebElement addDeviceProfileMobileDashboardField() { + return waitUntilElementToBeClickable(ADD_DEVICE_PROFILE_VIEW + DASHBOARD_FIELD); + } + + public WebElement profileViewMobileDashboardField() { + return waitUntilVisibilityOfElementLocated(DEVICE_PROFILE_VIEW + DASHBOARD_FIELD); + } + + public WebElement addDeviceProfileQueueField() { + return waitUntilElementToBeClickable(ADD_DEVICE_PROFILE_VIEW + QUEUE_FIELD); + } + + public WebElement profileViewQueueField() { + return waitUntilVisibilityOfElementLocated(DEVICE_PROFILE_VIEW + QUEUE_FIELD); + } + + public WebElement addDeviceDescriptionField() { + return waitUntilElementToBeClickable(ADD_DEVICE_PROFILE_VIEW + DESCRIPTION_FIELD); + } + + public WebElement profileViewDescriptionField() { + return waitUntilVisibilityOfElementLocated(DEVICE_PROFILE_VIEW + DESCRIPTION_FIELD); + } + + public WebElement addDeviceProfileAddBtn() { + return waitUntilElementToBeClickable(ADD_DEVICE_PROFILE_ADD_BTN); + } +} \ No newline at end of file diff --git a/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/pages/ProfilesPageHelper.java b/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/pages/ProfilesPageHelper.java new file mode 100644 index 0000000000..0639f25bb8 --- /dev/null +++ b/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/pages/ProfilesPageHelper.java @@ -0,0 +1,105 @@ +/** + * Copyright © 2016-2022 The Thingsboard Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.thingsboard.server.msa.ui.pages; + +import org.openqa.selenium.WebDriver; + +public class ProfilesPageHelper extends ProfilesPageElements { + public ProfilesPageHelper(WebDriver driver) { + super(driver); + } + + private String name; + private String ruleChain; + private String mobileDashboard; + private String queue; + private String description; + + public void setName() { + this.name = profileViewNameField().getAttribute("value"); + } + + public void setRuleChain() { + this.ruleChain = profileViewRuleChainField().getAttribute("value"); + } + + public void setMobileDashboard() { + this.mobileDashboard = profileViewMobileDashboardField().getAttribute("value"); + } + + public void setQueue() { + this.queue = profileViewQueueField().getAttribute("value"); + } + + public void setDescription() { + this.description = profileViewDescriptionField().getAttribute("value"); + } + + public String getName() { + return this.name; + } + + public String getRuleChain() { + return this.ruleChain; + } + + public String getMobileDashboard() { + return this.mobileDashboard; + } + + public String getQueue() { + return this.queue; + } + + public String getDescription() { + return this.description; + } + + public void enterName(String name) { + addDeviceProfileNameField().click(); + addDeviceProfileNameField().sendKeys(name); + } + + public void chooseRuleChain(String ruleChain) { + addDeviceProfileRuleChainField().click(); + entityFromList(ruleChain).click(); + } + + public void chooseMobileDashboard(String mobileDashboard) { + addDeviceProfileMobileDashboardField().click(); + entityFromList(mobileDashboard).click(); + } + + public void chooseQueue(String queue) { + addDeviceProfileQueueField().click(); + entityFromList(queue).click(); + } + + public void enterDescription(String description) { + addDeviceDescriptionField().sendKeys(description); + } + + public void openCreateDeviceProfileView() { + plusBtn().click(); + createNewDeviceProfileBtn().click(); + } + + public void openImportDeviceProfileView() { + plusBtn().click(); + importDeviceProfileBtn().click(); + } +} + diff --git a/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/pages/RuleChainsPageElements.java b/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/pages/RuleChainsPageElements.java index eee95edcae..c4d8c448cc 100644 --- a/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/pages/RuleChainsPageElements.java +++ b/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/pages/RuleChainsPageElements.java @@ -35,10 +35,6 @@ public class RuleChainsPageElements extends OtherPageElementsHelper { private static final String RULE_CHAINS_NAMES_WITHOUT_ROOT = "//mat-icon[contains(text(),'check_box_outline_blank')]/../../../mat-cell[contains(@class,'name')]/span"; private static final String DELETE_RULE_CHAIN_FROM_VIEW_BTN = "//span[contains(text(),' Delete')]"; private static final String IMPORT_RULE_CHAIN_BTN = "//span[contains(text(),'Import rule chain')]"; - private static final String BROWSE_FILE = "//input[@class='file-input']"; - private static final String IMPORT_BROWSE_FILE = "//mat-dialog-container//span[contains(text(),'Import')]/.."; - private static final String IMPORTING_FILE = "//div[contains(text(),'%s')]"; - private static final String CLEAR_IMPORT_FILE_BTN = "//div[@class='tb-file-clear-container']//button"; private static final String OPEN_RULE_CHAIN = ENTITY + "/../..//mat-icon[contains(text(),' settings_ethernet')]"; private static final String OPEN_RULE_CHAIN_FROM_VIEW = "//span[contains(text(),'Open rule chain')]"; private static final String MAKE_ROOT_FROM_VIEW = "(//span[contains(text(),' Make rule chain root ')]/..)[1]"; @@ -85,23 +81,6 @@ public class RuleChainsPageElements extends OtherPageElementsHelper { return waitUntilElementToBeClickable(DELETE_RULE_CHAIN_FROM_VIEW_BTN); } - public WebElement browseFile() { - waitUntilElementToBeClickable(BROWSE_FILE + "/preceding-sibling::button"); - return driver.findElement(By.xpath(BROWSE_FILE)); - } - - public WebElement importBrowseFileBtn() { - return waitUntilElementToBeClickable(IMPORT_BROWSE_FILE); - } - - public WebElement importingFile(String fileName) { - return waitUntilVisibilityOfElementLocated(String.format(IMPORTING_FILE, fileName)); - } - - public WebElement clearImportFileBtn() { - return waitUntilElementToBeClickable(CLEAR_IMPORT_FILE_BTN); - } - public WebElement openRuleChainFromViewBtn() { return waitUntilElementToBeClickable(OPEN_RULE_CHAIN_FROM_VIEW); } diff --git a/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/pages/SideBarMenuViewElements.java b/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/pages/SideBarMenuViewElements.java index 902966a1ac..b62a7acfe0 100644 --- a/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/pages/SideBarMenuViewElements.java +++ b/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/pages/SideBarMenuViewElements.java @@ -27,6 +27,8 @@ public class SideBarMenuViewElements extends AbstractBasePage { private static final String RULE_CHAINS_BTN = "//mat-toolbar//a[@href='/ruleChains']"; private static final String CUSTOMER_BTN = "//mat-toolbar//a[@href='/customers']"; private static final String DASHBOARD_BTN = "//mat-toolbar//a[@href='/dashboards']"; + private static final String PROFILES_BTN = "//mat-toolbar//a[@href='/profiles']"; + private static final String DEVICE_PROFILE_BTN = "//mat-toolbar//a[@href='/profiles/deviceProfiles']"; public WebElement ruleChainsBtn() { return waitUntilElementToBeClickable(RULE_CHAINS_BTN); @@ -39,4 +41,12 @@ public class SideBarMenuViewElements extends AbstractBasePage { public WebElement dashboardBtn() { return waitUntilElementToBeClickable(DASHBOARD_BTN); } + + public WebElement profilesBtn() { + return waitUntilElementToBeClickable(PROFILES_BTN); + } + + public WebElement deviceProfileBtn() { + return waitUntilElementToBeClickable(DEVICE_PROFILE_BTN); + } } \ No newline at end of file diff --git a/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/pages/SideBarMenuViewHelper.java b/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/pages/SideBarMenuViewHelper.java new file mode 100644 index 0000000000..9179ef8aa8 --- /dev/null +++ b/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/pages/SideBarMenuViewHelper.java @@ -0,0 +1,29 @@ +/** + * Copyright © 2016-2022 The Thingsboard Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.thingsboard.server.msa.ui.pages; + +import org.openqa.selenium.WebDriver; + +public class SideBarMenuViewHelper extends SideBarMenuViewElements{ + public SideBarMenuViewHelper(WebDriver driver) { + super(driver); + } + + public void openDeviceProfiles() { + profilesBtn().click(); + deviceProfileBtn().click(); + } +} \ No newline at end of file diff --git a/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/tests/deviceProfileSmoke/CreateDeviceProfileImportTest.java b/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/tests/deviceProfileSmoke/CreateDeviceProfileImportTest.java new file mode 100644 index 0000000000..540b8581a8 --- /dev/null +++ b/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/tests/deviceProfileSmoke/CreateDeviceProfileImportTest.java @@ -0,0 +1,98 @@ +package org.thingsboard.server.msa.ui.tests.deviceProfileSmoke; + +import io.qameta.allure.Description; +import org.testng.Assert; +import org.testng.annotations.AfterMethod; +import org.testng.annotations.BeforeMethod; +import org.testng.annotations.Test; +import org.thingsboard.server.msa.ui.base.AbstractDriverBaseTest; +import org.thingsboard.server.msa.ui.pages.LoginPageHelper; +import org.thingsboard.server.msa.ui.pages.ProfilesPageHelper; +import org.thingsboard.server.msa.ui.pages.SideBarMenuViewHelper; + +import static org.thingsboard.server.msa.ui.utils.Const.EMPTY_IMPORT_MESSAGE; +import static org.thingsboard.server.msa.ui.utils.Const.ENTITY_NAME; +import static org.thingsboard.server.msa.ui.utils.Const.IMPORT_DEVICE_PROFILE_FILE_NAME; +import static org.thingsboard.server.msa.ui.utils.Const.IMPORT_DEVICE_PROFILE_NAME; +import static org.thingsboard.server.msa.ui.utils.Const.IMPORT_TXT_FILE_NAME; +import static org.thingsboard.server.msa.ui.utils.Const.TENANT_EMAIL; +import static org.thingsboard.server.msa.ui.utils.Const.TENANT_PASSWORD; + +public class CreateDeviceProfileImportTest extends AbstractDriverBaseTest { + + private SideBarMenuViewHelper sideBarMenuView; + private ProfilesPageHelper profilesPage; + private final String absolutePathToFileImportDeviceProfile = getClass().getClassLoader().getResource(IMPORT_DEVICE_PROFILE_FILE_NAME).getPath(); + private final String absolutePathToFileImportTxt = getClass().getClassLoader().getResource(IMPORT_TXT_FILE_NAME).getPath(); + private String name; + + + @BeforeMethod + public void login() { + openLocalhost(); + new LoginPageHelper(driver).authorizationTenant(); + testRestClient.login(TENANT_EMAIL, TENANT_PASSWORD); + sideBarMenuView = new SideBarMenuViewHelper(driver); + profilesPage = new ProfilesPageHelper(driver); + } + + @AfterMethod + public void delete() { + if (name != null) { + testRestClient.deleteDeviseProfile(getDeviceProfileByName(name).getId()); + name = null; + } + } + + @Test + public void importDeviceProfile() { + sideBarMenuView.openDeviceProfiles(); + profilesPage.openImportDeviceProfileView(); + profilesPage.browseFile().sendKeys(absolutePathToFileImportDeviceProfile); + profilesPage.importBrowseFileBtn().click(); + name = IMPORT_DEVICE_PROFILE_NAME; + profilesPage.refreshBtn().click(); + + Assert.assertNotNull(profilesPage.entity(IMPORT_DEVICE_PROFILE_NAME)); + Assert.assertTrue(profilesPage.entity(IMPORT_DEVICE_PROFILE_NAME).isDisplayed()); + } + + @Test + public void importTxtFile() { + sideBarMenuView.openDeviceProfiles(); + profilesPage.openImportDeviceProfileView(); + profilesPage.browseFile().sendKeys(absolutePathToFileImportTxt); + + Assert.assertNotNull(profilesPage.importingFile(EMPTY_IMPORT_MESSAGE)); + Assert.assertTrue(profilesPage.importingFile(EMPTY_IMPORT_MESSAGE).isDisplayed()); + } + + @Test(groups = "smoke") + @Description + public void addFileTiImportAndRemove() { + sideBarMenuView.openDeviceProfiles(); + profilesPage.openImportDeviceProfileView(); + profilesPage.browseFile().sendKeys(absolutePathToFileImportDeviceProfile); + profilesPage.clearImportFileBtn().click(); + + Assert.assertNotNull(profilesPage.importingFile(EMPTY_IMPORT_MESSAGE)); + Assert.assertTrue(profilesPage.importingFile(EMPTY_IMPORT_MESSAGE).isDisplayed()); + Assert.assertTrue(profilesPage.entityIsNotPresent(IMPORT_DEVICE_PROFILE_NAME)); + } + + @Test + public void importDeviceProfileWithSameName() { + String name = ENTITY_NAME; + testRestClient.postDeviceProfile() + + sideBarMenuView.openDeviceProfiles(); + profilesPage.openImportDeviceProfileView(); + profilesPage.browseFile().sendKeys(absolutePathToFileImportDeviceProfile); + profilesPage.importBrowseFileBtn().click(); + this.name = IMPORT_DEVICE_PROFILE_NAME; + profilesPage.refreshBtn().click(); + + Assert.assertNotNull(profilesPage.entity(IMPORT_DEVICE_PROFILE_NAME)); + Assert.assertTrue(profilesPage.entity(IMPORT_DEVICE_PROFILE_NAME).isDisplayed()); + } +} diff --git a/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/tests/deviceProfileSmoke/CreateDeviceProfileTest.java b/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/tests/deviceProfileSmoke/CreateDeviceProfileTest.java new file mode 100644 index 0000000000..31c895d939 --- /dev/null +++ b/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/tests/deviceProfileSmoke/CreateDeviceProfileTest.java @@ -0,0 +1,184 @@ +/** + * Copyright © 2016-2022 The Thingsboard Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.thingsboard.server.msa.ui.tests.deviceProfileSmoke; + +import io.qameta.allure.Description; +import org.openqa.selenium.Keys; +import org.testng.Assert; +import org.testng.annotations.AfterMethod; +import org.testng.annotations.BeforeMethod; +import org.testng.annotations.Test; +import org.thingsboard.server.msa.ui.base.AbstractDriverBaseTest; +import org.thingsboard.server.msa.ui.pages.LoginPageHelper; +import org.thingsboard.server.msa.ui.pages.ProfilesPageHelper; +import org.thingsboard.server.msa.ui.pages.SideBarMenuViewHelper; +import org.thingsboard.server.msa.ui.utils.EntityPrototypes; + +import static org.thingsboard.server.msa.ui.utils.Const.EMPTY_DEVICE_PROFILE_MESSAGE; +import static org.thingsboard.server.msa.ui.utils.Const.ENTITY_NAME; +import static org.thingsboard.server.msa.ui.utils.Const.NAME_IS_REQUIRED_MESSAGE; +import static org.thingsboard.server.msa.ui.utils.Const.SAME_NAME_WARNING_DEVICE_PROFILE_MESSAGE; +import static org.thingsboard.server.msa.ui.utils.Const.TENANT_EMAIL; +import static org.thingsboard.server.msa.ui.utils.Const.TENANT_PASSWORD; + +public class CreateDeviceProfileTest extends AbstractDriverBaseTest { + + private SideBarMenuViewHelper sideBarMenuView; + private ProfilesPageHelper profilesPage; + private String name; + + + @BeforeMethod + public void login() { + openLocalhost(); + new LoginPageHelper(driver).authorizationTenant(); + testRestClient.login(TENANT_EMAIL, TENANT_PASSWORD); + sideBarMenuView = new SideBarMenuViewHelper(driver); + profilesPage = new ProfilesPageHelper(driver); + } + + @AfterMethod + public void delete() { + if (name != null) { + testRestClient.deleteDeviseProfile(getDeviceProfileByName(name).getId()); + name = null; + } + } + + @Test + public void createDeviceProfile() { + String name = ENTITY_NAME; + + sideBarMenuView.openDeviceProfiles(); + profilesPage.openCreateDeviceProfileView(); + profilesPage.addDeviceProfileNameField().click(); + profilesPage.addDeviceProfileNameField().sendKeys(name); + profilesPage.addDeviceProfileAddBtn().click(); + this.name = name; + profilesPage.refreshBtn().click(); + + Assert.assertNotNull(profilesPage.entity(name)); + Assert.assertTrue(profilesPage.entity(name).isDisplayed()); + } + + @Test + public void createDeviceProfileWithDetails() { + String name = ENTITY_NAME; + String ruleChain = "Root Rule Chain"; + String mobileDashboard = "Firmware"; + String queue = "Main"; + String description = "Description"; + + sideBarMenuView.openDeviceProfiles(); + profilesPage.openCreateDeviceProfileView(); + profilesPage.enterName(name); + profilesPage.chooseRuleChain(ruleChain); + profilesPage.chooseMobileDashboard(mobileDashboard); + profilesPage.chooseQueue(queue); + profilesPage.enterDescription(description); + profilesPage.addDeviceProfileAddBtn().click(); + this.name = name; + profilesPage.refreshBtn().click(); + profilesPage.entity(name).click(); + profilesPage.setName(); + profilesPage.setRuleChain(); + profilesPage.setMobileDashboard(); + profilesPage.setQueue(); + profilesPage.setDescription(); + + Assert.assertNotNull(profilesPage.entity(name)); + Assert.assertTrue(profilesPage.entity(name).isDisplayed()); + Assert.assertEquals(name, profilesPage.getName()); + Assert.assertEquals(ruleChain, profilesPage.getRuleChain()); + Assert.assertEquals(mobileDashboard, profilesPage.getMobileDashboard()); + Assert.assertEquals(queue, profilesPage.getQueue()); + Assert.assertEquals(description, profilesPage.getDescription()); + } + + @Test + public void createDeviseProfileWithSameName() { + String name = ENTITY_NAME; + testRestClient.postDeviceProfile(EntityPrototypes.defaultDeviceProfile(name)); + this.name = name; + + sideBarMenuView.openDeviceProfiles(); + profilesPage.openCreateDeviceProfileView(); + profilesPage.addDeviceProfileNameField().click(); + profilesPage.addDeviceProfileNameField().sendKeys(name); + profilesPage.addDeviceProfileAddBtn().click(); + + Assert.assertNotNull(profilesPage.warningMessage()); + Assert.assertTrue(profilesPage.warningMessage().isDisplayed()); + Assert.assertEquals(profilesPage.warningMessage().getText(), SAME_NAME_WARNING_DEVICE_PROFILE_MESSAGE); + Assert.assertNotNull(profilesPage.addDeviceProfileView()); + Assert.assertTrue(profilesPage.addDeviceProfileView().isDisplayed()); + } + + @Test + public void createDeviceProfileWithoutName() { + sideBarMenuView.openDeviceProfiles(); + profilesPage.openCreateDeviceProfileView(); + profilesPage.addDeviceProfileAddBtn().click(); + + Assert.assertNotNull(profilesPage.addDeviceProfileView()); + Assert.assertTrue(profilesPage.addDeviceProfileView().isDisplayed()); + Assert.assertNotNull(profilesPage.errorMessage()); + Assert.assertEquals(profilesPage.errorMessage().getText(), NAME_IS_REQUIRED_MESSAGE); + } + + @Test + public void createDeviseProfileWithOnlySpaceInName() { + sideBarMenuView.openDeviceProfiles(); + profilesPage.openCreateDeviceProfileView(); + profilesPage.addDeviceProfileNameField().click(); + profilesPage.addDeviceProfileNameField().sendKeys(Keys.SPACE); + profilesPage.addDeviceProfileAddBtn().click(); + + Assert.assertNotNull(profilesPage.warningMessage()); + Assert.assertTrue(profilesPage.warningMessage().isDisplayed()); + Assert.assertEquals(profilesPage.warningMessage().getText(), EMPTY_DEVICE_PROFILE_MESSAGE); + Assert.assertNotNull(profilesPage.addDeviceProfileView()); + Assert.assertTrue(profilesPage.addDeviceProfileView().isDisplayed()); + } + + @Test + public void createDeviceProfileWithoutRefresh() { + String name = ENTITY_NAME; + + sideBarMenuView.openDeviceProfiles(); + profilesPage.openCreateDeviceProfileView(); + profilesPage.addDeviceProfileNameField().click(); + profilesPage.addDeviceProfileNameField().sendKeys(name); + profilesPage.addDeviceProfileAddBtn().click(); + this.name = name; + + Assert.assertNotNull(profilesPage.entity(name)); + Assert.assertTrue(profilesPage.entity(name).isDisplayed()); + } + + @Test(groups = "smoke") + @Description + public void documentation() { + String urlPath = "docs/user-guide/device-profiles/"; + + sideBarMenuView.openDeviceProfiles(); + profilesPage.allEntity().get(0).click(); + profilesPage.goToHelpPage(); + + Assert.assertTrue(urlContains(urlPath)); + } +} + diff --git a/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/tests/ruleChainsSmoke/CreateRuleChainImportTest.java b/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/tests/ruleChainsSmoke/CreateRuleChainImportTest.java index 27a4ea2ecb..2bc4875584 100644 --- a/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/tests/ruleChainsSmoke/CreateRuleChainImportTest.java +++ b/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/tests/ruleChainsSmoke/CreateRuleChainImportTest.java @@ -83,7 +83,7 @@ public class CreateRuleChainImportTest extends AbstractDriverBaseTest { Assert.assertNotNull(ruleChainsPage.importingFile(EMPTY_IMPORT_MESSAGE)); Assert.assertTrue(ruleChainsPage.importingFile(EMPTY_IMPORT_MESSAGE).isDisplayed()); - Assert.assertTrue(ruleChainsPage.entityIsNotPresent(IMPORT_TXT_FILE_NAME)); + Assert.assertTrue(ruleChainsPage.entityIsNotPresent(IMPORT_RULE_CHAIN_FILE_NAME)); } @Test(priority = 20, groups = "smoke") diff --git a/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/utils/Const.java b/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/utils/Const.java index 8868d53768..41c5e42424 100644 --- a/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/utils/Const.java +++ b/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/utils/Const.java @@ -25,13 +25,18 @@ public class Const { public static final String TENANT_PASSWORD = "tenant"; public static final String ENTITY_NAME = "Az!@#$%^&*()_-+=~`" + getRandomNumber(); public static final String ROOT_RULE_CHAIN_NAME = "Root Rule Chain"; - public static final String IMPORT_RULE_CHAIN_NAME = "Rule Chain from Import"; - public static final String IMPORT_RULE_CHAIN_FILE_NAME = "forImport.json"; + public static final String IMPORT_RULE_CHAIN_NAME = "Rule Chain For Import"; + public static final String IMPORT_DEVICE_PROFILE_NAME = "Device Profile For Import"; + public static final String IMPORT_RULE_CHAIN_FILE_NAME = "ruleChainForImport.json"; + public static final String IMPORT_DEVICE_PROFILE_FILE_NAME = "deviceProfileForImport.json"; public static final String IMPORT_TXT_FILE_NAME = "forImport.txt"; public static final String EMPTY_IMPORT_MESSAGE = "No file selected"; public static final String EMPTY_RULE_CHAIN_MESSAGE = "Rule chain name should be specified!"; public static final String EMPTY_CUSTOMER_MESSAGE = "Customer title should be specified!"; + public static final String EMPTY_DEVICE_PROFILE_MESSAGE = "Device profile name should be specified!"; public static final String DELETE_RULE_CHAIN_WITH_PROFILE_MESSAGE = "The rule chain referenced by the device profiles cannot be deleted!"; public static final String SAME_NAME_WARNING_CUSTOMER_MESSAGE = "Customer with such title already exists!"; + public static final String SAME_NAME_WARNING_DEVICE_PROFILE_MESSAGE = "Device profile with such name already exists!"; public static final String PHONE_NUMBER_ERROR_MESSAGE = "Phone number is invalid or not possible"; + public static final String NAME_IS_REQUIRED_MESSAGE = "Name is required."; } \ No newline at end of file diff --git a/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/utils/EntityPrototypes.java b/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/utils/EntityPrototypes.java index 5fcfe8f4f9..b26b547432 100644 --- a/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/utils/EntityPrototypes.java +++ b/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/utils/EntityPrototypes.java @@ -16,6 +16,12 @@ package org.thingsboard.server.msa.ui.utils; import org.thingsboard.server.common.data.Customer; +import org.thingsboard.server.common.data.DeviceProfile; +import org.thingsboard.server.common.data.DeviceProfileType; +import org.thingsboard.server.common.data.DeviceTransportType; +import org.thingsboard.server.common.data.device.profile.AllowCreateNewDevicesDeviceProfileProvisionConfiguration; +import org.thingsboard.server.common.data.device.profile.DefaultDeviceProfileTransportConfiguration; +import org.thingsboard.server.common.data.device.profile.DeviceProfileData; import org.thingsboard.server.common.data.rule.RuleChain; public class EntityPrototypes { @@ -31,4 +37,16 @@ public class EntityPrototypes { ruleChain.setName(entityName); return ruleChain; } + + public static DeviceProfile defaultDeviceProfile(String entityName){ + DeviceProfile deviceProfile = new DeviceProfile(); + deviceProfile.setName(entityName); + deviceProfile.setType(DeviceProfileType.DEFAULT); + deviceProfile.setTransportType(DeviceTransportType.DEFAULT); + DeviceProfileData deviceProfileData = new DeviceProfileData(); + deviceProfileData.setProvisionConfiguration( new AllowCreateNewDevicesDeviceProfileProvisionConfiguration("")); + deviceProfileData.setTransportConfiguration(new DefaultDeviceProfileTransportConfiguration()); + deviceProfile.setProfileData(deviceProfileData); + return deviceProfile; + } } diff --git a/msa/black-box-tests/src/test/resources/deviceProfileForImport.json b/msa/black-box-tests/src/test/resources/deviceProfileForImport.json new file mode 100644 index 0000000000..b2e1107945 --- /dev/null +++ b/msa/black-box-tests/src/test/resources/deviceProfileForImport.json @@ -0,0 +1,29 @@ +{ + "name": "Device Profile For Import", + "description": "", + "image": null, + "type": "DEFAULT", + "transportType": "DEFAULT", + "provisionType": "DISABLED", + "defaultRuleChainId": null, + "defaultDashboardId": null, + "defaultQueueName": null, + "profileData": { + "configuration": { + "type": "DEFAULT" + }, + "transportConfiguration": { + "type": "DEFAULT" + }, + "provisionConfiguration": { + "type": "DISABLED", + "provisionDeviceSecret": null + }, + "alarms": null + }, + "provisionDeviceKey": null, + "firmwareId": null, + "softwareId": null, + "externalId": null, + "default": false +} \ No newline at end of file diff --git a/msa/black-box-tests/src/test/resources/forImport.json b/msa/black-box-tests/src/test/resources/ruleChainForImport.json similarity index 90% rename from msa/black-box-tests/src/test/resources/forImport.json rename to msa/black-box-tests/src/test/resources/ruleChainForImport.json index 40367d7609..79d70375fe 100644 --- a/msa/black-box-tests/src/test/resources/forImport.json +++ b/msa/black-box-tests/src/test/resources/ruleChainForImport.json @@ -3,7 +3,7 @@ "additionalInfo": { "description": "" }, - "name": "Rule Chain from Import", + "name": "Rule Chain For Import", "type": "CORE", "firstRuleNodeId": null, "root": false, From 3b891e5d10ea169af10b60fadb0d47f34ed8aaa4 Mon Sep 17 00:00:00 2001 From: Serafym Tuhai Date: Mon, 26 Dec 2022 17:19:20 +0200 Subject: [PATCH 02/15] add tests on create and import device profiles --- .../msa/ui/pages/OtherPageElements.java | 2 +- .../CreateDeviceProfileImportTest.java | 22 +++++++++++++++---- 2 files changed, 19 insertions(+), 5 deletions(-) diff --git a/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/pages/OtherPageElements.java b/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/pages/OtherPageElements.java index ba81eae8f2..a70aae9fd1 100644 --- a/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/pages/OtherPageElements.java +++ b/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/pages/OtherPageElements.java @@ -34,7 +34,7 @@ public class OtherPageElements extends AbstractBasePage { private static final String WARNING_DELETE_POPUP_YES = "//tb-confirm-dialog//button[2]"; private static final String WARNING_DELETE_POPUP_TITLE = "//tb-confirm-dialog/h2"; private static final String REFRESH_BTN = "//mat-icon[contains(text(),'refresh')]/.."; - private static final String HELP_BTN = "//mat-icon[contains(text(),'help')]/.."; + private static final String HELP_BTN = "//mat-icon[contains(text(),'help')]/ancestor::button"; private static final String CHECKBOX = "//mat-row//span[contains(text(),'%s')]/../..//mat-checkbox"; private static final String CHECKBOXES = "//tbody//mat-checkbox"; private static final String DELETE_SELECTED_BTN = "//span[contains(text(),'selected')]//..//mat-icon/../.."; diff --git a/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/tests/deviceProfileSmoke/CreateDeviceProfileImportTest.java b/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/tests/deviceProfileSmoke/CreateDeviceProfileImportTest.java index 540b8581a8..421b8ed2c4 100644 --- a/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/tests/deviceProfileSmoke/CreateDeviceProfileImportTest.java +++ b/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/tests/deviceProfileSmoke/CreateDeviceProfileImportTest.java @@ -9,12 +9,13 @@ import org.thingsboard.server.msa.ui.base.AbstractDriverBaseTest; import org.thingsboard.server.msa.ui.pages.LoginPageHelper; import org.thingsboard.server.msa.ui.pages.ProfilesPageHelper; import org.thingsboard.server.msa.ui.pages.SideBarMenuViewHelper; +import org.thingsboard.server.msa.ui.utils.EntityPrototypes; import static org.thingsboard.server.msa.ui.utils.Const.EMPTY_IMPORT_MESSAGE; -import static org.thingsboard.server.msa.ui.utils.Const.ENTITY_NAME; import static org.thingsboard.server.msa.ui.utils.Const.IMPORT_DEVICE_PROFILE_FILE_NAME; import static org.thingsboard.server.msa.ui.utils.Const.IMPORT_DEVICE_PROFILE_NAME; import static org.thingsboard.server.msa.ui.utils.Const.IMPORT_TXT_FILE_NAME; +import static org.thingsboard.server.msa.ui.utils.Const.SAME_NAME_WARNING_DEVICE_PROFILE_MESSAGE; import static org.thingsboard.server.msa.ui.utils.Const.TENANT_EMAIL; import static org.thingsboard.server.msa.ui.utils.Const.TENANT_PASSWORD; @@ -82,16 +83,29 @@ public class CreateDeviceProfileImportTest extends AbstractDriverBaseTest { @Test public void importDeviceProfileWithSameName() { - String name = ENTITY_NAME; - testRestClient.postDeviceProfile() + String name = IMPORT_DEVICE_PROFILE_NAME; + testRestClient.postDeviceProfile(EntityPrototypes.defaultDeviceProfile(name)); + this.name = name; sideBarMenuView.openDeviceProfiles(); profilesPage.openImportDeviceProfileView(); profilesPage.browseFile().sendKeys(absolutePathToFileImportDeviceProfile); profilesPage.importBrowseFileBtn().click(); - this.name = IMPORT_DEVICE_PROFILE_NAME; profilesPage.refreshBtn().click(); + Assert.assertNotNull(profilesPage.warningMessage()); + Assert.assertTrue(profilesPage.warningMessage().isDisplayed()); + Assert.assertEquals(profilesPage.warningMessage().getText(), SAME_NAME_WARNING_DEVICE_PROFILE_MESSAGE); + } + + @Test + public void importDeviceProfileWithoutRefresh() { + sideBarMenuView.openDeviceProfiles(); + profilesPage.openImportDeviceProfileView(); + profilesPage.browseFile().sendKeys(absolutePathToFileImportDeviceProfile); + profilesPage.importBrowseFileBtn().click(); + name = IMPORT_DEVICE_PROFILE_NAME; + Assert.assertNotNull(profilesPage.entity(IMPORT_DEVICE_PROFILE_NAME)); Assert.assertTrue(profilesPage.entity(IMPORT_DEVICE_PROFILE_NAME).isDisplayed()); } From fc304404a5264479563fa304f65c0c6d551054a3 Mon Sep 17 00:00:00 2001 From: Serafym Tuhai Date: Tue, 27 Dec 2022 14:00:58 +0200 Subject: [PATCH 03/15] add tests on delete one device profiles --- .../server/msa/ui/base/AbstractBasePage.java | 9 ++ .../msa/ui/pages/OtherPageElements.java | 4 + .../msa/ui/pages/ProfilesPageElements.java | 9 ++ .../msa/ui/pages/ProfilesPageHelper.java | 9 +- .../DeleteDeviceProfileTest.java | 105 ++++++++++++++++++ .../DeviceProfileEditMenuTest.java | 65 +++++++++++ .../src/test/resources/smokesProfiles.xml | 35 ++++++ 7 files changed, 235 insertions(+), 1 deletion(-) create mode 100644 msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/tests/deviceProfileSmoke/DeleteDeviceProfileTest.java create mode 100644 msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/tests/deviceProfileSmoke/DeviceProfileEditMenuTest.java create mode 100644 msa/black-box-tests/src/test/resources/smokesProfiles.xml diff --git a/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/base/AbstractBasePage.java b/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/base/AbstractBasePage.java index 9e32d6e917..169d621773 100644 --- a/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/base/AbstractBasePage.java +++ b/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/base/AbstractBasePage.java @@ -56,6 +56,15 @@ abstract public class AbstractBasePage { } } + protected WebElement waitUntilPresenceOfElementLocated(String locator) { + try { + return wait.until(ExpectedConditions.presenceOfElementLocated(By.xpath(locator))); + } catch (WebDriverException e) { + log.error("No presence element: " + locator); + return null; + } + } + protected WebElement waitUntilElementToBeClickable(String locator) { try { return wait.until(ExpectedConditions.elementToBeClickable(By.xpath(locator))); diff --git a/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/pages/OtherPageElements.java b/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/pages/OtherPageElements.java index a70aae9fd1..f1714eec06 100644 --- a/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/pages/OtherPageElements.java +++ b/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/pages/OtherPageElements.java @@ -116,6 +116,10 @@ public class OtherPageElements extends AbstractBasePage { return waitUntilElementToBeClickable(String.format(CHECKBOX, entityName)); } + public WebElement presentCheckBox(String name) { + return waitUntilPresenceOfElementLocated(getCheckbox(name)); + } + public WebElement deleteSelectedBtn() { return waitUntilElementToBeClickable(DELETE_SELECTED_BTN); } diff --git a/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/pages/ProfilesPageElements.java b/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/pages/ProfilesPageElements.java index 47ff93fe23..16b986a159 100644 --- a/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/pages/ProfilesPageElements.java +++ b/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/pages/ProfilesPageElements.java @@ -34,6 +34,11 @@ public class ProfilesPageElements extends OtherPageElementsHelper { private static final String QUEUE_FIELD = "//input[@formcontrolname='queueName']"; private static final String DESCRIPTION_FIELD = "//textarea[@formcontrolname='description']"; private static final String ADD_DEVICE_PROFILE_ADD_BTN = ADD_DEVICE_PROFILE_VIEW + "//span[text() = 'Add']/.."; + private static final String DEVISE_PROFILE_VIEW_DELETE_BTN = "//tb-device-profile//span[contains(text(),'Delete')]"; + + protected String getDeviseProfileViewDeleteBtn() { + return DEVISE_PROFILE_VIEW_DELETE_BTN; + } public WebElement createNewDeviceProfileBtn() { return waitUntilElementToBeClickable(CREATE_DEVICE_PROFILE_BTN); @@ -90,4 +95,8 @@ public class ProfilesPageElements extends OtherPageElementsHelper { public WebElement addDeviceProfileAddBtn() { return waitUntilElementToBeClickable(ADD_DEVICE_PROFILE_ADD_BTN); } + + public WebElement deviceProfileViewDeleteBtn() { + return waitUntilElementToBeClickable(DEVISE_PROFILE_VIEW_DELETE_BTN); + } } \ No newline at end of file diff --git a/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/pages/ProfilesPageHelper.java b/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/pages/ProfilesPageHelper.java index 0639f25bb8..66afee2b44 100644 --- a/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/pages/ProfilesPageHelper.java +++ b/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/pages/ProfilesPageHelper.java @@ -15,7 +15,10 @@ */ package org.thingsboard.server.msa.ui.pages; +import org.openqa.selenium.By; import org.openqa.selenium.WebDriver; +import org.openqa.selenium.WebElement; +import org.openqa.selenium.support.ui.ExpectedConditions; public class ProfilesPageHelper extends ProfilesPageElements { public ProfilesPageHelper(WebDriver driver) { @@ -101,5 +104,9 @@ public class ProfilesPageHelper extends ProfilesPageElements { plusBtn().click(); importDeviceProfileBtn().click(); } -} + + public boolean deleteDeviceProfileFromViewBtnIsNotDisplayed() { + return wait.until(ExpectedConditions.invisibilityOfElementLocated(By.xpath(getDeviseProfileViewDeleteBtn()))); + } + } diff --git a/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/tests/deviceProfileSmoke/DeleteDeviceProfileTest.java b/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/tests/deviceProfileSmoke/DeleteDeviceProfileTest.java new file mode 100644 index 0000000000..e2ef96c5cd --- /dev/null +++ b/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/tests/deviceProfileSmoke/DeleteDeviceProfileTest.java @@ -0,0 +1,105 @@ +package org.thingsboard.server.msa.ui.tests.deviceProfileSmoke; + +import org.testng.Assert; +import org.testng.annotations.BeforeMethod; +import org.testng.annotations.Test; +import org.thingsboard.server.msa.ui.base.AbstractDriverBaseTest; +import org.thingsboard.server.msa.ui.pages.LoginPageHelper; +import org.thingsboard.server.msa.ui.pages.ProfilesPageHelper; +import org.thingsboard.server.msa.ui.pages.SideBarMenuViewHelper; +import org.thingsboard.server.msa.ui.utils.EntityPrototypes; + +import static org.thingsboard.server.msa.ui.utils.Const.ENTITY_NAME; +import static org.thingsboard.server.msa.ui.utils.Const.TENANT_EMAIL; +import static org.thingsboard.server.msa.ui.utils.Const.TENANT_PASSWORD; + +public class DeleteDeviceProfileTest extends AbstractDriverBaseTest { + + private SideBarMenuViewHelper sideBarMenuView; + private ProfilesPageHelper profilesPage; + + @BeforeMethod + public void login() { + openLocalhost(); + new LoginPageHelper(driver).authorizationTenant(); + testRestClient.login(TENANT_EMAIL, TENANT_PASSWORD); + sideBarMenuView = new SideBarMenuViewHelper(driver); + profilesPage = new ProfilesPageHelper(driver); + } + + @Test + public void removeDeviceProfile() { + String name = ENTITY_NAME; + testRestClient.postDeviceProfile(EntityPrototypes.defaultDeviceProfile(name)); + + sideBarMenuView.openDeviceProfiles(); + profilesPage.deleteBtn(name).click(); + profilesPage.warningPopUpYesBtn().click(); + profilesPage.refreshBtn(); + + Assert.assertTrue(profilesPage.entityIsNotPresent(name)); + } + + @Test + public void removeDeviceProfileFromView() { + String name = ENTITY_NAME; + testRestClient.postDeviceProfile(EntityPrototypes.defaultDeviceProfile(name)); + + sideBarMenuView.openDeviceProfiles(); + profilesPage.entity(name).click(); + profilesPage.deviceProfileViewDeleteBtn().click(); + profilesPage.warningPopUpYesBtn().click(); + profilesPage.refreshBtn(); + + Assert.assertTrue(profilesPage.entityIsNotPresent(name)); + } + + @Test + public void removeSelectedDeviceProfile() { + String name = ENTITY_NAME; + testRestClient.postDeviceProfile(EntityPrototypes.defaultDeviceProfile(name)); + + sideBarMenuView.openDeviceProfiles(); + profilesPage.checkBox(name).click(); + profilesPage.deleteSelectedBtn().click(); + profilesPage.warningPopUpYesBtn().click(); + profilesPage.refreshBtn(); + + Assert.assertTrue(profilesPage.entityIsNotPresent(name)); + } + + @Test + public void removeDefaultDeviceProfile() { + sideBarMenuView.openDeviceProfiles(); + + Assert.assertFalse(profilesPage.deleteBtn("default").isEnabled()); + } + + @Test + public void removeDefaultDeviceProfileFromView() { + sideBarMenuView.openDeviceProfiles(); + profilesPage.entity("default").click(); + + Assert.assertTrue(profilesPage.deleteDeviceProfileFromViewBtnIsNotDisplayed()); + } + + @Test + public void removeSelectedDefaultDeviceProfile() { + sideBarMenuView.openDeviceProfiles(); + + Assert.assertNotNull(profilesPage.presentCheckBox("default")); + Assert.assertFalse(profilesPage.presentCheckBox("default").isDisplayed()); + } + + @Test + public void removeDeviceProfileWithoutRefresh() { + String name = ENTITY_NAME; + testRestClient.postDeviceProfile(EntityPrototypes.defaultDeviceProfile(name)); + + sideBarMenuView.openDeviceProfiles(); + profilesPage.deleteBtn(name).click(); + profilesPage.warningPopUpYesBtn().click(); + + Assert.assertTrue(profilesPage.entityIsNotPresent(name)); + } +} diff --git a/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/tests/deviceProfileSmoke/DeviceProfileEditMenuTest.java b/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/tests/deviceProfileSmoke/DeviceProfileEditMenuTest.java new file mode 100644 index 0000000000..deb30959d3 --- /dev/null +++ b/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/tests/deviceProfileSmoke/DeviceProfileEditMenuTest.java @@ -0,0 +1,65 @@ +package org.thingsboard.server.msa.ui.tests.deviceProfileSmoke; + +import io.qameta.allure.Description; +import org.testng.Assert; +import org.testng.annotations.AfterMethod; +import org.testng.annotations.BeforeMethod; +import org.testng.annotations.Test; +import org.thingsboard.server.msa.ui.base.AbstractDriverBaseTest; +import org.thingsboard.server.msa.ui.pages.LoginPageHelper; +import org.thingsboard.server.msa.ui.pages.ProfilesPageHelper; +import org.thingsboard.server.msa.ui.pages.SideBarMenuViewHelper; +import org.thingsboard.server.msa.ui.utils.EntityPrototypes; + +import static org.thingsboard.server.msa.ui.base.AbstractBasePage.getRandomNumber; +import static org.thingsboard.server.msa.ui.utils.Const.ENTITY_NAME; +import static org.thingsboard.server.msa.ui.utils.Const.TENANT_EMAIL; +import static org.thingsboard.server.msa.ui.utils.Const.TENANT_PASSWORD; +import static org.thingsboard.server.msa.ui.utils.EntityPrototypes.defaultCustomerPrototype; + +public class DeviceProfileEditMenuTest extends AbstractDriverBaseTest { + + private SideBarMenuViewHelper sideBarMenuView; + private ProfilesPageHelper profilesPage; + private String name; + + @BeforeMethod + public void login() { + openLocalhost(); + new LoginPageHelper(driver).authorizationTenant(); + testRestClient.login(TENANT_EMAIL, TENANT_PASSWORD); + sideBarMenuView = new SideBarMenuViewHelper(driver); + profilesPage = new ProfilesPageHelper(driver); + } + + @AfterMethod + public void delete() { + if (name != null) { + testRestClient.deleteDeviseProfile(getDeviceProfileByName(name).getId()); + name = null; + } + } + + @Test(priority = 10, groups = "smoke") + @Description + public void changeTitle() { + String name = ENTITY_NAME; + String newName = "Changed" + getRandomNumber(); + testRestClient.postDeviceProfile(EntityPrototypes.defaultDeviceProfile(name)); + this.name = name; + + sideBarMenuView.customerBtn().click(); + profilesPage.entity(name).click(); + profilesPage.setHeaderName(); + String titleBefore = profilesPage.getHeaderName(); + profilesPage.editPencilBtn().click(); + profilesPage.changeNameEditMenu(newName); + profilesPage.doneBtnEditView().click(); + profilesPage.setHeaderName(); + String titleAfter = profilesPage.getHeaderName(); + + + Assert.assertNotEquals(titleBefore, titleAfter); + Assert.assertEquals(titleAfter, newName); + } +} diff --git a/msa/black-box-tests/src/test/resources/smokesProfiles.xml b/msa/black-box-tests/src/test/resources/smokesProfiles.xml new file mode 100644 index 0000000000..0cd79e4c79 --- /dev/null +++ b/msa/black-box-tests/src/test/resources/smokesProfiles.xml @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + + + + + + \ No newline at end of file From 4c58de79495b0efb2048ee6f67fbf4e000df4352 Mon Sep 17 00:00:00 2001 From: Serafym Tuhai Date: Wed, 4 Jan 2023 18:01:50 +0200 Subject: [PATCH 04/15] add tests on search and sort device profiles --- .../server/msa/TestProperties.java | 2 +- .../server/msa/ui/base/AbstractBasePage.java | 16 +++ .../msa/ui/base/AbstractDriverBaseTest.java | 8 ++ .../msa/ui/pages/ProfilesPageElements.java | 8 +- .../msa/ui/pages/ProfilesPageHelper.java | 28 +++- .../CreateDeviceProfileImportTest.java | 15 ++ .../CreateDeviceProfileTest.java | 3 +- .../DeleteDeviceProfileTest.java | 15 ++ .../DeviceProfileEditMenuTest.java | 76 +++++++++- .../SearchDeviceProfileTest.java | 67 +++++++++ .../deviceProfileSmoke/SortByNameTest.java | 132 ++++++++++++++++++ .../msa/ui/utils/DataProviderCredential.java | 22 +++ .../server/msa/ui/utils/EntityPrototypes.java | 23 ++- .../src/test/resources/config.properties | 3 +- .../src/test/resources/smokesProfiles.xml | 2 +- 15 files changed, 407 insertions(+), 13 deletions(-) create mode 100644 msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/tests/deviceProfileSmoke/SearchDeviceProfileTest.java create mode 100644 msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/tests/deviceProfileSmoke/SortByNameTest.java diff --git a/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/TestProperties.java b/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/TestProperties.java index b5d91647c1..aac6748781 100644 --- a/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/TestProperties.java +++ b/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/TestProperties.java @@ -43,7 +43,7 @@ public class TestProperties { if (instance.isActive()) { return "https://host.docker.internal"; } - return getProperties().getProperty("tb.baseUrl"); + return getProperties().getProperty("tb.baseUiUrl"); } public static String getWebSocketUrl() { diff --git a/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/base/AbstractBasePage.java b/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/base/AbstractBasePage.java index 169d621773..dc8f5eadfe 100644 --- a/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/base/AbstractBasePage.java +++ b/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/base/AbstractBasePage.java @@ -18,6 +18,7 @@ package org.thingsboard.server.msa.ui.base; import lombok.SneakyThrows; import lombok.extern.slf4j.Slf4j; import org.openqa.selenium.By; +import org.openqa.selenium.JavascriptExecutor; import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebDriverException; import org.openqa.selenium.WebElement; @@ -35,11 +36,14 @@ abstract public class AbstractBasePage { protected WebDriver driver; protected WebDriverWait wait; protected Actions actions; + protected JavascriptExecutor js; + public AbstractBasePage(WebDriver driver) { this.driver = driver; this.wait = new WebDriverWait(driver, Duration.ofMillis(5000)); this.actions = new Actions(driver); + this.js = (JavascriptExecutor) driver; } @SneakyThrows @@ -134,6 +138,18 @@ abstract public class AbstractBasePage { } } + public void jsClick(WebElement element) { + js.executeScript("arguments[0].click();", element); + } + + public void scrollToElement(WebElement element) { + js.executeScript("arguments[0].scrollIntoView(true);", element); + } + + public void waitUntilAttributeContains(WebElement element, String attribute, String value) { + wait.until(ExpectedConditions.attributeContains(element, attribute, value)); + } + public void goToNextTab(int tabNumber) { waitUntilNumberOfTabToBe(tabNumber); ArrayList tabs = new ArrayList<>(driver.getWindowHandles()); diff --git a/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/base/AbstractDriverBaseTest.java b/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/base/AbstractDriverBaseTest.java index dfc27f7563..b8678912f7 100644 --- a/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/base/AbstractDriverBaseTest.java +++ b/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/base/AbstractDriverBaseTest.java @@ -22,10 +22,12 @@ import lombok.SneakyThrows; import lombok.extern.slf4j.Slf4j; import org.apache.commons.io.FileUtils; import org.openqa.selenium.Dimension; +import org.openqa.selenium.JavascriptExecutor; import org.openqa.selenium.OutputType; import org.openqa.selenium.TakesScreenshot; import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebDriverException; +import org.openqa.selenium.WebElement; import org.openqa.selenium.chrome.ChromeDriver; import org.openqa.selenium.chrome.ChromeOptions; import org.openqa.selenium.remote.LocalFileDetector; @@ -58,6 +60,7 @@ abstract public class AbstractDriverBaseTest extends AbstractContainerTest { private static final String REMOTE_WEBDRIVER_HOST = "http://localhost:4444"; protected static final PageLink pageLink = new PageLink(10); private static final ContainerTestSuite instance = ContainerTestSuite.getInstance(); + private JavascriptExecutor js; @SneakyThrows @BeforeMethod @@ -104,6 +107,11 @@ abstract public class AbstractDriverBaseTest extends AbstractContainerTest { return driver.getCurrentUrl().contains(urlPath); } + public void jsClick(WebElement element) { + js = (JavascriptExecutor) driver; + js.executeScript("arguments[0].click();", element); + } + public static RuleChain getRuleChainByName(String name) { return testRestClient.getRuleChains(pageLink).getData().stream() .filter(s -> s.getName().equals(name)).collect(Collectors.toList()).get(0); diff --git a/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/pages/ProfilesPageElements.java b/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/pages/ProfilesPageElements.java index 16b986a159..0dde961ac9 100644 --- a/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/pages/ProfilesPageElements.java +++ b/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/pages/ProfilesPageElements.java @@ -17,7 +17,8 @@ package org.thingsboard.server.msa.ui.pages; import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebElement; -import org.w3c.dom.html.HTMLInputElement; + +import java.util.List; public class ProfilesPageElements extends OtherPageElementsHelper { public ProfilesPageElements(WebDriver driver) { @@ -35,6 +36,7 @@ public class ProfilesPageElements extends OtherPageElementsHelper { private static final String DESCRIPTION_FIELD = "//textarea[@formcontrolname='description']"; private static final String ADD_DEVICE_PROFILE_ADD_BTN = ADD_DEVICE_PROFILE_VIEW + "//span[text() = 'Add']/.."; private static final String DEVISE_PROFILE_VIEW_DELETE_BTN = "//tb-device-profile//span[contains(text(),'Delete')]"; + private static final String PROFILE_NAMES = "//tbody/mat-row/mat-cell[contains(@class,'name')]"; protected String getDeviseProfileViewDeleteBtn() { return DEVISE_PROFILE_VIEW_DELETE_BTN; @@ -99,4 +101,8 @@ public class ProfilesPageElements extends OtherPageElementsHelper { public WebElement deviceProfileViewDeleteBtn() { return waitUntilElementToBeClickable(DEVISE_PROFILE_VIEW_DELETE_BTN); } + + public List profileNames() { + return waitUntilElementsToBeClickable(PROFILE_NAMES); + } } \ No newline at end of file diff --git a/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/pages/ProfilesPageHelper.java b/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/pages/ProfilesPageHelper.java index 66afee2b44..b9d9f53608 100644 --- a/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/pages/ProfilesPageHelper.java +++ b/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/pages/ProfilesPageHelper.java @@ -16,8 +16,8 @@ package org.thingsboard.server.msa.ui.pages; import org.openqa.selenium.By; +import org.openqa.selenium.JavascriptExecutor; import org.openqa.selenium.WebDriver; -import org.openqa.selenium.WebElement; import org.openqa.selenium.support.ui.ExpectedConditions; public class ProfilesPageHelper extends ProfilesPageElements { @@ -30,6 +30,7 @@ public class ProfilesPageHelper extends ProfilesPageElements { private String mobileDashboard; private String queue; private String description; + private String profile; public void setName() { this.name = profileViewNameField().getAttribute("value"); @@ -48,9 +49,18 @@ public class ProfilesPageHelper extends ProfilesPageElements { } public void setDescription() { + scrollToElement(profileViewDescriptionField()); this.description = profileViewDescriptionField().getAttribute("value"); } + public void setProfileName() { + this.profile = profileNames().get(0).getText(); + } + + public void setProfileName(int number) { + this.profile = profileNames().get(number).getText(); + } + public String getName() { return this.name; } @@ -71,6 +81,10 @@ public class ProfilesPageHelper extends ProfilesPageElements { return this.description; } + public String getProfileName() { + return this.profile; + } + public void enterName(String name) { addDeviceProfileNameField().click(); addDeviceProfileNameField().sendKeys(name); @@ -89,6 +103,7 @@ public class ProfilesPageHelper extends ProfilesPageElements { public void chooseQueue(String queue) { addDeviceProfileQueueField().click(); entityFromList(queue).click(); + waitUntilAttributeContains(addDeviceProfileQueueField(), "aria-expanded", "false"); } public void enterDescription(String description) { @@ -108,5 +123,14 @@ public class ProfilesPageHelper extends ProfilesPageElements { public boolean deleteDeviceProfileFromViewBtnIsNotDisplayed() { return wait.until(ExpectedConditions.invisibilityOfElementLocated(By.xpath(getDeviseProfileViewDeleteBtn()))); } - } + + public void goToProfileHelpPage() { + jsClick(helpBtn()); + goToNextTab(2); + } + + public void sortByNameDown() { + doubleClick(sortByNameBtn()); + } +} diff --git a/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/tests/deviceProfileSmoke/CreateDeviceProfileImportTest.java b/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/tests/deviceProfileSmoke/CreateDeviceProfileImportTest.java index 421b8ed2c4..e9a7d4e171 100644 --- a/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/tests/deviceProfileSmoke/CreateDeviceProfileImportTest.java +++ b/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/tests/deviceProfileSmoke/CreateDeviceProfileImportTest.java @@ -1,3 +1,18 @@ +/** + * Copyright © 2016-2022 The Thingsboard Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.thingsboard.server.msa.ui.tests.deviceProfileSmoke; import io.qameta.allure.Description; diff --git a/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/tests/deviceProfileSmoke/CreateDeviceProfileTest.java b/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/tests/deviceProfileSmoke/CreateDeviceProfileTest.java index 31c895d939..b03858d65d 100644 --- a/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/tests/deviceProfileSmoke/CreateDeviceProfileTest.java +++ b/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/tests/deviceProfileSmoke/CreateDeviceProfileTest.java @@ -16,6 +16,7 @@ package org.thingsboard.server.msa.ui.tests.deviceProfileSmoke; import io.qameta.allure.Description; +import org.openqa.selenium.JavascriptExecutor; import org.openqa.selenium.Keys; import org.testng.Assert; import org.testng.annotations.AfterMethod; @@ -176,7 +177,7 @@ public class CreateDeviceProfileTest extends AbstractDriverBaseTest { sideBarMenuView.openDeviceProfiles(); profilesPage.allEntity().get(0).click(); - profilesPage.goToHelpPage(); + profilesPage.goToProfileHelpPage(); Assert.assertTrue(urlContains(urlPath)); } diff --git a/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/tests/deviceProfileSmoke/DeleteDeviceProfileTest.java b/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/tests/deviceProfileSmoke/DeleteDeviceProfileTest.java index e2ef96c5cd..409a94c4e1 100644 --- a/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/tests/deviceProfileSmoke/DeleteDeviceProfileTest.java +++ b/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/tests/deviceProfileSmoke/DeleteDeviceProfileTest.java @@ -1,3 +1,18 @@ +/** + * Copyright © 2016-2022 The Thingsboard Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.thingsboard.server.msa.ui.tests.deviceProfileSmoke; import org.testng.Assert; diff --git a/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/tests/deviceProfileSmoke/DeviceProfileEditMenuTest.java b/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/tests/deviceProfileSmoke/DeviceProfileEditMenuTest.java index deb30959d3..f1ac6c6d8f 100644 --- a/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/tests/deviceProfileSmoke/DeviceProfileEditMenuTest.java +++ b/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/tests/deviceProfileSmoke/DeviceProfileEditMenuTest.java @@ -1,3 +1,18 @@ +/** + * Copyright © 2016-2022 The Thingsboard Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.thingsboard.server.msa.ui.tests.deviceProfileSmoke; import io.qameta.allure.Description; @@ -9,13 +24,14 @@ import org.thingsboard.server.msa.ui.base.AbstractDriverBaseTest; import org.thingsboard.server.msa.ui.pages.LoginPageHelper; import org.thingsboard.server.msa.ui.pages.ProfilesPageHelper; import org.thingsboard.server.msa.ui.pages.SideBarMenuViewHelper; +import org.thingsboard.server.msa.ui.utils.DataProviderCredential; import org.thingsboard.server.msa.ui.utils.EntityPrototypes; import static org.thingsboard.server.msa.ui.base.AbstractBasePage.getRandomNumber; +import static org.thingsboard.server.msa.ui.utils.Const.EMPTY_DEVICE_PROFILE_MESSAGE; import static org.thingsboard.server.msa.ui.utils.Const.ENTITY_NAME; import static org.thingsboard.server.msa.ui.utils.Const.TENANT_EMAIL; import static org.thingsboard.server.msa.ui.utils.Const.TENANT_PASSWORD; -import static org.thingsboard.server.msa.ui.utils.EntityPrototypes.defaultCustomerPrototype; public class DeviceProfileEditMenuTest extends AbstractDriverBaseTest { @@ -42,24 +58,74 @@ public class DeviceProfileEditMenuTest extends AbstractDriverBaseTest { @Test(priority = 10, groups = "smoke") @Description - public void changeTitle() { + public void changeName() { String name = ENTITY_NAME; String newName = "Changed" + getRandomNumber(); testRestClient.postDeviceProfile(EntityPrototypes.defaultDeviceProfile(name)); this.name = name; - sideBarMenuView.customerBtn().click(); + sideBarMenuView.openDeviceProfiles(); profilesPage.entity(name).click(); profilesPage.setHeaderName(); String titleBefore = profilesPage.getHeaderName(); - profilesPage.editPencilBtn().click(); + jsClick(profilesPage.editPencilBtn()); profilesPage.changeNameEditMenu(newName); profilesPage.doneBtnEditView().click(); + this.name = newName; profilesPage.setHeaderName(); String titleAfter = profilesPage.getHeaderName(); - Assert.assertNotEquals(titleBefore, titleAfter); Assert.assertEquals(titleAfter, newName); } + + @Test(priority = 10, groups = "smoke") + @Description + public void deleteName() { + String name = ENTITY_NAME; + testRestClient.postDeviceProfile(EntityPrototypes.defaultDeviceProfile(name)); + this.name = name; + + sideBarMenuView.openDeviceProfiles(); + profilesPage.entity(name).click(); + jsClick(profilesPage.editPencilBtn()); + profilesPage.changeNameEditMenu(""); + + Assert.assertFalse(profilesPage.doneBtnEditViewVisible().isEnabled()); + } + + @Test(priority = 10, groups = "smoke") + @Description + public void saveWithOnlySpaceInName() { + String name = ENTITY_NAME; + testRestClient.postDeviceProfile(EntityPrototypes.defaultDeviceProfile(name)); + this.name = name; + + sideBarMenuView.openDeviceProfiles(); + profilesPage.entity(name).click(); + jsClick(profilesPage.editPencilBtn()); + profilesPage.changeNameEditMenu(" "); + profilesPage.doneBtnEditView().click(); + + Assert.assertNotNull(profilesPage.warningMessage()); + Assert.assertTrue(profilesPage.warningMessage().isDisplayed()); + Assert.assertEquals(profilesPage.warningMessage().getText(), EMPTY_DEVICE_PROFILE_MESSAGE); + } + + @Test(priority = 10, groups = "smoke", dataProviderClass = DataProviderCredential.class, dataProvider = "editMenuDescription") + @Description + public void editDescription(String description, String newDescription, String finalDescription) { + String name = ENTITY_NAME; + testRestClient.postDeviceProfile(EntityPrototypes.defaultDeviceProfile(name, description)); + this.name = name; + + sideBarMenuView.openDeviceProfiles(); + profilesPage.entity(name).click(); + jsClick(profilesPage.editPencilBtn()); + profilesPage.profileViewDescriptionField().sendKeys(newDescription); + profilesPage.doneBtnEditView().click(); + profilesPage.setDescription(); + + Assert.assertEquals(profilesPage.getDescription(), finalDescription); + } } diff --git a/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/tests/deviceProfileSmoke/SearchDeviceProfileTest.java b/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/tests/deviceProfileSmoke/SearchDeviceProfileTest.java new file mode 100644 index 0000000000..350d11b865 --- /dev/null +++ b/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/tests/deviceProfileSmoke/SearchDeviceProfileTest.java @@ -0,0 +1,67 @@ +/** + * Copyright © 2016-2022 The Thingsboard Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.thingsboard.server.msa.ui.tests.deviceProfileSmoke; + +import io.qameta.allure.Description; +import org.testng.Assert; +import org.testng.annotations.AfterMethod; +import org.testng.annotations.BeforeMethod; +import org.testng.annotations.Test; +import org.thingsboard.server.msa.ui.base.AbstractDriverBaseTest; +import org.thingsboard.server.msa.ui.pages.LoginPageHelper; +import org.thingsboard.server.msa.ui.pages.ProfilesPageHelper; +import org.thingsboard.server.msa.ui.pages.SideBarMenuViewHelper; +import org.thingsboard.server.msa.ui.utils.DataProviderCredential; + +import static org.thingsboard.server.msa.ui.utils.Const.TENANT_EMAIL; +import static org.thingsboard.server.msa.ui.utils.Const.TENANT_PASSWORD; +import static org.thingsboard.server.msa.ui.utils.EntityPrototypes.defaultDeviceProfile; + +public class SearchDeviceProfileTest extends AbstractDriverBaseTest { + + private SideBarMenuViewHelper sideBarMenuView; + private ProfilesPageHelper profilesPage; + private String name; + + @BeforeMethod + public void login() { + openLocalhost(); + new LoginPageHelper(driver).authorizationTenant(); + testRestClient.login(TENANT_EMAIL, TENANT_PASSWORD); + sideBarMenuView = new SideBarMenuViewHelper(driver); + profilesPage = new ProfilesPageHelper(driver); + } + + @AfterMethod + public void delete() { + if (name != null) { + testRestClient.deleteDeviseProfile(getDeviceProfileByName(name).getId()); + name = null; + } + } + + @Test(priority = 10, groups = "smoke", dataProviderClass = DataProviderCredential.class, dataProvider = "deviceProfileSearch") + @Description + public void searchFirstWord(String name, String namePath) { + testRestClient.postDeviceProfile(defaultDeviceProfile(name)); + this.name = name; + + sideBarMenuView.openDeviceProfiles(); + profilesPage.searchEntity(namePath); + + profilesPage.allEntity().forEach(x -> Assert.assertTrue(x.getText().contains(namePath))); + } +} diff --git a/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/tests/deviceProfileSmoke/SortByNameTest.java b/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/tests/deviceProfileSmoke/SortByNameTest.java new file mode 100644 index 0000000000..45e824a4bc --- /dev/null +++ b/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/tests/deviceProfileSmoke/SortByNameTest.java @@ -0,0 +1,132 @@ +/** + * Copyright © 2016-2022 The Thingsboard Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.thingsboard.server.msa.ui.tests.deviceProfileSmoke; + +import io.qameta.allure.Description; +import org.testng.Assert; +import org.testng.annotations.AfterMethod; +import org.testng.annotations.BeforeMethod; +import org.testng.annotations.Test; +import org.thingsboard.server.msa.ui.base.AbstractDriverBaseTest; +import org.thingsboard.server.msa.ui.pages.LoginPageHelper; +import org.thingsboard.server.msa.ui.pages.ProfilesPageHelper; +import org.thingsboard.server.msa.ui.pages.SideBarMenuViewHelper; +import org.thingsboard.server.msa.ui.utils.DataProviderCredential; + +import static org.thingsboard.server.msa.ui.utils.Const.TENANT_EMAIL; +import static org.thingsboard.server.msa.ui.utils.Const.TENANT_PASSWORD; +import static org.thingsboard.server.msa.ui.utils.EntityPrototypes.defaultCustomerPrototype; +import static org.thingsboard.server.msa.ui.utils.EntityPrototypes.defaultDeviceProfile; + +public class SortByNameTest extends AbstractDriverBaseTest { + private SideBarMenuViewHelper sideBarMenuView; + private ProfilesPageHelper profilesPage; + private String name; + + @BeforeMethod + public void login() { + openLocalhost(); + new LoginPageHelper(driver).authorizationTenant(); + testRestClient.login(TENANT_EMAIL, TENANT_PASSWORD); + sideBarMenuView = new SideBarMenuViewHelper(driver); + profilesPage = new ProfilesPageHelper(driver); + } + + @AfterMethod + public void delete() { + if (name != null) { + testRestClient.deleteDeviseProfile(getDeviceProfileByName(name).getId()); + name = null; + } + } + + @Test(priority = 10, groups = "smoke", dataProviderClass = DataProviderCredential.class, dataProvider = "nameForSort") + @Description + public void specialCharacterUp(String name) { + testRestClient.postDeviceProfile(defaultDeviceProfile(name)); + this.name = name; + + sideBarMenuView.openDeviceProfiles(); + profilesPage.sortByNameBtn().click(); + profilesPage.setProfileName(); + + Assert.assertEquals(profilesPage.getProfileName(), name); + } + + @Test(priority = 20, groups = "smoke", dataProviderClass = DataProviderCredential.class, dataProvider = "nameForAllSort") + @Description + public void allSortUp(String deviceProfile, String deviceProfileSymbol, String deviceProfileNumber) { + testRestClient.postDeviceProfile(defaultDeviceProfile(deviceProfileSymbol)); + testRestClient.postDeviceProfile(defaultDeviceProfile(deviceProfile)); + testRestClient.postDeviceProfile(defaultDeviceProfile(deviceProfileNumber)); + + sideBarMenuView.openDeviceProfiles(); + profilesPage.sortByNameBtn().click(); + profilesPage.setProfileName(0); + String firstDeviceProfile = profilesPage.getProfileName(); + profilesPage.setProfileName(1); + String secondDeviceProfile = profilesPage.getProfileName(); + profilesPage.setProfileName(2); + String thirdDeviceProfile = profilesPage.getProfileName(); + + testRestClient.deleteDeviseProfile(getDeviceProfileByName(deviceProfile).getId()); + testRestClient.deleteDeviseProfile(getDeviceProfileByName(deviceProfileNumber).getId()); + testRestClient.deleteDeviseProfile(getDeviceProfileByName(deviceProfileSymbol).getId()); + + Assert.assertEquals(firstDeviceProfile, deviceProfileSymbol); + Assert.assertEquals(secondDeviceProfile, deviceProfileNumber); + Assert.assertEquals(thirdDeviceProfile, deviceProfile); + } + + @Test(priority = 10, groups = "smoke", dataProviderClass = DataProviderCredential.class, dataProvider = "nameForSort") + @Description + public void specialCharacterDown(String name) { + testRestClient.postDeviceProfile(defaultDeviceProfile(name)); + this.name = name; + + sideBarMenuView.openDeviceProfiles(); + profilesPage.sortByNameDown(); + profilesPage.setProfileName(profilesPage.allEntity().size() - 1); + + Assert.assertEquals(profilesPage.getProfileName(), name); + } + + @Test(priority = 20, groups = "smoke", dataProviderClass = DataProviderCredential.class, dataProvider = "nameForAllSort") + @Description + public void allSortDown(String deviceProfile, String deviceProfileSymbol, String deviceProfileNumber) { + testRestClient.postDeviceProfile(defaultDeviceProfile(deviceProfileSymbol)); + testRestClient.postDeviceProfile(defaultDeviceProfile(deviceProfile)); + testRestClient.postDeviceProfile(defaultDeviceProfile(deviceProfileNumber)); + + sideBarMenuView.openDeviceProfiles(); + int lastIndex = profilesPage.allEntity().size() - 1; + profilesPage.sortByNameDown(); + profilesPage.setProfileName(lastIndex); + String firstDeviceProfile = profilesPage.getProfileName(); + profilesPage.setProfileName(lastIndex - 1); + String secondDeviceProfile = profilesPage.getProfileName(); + profilesPage.setProfileName(lastIndex - 2); + String thirdDeviceProfile = profilesPage.getProfileName(); + + testRestClient.deleteDeviseProfile(getDeviceProfileByName(deviceProfile).getId()); + testRestClient.deleteDeviseProfile(getDeviceProfileByName(deviceProfileNumber).getId()); + testRestClient.deleteDeviseProfile(getDeviceProfileByName(deviceProfileSymbol).getId()); + + Assert.assertEquals(firstDeviceProfile, deviceProfileSymbol); + Assert.assertEquals(secondDeviceProfile, deviceProfileNumber); + Assert.assertEquals(thirdDeviceProfile, deviceProfile); + } +} diff --git a/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/utils/DataProviderCredential.java b/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/utils/DataProviderCredential.java index 5536338fe5..70e393bd9d 100644 --- a/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/utils/DataProviderCredential.java +++ b/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/utils/DataProviderCredential.java @@ -15,8 +15,10 @@ */ package org.thingsboard.server.msa.ui.utils; +import org.openqa.selenium.Keys; import org.testng.annotations.DataProvider; +import static org.thingsboard.server.msa.ui.base.AbstractBasePage.getRandomNumber; import static org.thingsboard.server.msa.ui.base.AbstractBasePage.getRandomSymbol; import static org.thingsboard.server.msa.ui.utils.Const.ENTITY_NAME; @@ -31,6 +33,7 @@ public class DataProviderCredential { private static final String CUSTOMER_SECOND_WORD_NAME_PATH = "Customer"; private static final String RULE_CHAIN_FIRST_WORD_NAME_PATH = "Root"; private static final String CUSTOMER_FIRST_WORD_NAME_PATH = "A"; + private static final String DEFAULT_DEVICE_PROFILE_NAME = "Device Profile"; @DataProvider public static Object[][] ruleChainNameForSearchByFirstAndSecondWord() { @@ -74,4 +77,23 @@ public class DataProviderCredential { {CUSTOMER_FIRST_WORD_NAME_PATH}, {CUSTOMER_SECOND_WORD_NAME_PATH}}; } + + @DataProvider + public static Object[][] deviceProfileSearch() { + return new Object[][]{ + {DEFAULT_DEVICE_PROFILE_NAME, DEFAULT_DEVICE_PROFILE_NAME.split(" ")[0]}, + {DEFAULT_DEVICE_PROFILE_NAME, DEFAULT_DEVICE_PROFILE_NAME.split(" ")[1]}, + {NAME, ENTITY_NAME.split("`")[1]}, + {NAME, String.valueOf(getRandomSymbol())}}; + } + + @DataProvider + public static Object[][] editMenuDescription() { + String newDescription = "Description" + getRandomNumber(); + String description = "Description"; + return new Object[][]{ + {"", newDescription, newDescription}, + {description, newDescription, description + newDescription}, + {description, Keys.CONTROL + "A" + Keys.BACK_SPACE, ""}}; + } } diff --git a/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/utils/EntityPrototypes.java b/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/utils/EntityPrototypes.java index b26b547432..bc1e8d3190 100644 --- a/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/utils/EntityPrototypes.java +++ b/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/utils/EntityPrototypes.java @@ -17,11 +17,15 @@ package org.thingsboard.server.msa.ui.utils; import org.thingsboard.server.common.data.Customer; import org.thingsboard.server.common.data.DeviceProfile; +import org.thingsboard.server.common.data.DeviceProfileProvisionType; import org.thingsboard.server.common.data.DeviceProfileType; import org.thingsboard.server.common.data.DeviceTransportType; import org.thingsboard.server.common.data.device.profile.AllowCreateNewDevicesDeviceProfileProvisionConfiguration; +import org.thingsboard.server.common.data.device.profile.DefaultDeviceProfileConfiguration; import org.thingsboard.server.common.data.device.profile.DefaultDeviceProfileTransportConfiguration; +import org.thingsboard.server.common.data.device.profile.DeviceProfileConfiguration; import org.thingsboard.server.common.data.device.profile.DeviceProfileData; +import org.thingsboard.server.common.data.device.profile.DisabledDeviceProfileProvisionConfiguration; import org.thingsboard.server.common.data.rule.RuleChain; public class EntityPrototypes { @@ -43,8 +47,25 @@ public class EntityPrototypes { deviceProfile.setName(entityName); deviceProfile.setType(DeviceProfileType.DEFAULT); deviceProfile.setTransportType(DeviceTransportType.DEFAULT); + deviceProfile.setProvisionType(DeviceProfileProvisionType.DISABLED); DeviceProfileData deviceProfileData = new DeviceProfileData(); - deviceProfileData.setProvisionConfiguration( new AllowCreateNewDevicesDeviceProfileProvisionConfiguration("")); + deviceProfileData.setConfiguration(new DefaultDeviceProfileConfiguration()); + deviceProfileData.setProvisionConfiguration(new DisabledDeviceProfileProvisionConfiguration(null)); + deviceProfileData.setTransportConfiguration(new DefaultDeviceProfileTransportConfiguration()); + deviceProfile.setProfileData(deviceProfileData); + return deviceProfile; + } + + public static DeviceProfile defaultDeviceProfile(String entityName, String description){ + DeviceProfile deviceProfile = new DeviceProfile(); + deviceProfile.setName(entityName); + deviceProfile.setDescription(description); + deviceProfile.setType(DeviceProfileType.DEFAULT); + deviceProfile.setTransportType(DeviceTransportType.DEFAULT); + deviceProfile.setProvisionType(DeviceProfileProvisionType.DISABLED); + DeviceProfileData deviceProfileData = new DeviceProfileData(); + deviceProfileData.setConfiguration(new DefaultDeviceProfileConfiguration()); + deviceProfileData.setProvisionConfiguration(new DisabledDeviceProfileProvisionConfiguration(null)); deviceProfileData.setTransportConfiguration(new DefaultDeviceProfileTransportConfiguration()); deviceProfile.setProfileData(deviceProfileData); return deviceProfile; diff --git a/msa/black-box-tests/src/test/resources/config.properties b/msa/black-box-tests/src/test/resources/config.properties index 419c73185d..4d8a0880a9 100644 --- a/msa/black-box-tests/src/test/resources/config.properties +++ b/msa/black-box-tests/src/test/resources/config.properties @@ -1,2 +1,3 @@ tb.baseUrl=http://localhost:8080 -tb.wsUrl=ws://localhost:8080 +tb.baseUiUrl=http://localhost:8080 +tb.wsUrl=ws://localhost:8080 \ No newline at end of file diff --git a/msa/black-box-tests/src/test/resources/smokesProfiles.xml b/msa/black-box-tests/src/test/resources/smokesProfiles.xml index 0cd79e4c79..43dd2b917a 100644 --- a/msa/black-box-tests/src/test/resources/smokesProfiles.xml +++ b/msa/black-box-tests/src/test/resources/smokesProfiles.xml @@ -1,7 +1,7 @@