add tests on device profiles, asset profiles, fix older tests
This commit is contained in:
parent
788af91dc2
commit
8fbd83aefb
@ -29,6 +29,8 @@ import io.restassured.specification.RequestSpecification;
|
||||
import org.thingsboard.server.common.data.Customer;
|
||||
import org.thingsboard.server.common.data.Device;
|
||||
import org.thingsboard.server.common.data.DeviceProfile;
|
||||
import org.thingsboard.server.common.data.asset.AssetProfile;
|
||||
import org.thingsboard.server.common.data.id.AssetProfileId;
|
||||
import org.thingsboard.server.common.data.id.CustomerId;
|
||||
import org.thingsboard.server.common.data.id.DeviceId;
|
||||
import org.thingsboard.server.common.data.id.DeviceProfileId;
|
||||
@ -322,6 +324,41 @@ public class TestRestClient {
|
||||
.statusCode(HTTP_OK);
|
||||
}
|
||||
|
||||
public AssetProfile postAssetProfile(AssetProfile assetProfile) {
|
||||
return given().spec(requestSpec).body(assetProfile)
|
||||
.post("/api/assetProfile")
|
||||
.then()
|
||||
.statusCode(HTTP_OK)
|
||||
.extract()
|
||||
.as(AssetProfile.class);
|
||||
}
|
||||
|
||||
public PageData<AssetProfile> getAssetProfiles(PageLink pageLink) {
|
||||
Map<String, String> params = new HashMap<>();
|
||||
addPageLinkToParam(params, pageLink);
|
||||
return given().spec(requestSpec).queryParams(params)
|
||||
.get("/api/assetProfiles")
|
||||
.then()
|
||||
.statusCode(HTTP_OK)
|
||||
.extract()
|
||||
.as(new TypeRef<PageData<AssetProfile>>() {
|
||||
});
|
||||
}
|
||||
|
||||
public void deleteAssetProfile(AssetProfileId assetProfileId) {
|
||||
given().spec(requestSpec)
|
||||
.delete("/api/assetProfile/{assetProfileId}", assetProfileId.getId())
|
||||
.then()
|
||||
.statusCode(HTTP_OK);
|
||||
}
|
||||
|
||||
public void setDefaultAssetProfile(AssetProfileId assetProfileId) {
|
||||
given().spec(requestSpec)
|
||||
.post("/api/assetProfile/{assetProfileId}/default", assetProfileId.getId())
|
||||
.then()
|
||||
.statusCode(HTTP_OK);
|
||||
}
|
||||
|
||||
public Customer postCustomer(Customer customer) {
|
||||
return given().spec(requestSpec)
|
||||
.body(customer)
|
||||
|
||||
@ -142,6 +142,11 @@ abstract public class AbstractBasePage {
|
||||
js.executeScript("arguments[0].click();", element);
|
||||
}
|
||||
|
||||
public void enterText(WebElement element, CharSequence keysToEnter) {
|
||||
element.click();
|
||||
element.sendKeys(keysToEnter);
|
||||
}
|
||||
|
||||
public void scrollToElement(WebElement element) {
|
||||
js.executeScript("arguments[0].scrollIntoView(true);", element);
|
||||
}
|
||||
|
||||
@ -38,6 +38,7 @@ 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.asset.AssetProfile;
|
||||
import org.thingsboard.server.common.data.page.PageLink;
|
||||
import org.thingsboard.server.common.data.rule.RuleChain;
|
||||
import org.thingsboard.server.msa.AbstractContainerTest;
|
||||
@ -49,6 +50,8 @@ import java.time.Duration;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static org.thingsboard.server.msa.TestProperties.getBaseUiUrl;
|
||||
import static org.thingsboard.server.msa.ui.utils.Const.TENANT_EMAIL;
|
||||
import static org.thingsboard.server.msa.ui.utils.Const.TENANT_PASSWORD;
|
||||
|
||||
@Slf4j
|
||||
abstract public class AbstractDriverBaseTest extends AbstractContainerTest {
|
||||
@ -66,6 +69,7 @@ abstract public class AbstractDriverBaseTest extends AbstractContainerTest {
|
||||
@BeforeMethod
|
||||
public void openBrowser() {
|
||||
log.info("===>>> Setup driver");
|
||||
testRestClient.login(TENANT_EMAIL, TENANT_PASSWORD);
|
||||
ChromeOptions options = new ChromeOptions();
|
||||
options.setAcceptInsecureCerts(true);
|
||||
if (instance.isActive()) {
|
||||
@ -77,6 +81,7 @@ abstract public class AbstractDriverBaseTest extends AbstractContainerTest {
|
||||
driver = new ChromeDriver(options);
|
||||
}
|
||||
driver.manage().window().setSize(dimension);
|
||||
openLocalhost();
|
||||
}
|
||||
|
||||
@AfterMethod
|
||||
@ -142,6 +147,16 @@ abstract public class AbstractDriverBaseTest extends AbstractContainerTest {
|
||||
}
|
||||
}
|
||||
|
||||
public static AssetProfile getAssetProfileByName(String name) {
|
||||
try {
|
||||
return testRestClient.getAssetProfiles(pageLink).getData().stream()
|
||||
.filter(x -> x.getName().equals(name)).collect(Collectors.toList()).get(0);
|
||||
} catch (Exception e) {
|
||||
log.error("No such asset profile with name: " + name);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@SneakyThrows
|
||||
@Attachment(value = "Page screenshot", type = "image/png")
|
||||
public static byte[] captureScreen(WebDriver driver, String dirPath) {
|
||||
|
||||
@ -30,7 +30,7 @@ public class CustomerPageHelper extends CustomerPageElements {
|
||||
private String country;
|
||||
private String dashboard;
|
||||
private String dashboardFromView;
|
||||
|
||||
private String description;
|
||||
private String customerEmail;
|
||||
private String customerCountry;
|
||||
private String customerCity;
|
||||
@ -63,6 +63,11 @@ public class CustomerPageHelper extends CustomerPageElements {
|
||||
this.dashboardFromView = editMenuDashboardField().getAttribute("value");
|
||||
}
|
||||
|
||||
public void setDescription() {
|
||||
scrollToElement(descriptionEntityView());
|
||||
this.description = descriptionEntityView().getAttribute("value");
|
||||
}
|
||||
|
||||
public String getDashboard() {
|
||||
return dashboard;
|
||||
}
|
||||
@ -71,6 +76,10 @@ public class CustomerPageHelper extends CustomerPageElements {
|
||||
return dashboardFromView;
|
||||
}
|
||||
|
||||
public String getDescription() {
|
||||
return description;
|
||||
}
|
||||
|
||||
public void setCustomerEmail(String title) {
|
||||
this.customerEmail = email(title).getText();
|
||||
}
|
||||
@ -96,6 +105,7 @@ public class CustomerPageHelper extends CustomerPageElements {
|
||||
}
|
||||
|
||||
public void changeTitleEditMenu(String newTitle) {
|
||||
titleFieldEntityView().click();
|
||||
titleFieldEntityView().clear();
|
||||
wait.until(ExpectedConditions.textToBe(By.xpath(String.format(INPUT_FIELD, INPUT_FIELD_NAME_TITLE)), ""));
|
||||
titleFieldEntityView().sendKeys(newTitle);
|
||||
@ -142,4 +152,8 @@ public class CustomerPageHelper extends CustomerPageElements {
|
||||
public void sortByNameDown() {
|
||||
doubleClick(sortByTitleBtn());
|
||||
}
|
||||
|
||||
public void addCustomerViewEnterName(CharSequence keysToEnter) {
|
||||
enterText(titleFieldAddEntityView(), keysToEnter);
|
||||
}
|
||||
}
|
||||
|
||||
@ -49,13 +49,15 @@ public class OtherPageElementsHelper extends OtherPageElements {
|
||||
}
|
||||
}
|
||||
|
||||
public void changeNameEditMenu(String newName) {
|
||||
nameFieldEditMenu().sendKeys(Keys.CONTROL + "a" + Keys.BACK_SPACE);
|
||||
nameFieldEditMenu().sendKeys(newName);
|
||||
public void changeNameEditMenu(CharSequence keysToSend) {
|
||||
nameFieldEditMenu().click();
|
||||
nameFieldEditMenu().clear();
|
||||
nameFieldEditMenu().sendKeys(keysToSend);
|
||||
}
|
||||
|
||||
public void changeDescription(String newDescription) {
|
||||
descriptionEntityView().sendKeys(Keys.CONTROL + "a" + Keys.BACK_SPACE);
|
||||
descriptionEntityView().click();
|
||||
descriptionEntityView().clear();
|
||||
descriptionEntityView().sendKeys(newDescription);
|
||||
}
|
||||
|
||||
|
||||
@ -26,41 +26,67 @@ public class ProfilesPageElements extends OtherPageElementsHelper {
|
||||
}
|
||||
|
||||
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 CREATE_ASSET_PROFILE_BTN = "//span[text()='Create new asset profile']";
|
||||
private static final String IMPORT_DEVICE_PROFILE_BTN = "//span[text()='Import device profile']";
|
||||
private static final String IMPORT_ASSET_PROFILE_BTN = "//span[text()='Import asset profile']";
|
||||
private static final String ADD_DEVICE_PROFILE_VIEW = "//tb-add-device-profile-dialog";
|
||||
private static final String ADD_ASSET_PROFILE_VIEW = "//tb-add-entity-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']/..";
|
||||
private static final String DEVISE_PROFILE_VIEW_DELETE_BTN = "//tb-device-profile//span[contains(text(),'Delete')]";
|
||||
private static final String ADD_DEVICE_PROFILE_ADD_BTN = "//span[text()='Add']";
|
||||
private static final String ADD_ASSET_PROFILE_ADD_BTN = "//button[@type='submit']";
|
||||
private static final String DEVICE_PROFILE_VIEW_DELETE_BTN = "//tb-device-profile//span[contains(text(),'Delete')]";
|
||||
private static final String ASSET_PROFILE_VIEW_DELETE_BTN = "//tb-entity-details-panel//span[contains(text(),'Delete')]";
|
||||
private static final String PROFILE_NAMES = "//tbody/mat-row/mat-cell[contains(@class,'name')]";
|
||||
private static final String MAKE_DEFAULT_BTN = ENTITY + "/../..//mat-icon[contains(text(),' flag')]/../..";
|
||||
private static final String DEFAULT = ENTITY + "/../..//mat-icon[text() = 'check_box']";
|
||||
private static final String PROFILE_VIEW_MAKE_DEFAULT_BTN = "//span[text() = ' Make device profile default ']/..";
|
||||
private static final String DEVICE_PROFILE_VIEW_MAKE_DEFAULT_BTN = "//span[text() = ' Make device profile default ']/..";
|
||||
private static final String ASSET_PROFILE_VIEW_MAKE_DEFAULT_BTN = "//span[text() = ' Make asset profile default ']/..";
|
||||
|
||||
protected String getDeviseProfileViewDeleteBtn() {
|
||||
return DEVISE_PROFILE_VIEW_DELETE_BTN;
|
||||
return DEVICE_PROFILE_VIEW_DELETE_BTN;
|
||||
}
|
||||
|
||||
protected String getAssetProfileViewDeleteBtn() {
|
||||
return ASSET_PROFILE_VIEW_DELETE_BTN;
|
||||
}
|
||||
|
||||
public WebElement createNewDeviceProfileBtn() {
|
||||
return waitUntilElementToBeClickable(CREATE_DEVICE_PROFILE_BTN);
|
||||
}
|
||||
|
||||
public WebElement createNewAssetProfileBtn() {
|
||||
return waitUntilElementToBeClickable(CREATE_ASSET_PROFILE_BTN);
|
||||
}
|
||||
|
||||
public WebElement importDeviceProfileBtn() {
|
||||
return waitUntilElementToBeClickable(IMPORT_PROFILE_BTN);
|
||||
return waitUntilElementToBeClickable(IMPORT_DEVICE_PROFILE_BTN);
|
||||
}
|
||||
|
||||
public WebElement importAssetProfileBtn() {
|
||||
return waitUntilElementToBeClickable(IMPORT_ASSET_PROFILE_BTN);
|
||||
}
|
||||
|
||||
public WebElement addDeviceProfileView() {
|
||||
return waitUntilElementToBeClickable(ADD_DEVICE_PROFILE_VIEW);
|
||||
}
|
||||
|
||||
public WebElement addAssetProfileView() {
|
||||
return waitUntilElementToBeClickable(ADD_ASSET_PROFILE_VIEW);
|
||||
}
|
||||
|
||||
public WebElement addDeviceProfileNameField() {
|
||||
return waitUntilElementToBeClickable(ADD_DEVICE_PROFILE_VIEW + NAME_FIELD);
|
||||
}
|
||||
|
||||
public WebElement addAssetProfileNameField() {
|
||||
return waitUntilElementToBeClickable(ADD_ASSET_PROFILE_VIEW + NAME_FIELD);
|
||||
}
|
||||
|
||||
public WebElement profileViewNameField() {
|
||||
return waitUntilVisibilityOfElementLocated(DEVICE_PROFILE_VIEW + NAME_FIELD);
|
||||
}
|
||||
@ -69,6 +95,10 @@ public class ProfilesPageElements extends OtherPageElementsHelper {
|
||||
return waitUntilElementToBeClickable(ADD_DEVICE_PROFILE_VIEW + RULE_CHAIN_FIELD);
|
||||
}
|
||||
|
||||
public WebElement addAssetProfileRuleChainField() {
|
||||
return waitUntilElementToBeClickable(ADD_ASSET_PROFILE_VIEW + RULE_CHAIN_FIELD);
|
||||
}
|
||||
|
||||
public WebElement profileViewRuleChainField() {
|
||||
return waitUntilVisibilityOfElementLocated(DEVICE_PROFILE_VIEW + RULE_CHAIN_FIELD);
|
||||
}
|
||||
@ -77,6 +107,10 @@ public class ProfilesPageElements extends OtherPageElementsHelper {
|
||||
return waitUntilElementToBeClickable(ADD_DEVICE_PROFILE_VIEW + DASHBOARD_FIELD);
|
||||
}
|
||||
|
||||
public WebElement addAssetProfileMobileDashboardField() {
|
||||
return waitUntilElementToBeClickable(ADD_ASSET_PROFILE_VIEW + DASHBOARD_FIELD);
|
||||
}
|
||||
|
||||
public WebElement profileViewMobileDashboardField() {
|
||||
return waitUntilVisibilityOfElementLocated(DEVICE_PROFILE_VIEW + DASHBOARD_FIELD);
|
||||
}
|
||||
@ -85,6 +119,10 @@ public class ProfilesPageElements extends OtherPageElementsHelper {
|
||||
return waitUntilElementToBeClickable(ADD_DEVICE_PROFILE_VIEW + QUEUE_FIELD);
|
||||
}
|
||||
|
||||
public WebElement addAssetProfileQueueField() {
|
||||
return waitUntilElementToBeClickable(ADD_ASSET_PROFILE_VIEW + QUEUE_FIELD);
|
||||
}
|
||||
|
||||
public WebElement profileViewQueueField() {
|
||||
return waitUntilVisibilityOfElementLocated(DEVICE_PROFILE_VIEW + QUEUE_FIELD);
|
||||
}
|
||||
@ -93,6 +131,10 @@ public class ProfilesPageElements extends OtherPageElementsHelper {
|
||||
return waitUntilElementToBeClickable(ADD_DEVICE_PROFILE_VIEW + DESCRIPTION_FIELD);
|
||||
}
|
||||
|
||||
public WebElement addAssetDescriptionField() {
|
||||
return waitUntilElementToBeClickable(ADD_ASSET_PROFILE_VIEW + DESCRIPTION_FIELD);
|
||||
}
|
||||
|
||||
public WebElement profileViewDescriptionField() {
|
||||
return waitUntilVisibilityOfElementLocated(DEVICE_PROFILE_VIEW + DESCRIPTION_FIELD);
|
||||
}
|
||||
@ -101,8 +143,16 @@ public class ProfilesPageElements extends OtherPageElementsHelper {
|
||||
return waitUntilElementToBeClickable(ADD_DEVICE_PROFILE_ADD_BTN);
|
||||
}
|
||||
|
||||
public WebElement addAssetProfileAddBtn() {
|
||||
return waitUntilElementToBeClickable(ADD_ASSET_PROFILE_ADD_BTN);
|
||||
}
|
||||
|
||||
public WebElement deviceProfileViewDeleteBtn() {
|
||||
return waitUntilElementToBeClickable(DEVISE_PROFILE_VIEW_DELETE_BTN);
|
||||
return waitUntilElementToBeClickable(DEVICE_PROFILE_VIEW_DELETE_BTN);
|
||||
}
|
||||
|
||||
public WebElement assetProfileViewDeleteBtn() {
|
||||
return waitUntilElementToBeClickable(ASSET_PROFILE_VIEW_DELETE_BTN);
|
||||
}
|
||||
|
||||
public List<WebElement> profileNames() {
|
||||
@ -117,7 +167,11 @@ public class ProfilesPageElements extends OtherPageElementsHelper {
|
||||
return waitUntilElementToBeClickable(String.format(DEFAULT, profileName));
|
||||
}
|
||||
|
||||
public WebElement profileViewMakeDefaultBtn() {
|
||||
return waitUntilElementToBeClickable(PROFILE_VIEW_MAKE_DEFAULT_BTN);
|
||||
public WebElement deviceProfileViewMakeDefaultBtn() {
|
||||
return waitUntilElementToBeClickable(DEVICE_PROFILE_VIEW_MAKE_DEFAULT_BTN);
|
||||
}
|
||||
|
||||
public WebElement assetProfileViewMakeDefaultBtn() {
|
||||
return waitUntilElementToBeClickable(ASSET_PROFILE_VIEW_MAKE_DEFAULT_BTN);
|
||||
}
|
||||
}
|
||||
@ -18,7 +18,6 @@ package org.thingsboard.server.msa.ui.pages;
|
||||
import org.openqa.selenium.By;
|
||||
import org.openqa.selenium.WebDriver;
|
||||
import org.openqa.selenium.support.ui.ExpectedConditions;
|
||||
import org.testng.Assert;
|
||||
|
||||
public class ProfilesPageHelper extends ProfilesPageElements {
|
||||
public ProfilesPageHelper(WebDriver driver) {
|
||||
@ -85,45 +84,83 @@ public class ProfilesPageHelper extends ProfilesPageElements {
|
||||
return this.profile;
|
||||
}
|
||||
|
||||
public void enterName(String name) {
|
||||
addDeviceProfileNameField().click();
|
||||
addDeviceProfileNameField().sendKeys(name);
|
||||
public void createDeviceProfileEnterName(CharSequence keysToEnter) {
|
||||
enterText(addDeviceProfileNameField(), keysToEnter);
|
||||
}
|
||||
|
||||
public void chooseRuleChain(String ruleChain) {
|
||||
public void addDeviceProfileViewChooseRuleChain(String ruleChain) {
|
||||
addDeviceProfileRuleChainField().click();
|
||||
entityFromList(ruleChain).click();
|
||||
}
|
||||
|
||||
public void chooseMobileDashboard(String mobileDashboard) {
|
||||
public void addAssetProfileViewChooseRuleChain(String ruleChain) {
|
||||
addAssetProfileRuleChainField().click();
|
||||
entityFromList(ruleChain).click();
|
||||
}
|
||||
|
||||
public void addDeviceProfileViewChooseMobileDashboard(String mobileDashboard) {
|
||||
addDeviceProfileMobileDashboardField().click();
|
||||
entityFromList(mobileDashboard).click();
|
||||
}
|
||||
|
||||
public void chooseQueue(String queue) {
|
||||
public void addAssetProfileViewChooseMobileDashboard(String mobileDashboard) {
|
||||
addAssetProfileMobileDashboardField().click();
|
||||
entityFromList(mobileDashboard).click();
|
||||
}
|
||||
|
||||
public void addDeviceProfileViewChooseQueue(String queue) {
|
||||
addDeviceProfileQueueField().click();
|
||||
entityFromList(queue).click();
|
||||
waitUntilAttributeContains(addDeviceProfileQueueField(), "aria-expanded", "false");
|
||||
}
|
||||
|
||||
public void enterDescription(String description) {
|
||||
public void addAssetsProfileViewChooseQueue(String queue) {
|
||||
addAssetProfileQueueField().click();
|
||||
entityFromList(queue).click();
|
||||
waitUntilAttributeContains(addAssetProfileQueueField(), "aria-expanded", "false");
|
||||
}
|
||||
|
||||
public void addDeviceProfileViewEnterDescription(String description) {
|
||||
addDeviceDescriptionField().sendKeys(description);
|
||||
}
|
||||
|
||||
public void addAssetProfileViewEnterDescription(String description) {
|
||||
addAssetDescriptionField().sendKeys(description);
|
||||
}
|
||||
|
||||
public void openCreateDeviceProfileView() {
|
||||
plusBtn().click();
|
||||
createNewDeviceProfileBtn().click();
|
||||
}
|
||||
|
||||
public void openCreateAssetProfileView() {
|
||||
plusBtn().click();
|
||||
createNewAssetProfileBtn().click();
|
||||
}
|
||||
|
||||
public void addAssetProfileViewEnterName(String name) {
|
||||
addAssetProfileNameField().click();
|
||||
addAssetProfileNameField().sendKeys(name);
|
||||
}
|
||||
|
||||
public void openImportDeviceProfileView() {
|
||||
plusBtn().click();
|
||||
importDeviceProfileBtn().click();
|
||||
}
|
||||
|
||||
public void openImportAssetProfileView() {
|
||||
plusBtn().click();
|
||||
importAssetProfileBtn().click();
|
||||
}
|
||||
|
||||
public boolean deleteDeviceProfileFromViewBtnIsNotDisplayed() {
|
||||
return wait.until(ExpectedConditions.invisibilityOfElementLocated(By.xpath(getDeviseProfileViewDeleteBtn())));
|
||||
}
|
||||
|
||||
public boolean deleteAssetProfileFromViewBtnIsNotDisplayed() {
|
||||
return wait.until(ExpectedConditions.invisibilityOfElementLocated(By.xpath(getAssetProfileViewDeleteBtn())));
|
||||
}
|
||||
|
||||
public void goToProfileHelpPage() {
|
||||
jsClick(helpBtn());
|
||||
goToNextTab(2);
|
||||
@ -137,9 +174,8 @@ public class ProfilesPageHelper extends ProfilesPageElements {
|
||||
return elementsIsNotPresent(getEntity(name));
|
||||
}
|
||||
|
||||
public void assertCheckBoxIsNotDisplayed(String name) {
|
||||
wait.until(ExpectedConditions.elementToBeClickable(By.xpath("(//mat-checkbox)[2]")));
|
||||
Assert.assertFalse(driver.findElement(By.xpath(getCheckbox(name))).isDisplayed());
|
||||
public boolean checkBoxIsDisplayed(String name) {
|
||||
return waitUntilPresenceOfElementLocated(getCheckbox(name)).isDisplayed();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -47,6 +47,7 @@ public class RuleChainsPageHelper extends RuleChainsPageElements {
|
||||
}
|
||||
|
||||
private String ruleChainName;
|
||||
private String description;
|
||||
|
||||
public void setRuleChainNameWithoutRoot() {
|
||||
this.ruleChainName = notRootRuleChainsNames().get(getRandomNumberFromRuleChainsCount()).getText();
|
||||
@ -56,6 +57,11 @@ public class RuleChainsPageHelper extends RuleChainsPageElements {
|
||||
this.ruleChainName = notRootRuleChainsNames().get(number).getText();
|
||||
}
|
||||
|
||||
public void setDescription() {
|
||||
scrollToElement(descriptionEntityView());
|
||||
this.description = descriptionEntityView().getAttribute("value");
|
||||
}
|
||||
|
||||
public void setRuleChainName(int number) {
|
||||
this.ruleChainName = allNames().get(number).getText();
|
||||
}
|
||||
@ -64,6 +70,10 @@ public class RuleChainsPageHelper extends RuleChainsPageElements {
|
||||
return this.ruleChainName;
|
||||
}
|
||||
|
||||
public String getDescription() {
|
||||
return description;
|
||||
}
|
||||
|
||||
public String deleteRuleChainFromView(String ruleChainName) {
|
||||
String s = "";
|
||||
if (deleteBtnFromView() != null) {
|
||||
|
||||
@ -29,6 +29,7 @@ public class SideBarMenuViewElements extends AbstractBasePage {
|
||||
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']";
|
||||
private static final String ASSET_PROFILE_BTN = "//mat-toolbar//a[@href='/profiles/assetProfiles']";
|
||||
|
||||
public WebElement ruleChainsBtn() {
|
||||
return waitUntilElementToBeClickable(RULE_CHAINS_BTN);
|
||||
@ -49,4 +50,8 @@ public class SideBarMenuViewElements extends AbstractBasePage {
|
||||
public WebElement deviceProfileBtn() {
|
||||
return waitUntilElementToBeClickable(DEVICE_PROFILE_BTN);
|
||||
}
|
||||
|
||||
public WebElement assetProfileBtn() {
|
||||
return waitUntilElementToBeClickable(ASSET_PROFILE_BTN);
|
||||
}
|
||||
}
|
||||
@ -26,4 +26,9 @@ public class SideBarMenuViewHelper extends SideBarMenuViewElements {
|
||||
profilesBtn().click();
|
||||
deviceProfileBtn().click();
|
||||
}
|
||||
|
||||
public void openAssetProfiles() {
|
||||
profilesBtn().click();
|
||||
assetProfileBtn().click();
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,128 @@
|
||||
/**
|
||||
* 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.assetProfileSmoke;
|
||||
|
||||
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.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_ASSET_PROFILE_MESSAGE;
|
||||
import static org.thingsboard.server.msa.ui.utils.Const.ENTITY_NAME;
|
||||
|
||||
public class AssetProfileEditMenuTest extends AbstractDriverBaseTest {
|
||||
|
||||
private SideBarMenuViewHelper sideBarMenuView;
|
||||
private ProfilesPageHelper profilesPage;
|
||||
private String name;
|
||||
|
||||
@BeforeMethod
|
||||
public void login() {
|
||||
new LoginPageHelper(driver).authorizationTenant();
|
||||
sideBarMenuView = new SideBarMenuViewHelper(driver);
|
||||
profilesPage = new ProfilesPageHelper(driver);
|
||||
}
|
||||
|
||||
@AfterMethod
|
||||
public void delete() {
|
||||
if (name != null) {
|
||||
testRestClient.deleteAssetProfile(getAssetProfileByName(name).getId());
|
||||
name = null;
|
||||
}
|
||||
}
|
||||
|
||||
@Test(priority = 10, groups = "smoke")
|
||||
@Description
|
||||
public void changeName() {
|
||||
String name = ENTITY_NAME;
|
||||
String newName = "Changed" + getRandomNumber();
|
||||
testRestClient.postAssetProfile(EntityPrototypes.defaultAssetProfile(name));
|
||||
this.name = name;
|
||||
|
||||
sideBarMenuView.openAssetProfiles();
|
||||
profilesPage.entity(name).click();
|
||||
profilesPage.setHeaderName();
|
||||
String nameBefore = profilesPage.getHeaderName();
|
||||
jsClick(profilesPage.editPencilBtn());
|
||||
profilesPage.changeNameEditMenu(newName);
|
||||
profilesPage.doneBtnEditView().click();
|
||||
this.name = newName;
|
||||
profilesPage.setHeaderName();
|
||||
String nameAfter = profilesPage.getHeaderName();
|
||||
|
||||
Assert.assertNotEquals(nameBefore, nameAfter);
|
||||
Assert.assertEquals(nameAfter, newName);
|
||||
}
|
||||
|
||||
@Test(priority = 10, groups = "smoke")
|
||||
@Description
|
||||
public void deleteName() {
|
||||
String name = ENTITY_NAME;
|
||||
testRestClient.postAssetProfile(EntityPrototypes.defaultAssetProfile(name));
|
||||
this.name = name;
|
||||
|
||||
sideBarMenuView.openAssetProfiles();
|
||||
profilesPage.entity(name).click();
|
||||
jsClick(profilesPage.editPencilBtn());
|
||||
profilesPage.changeNameEditMenu("");
|
||||
|
||||
Assert.assertFalse(profilesPage.doneBtnEditViewVisible().isEnabled());
|
||||
}
|
||||
|
||||
@Test(priority = 20, groups = "smoke")
|
||||
@Description
|
||||
public void saveWithOnlySpaceInName() {
|
||||
String name = ENTITY_NAME;
|
||||
testRestClient.postAssetProfile(EntityPrototypes.defaultAssetProfile(name));
|
||||
this.name = name;
|
||||
|
||||
sideBarMenuView.openAssetProfiles();
|
||||
profilesPage.entity(name).click();
|
||||
jsClick(profilesPage.editPencilBtn());
|
||||
profilesPage.changeNameEditMenu(Keys.SPACE);
|
||||
profilesPage.doneBtnEditView().click();
|
||||
|
||||
Assert.assertNotNull(profilesPage.warningMessage());
|
||||
Assert.assertTrue(profilesPage.warningMessage().isDisplayed());
|
||||
Assert.assertEquals(profilesPage.warningMessage().getText(), EMPTY_ASSET_PROFILE_MESSAGE);
|
||||
}
|
||||
|
||||
@Test(priority = 30, groups = "smoke", dataProviderClass = DataProviderCredential.class, dataProvider = "editMenuDescription")
|
||||
@Description
|
||||
public void editDescription(String description, String newDescription, String finalDescription) {
|
||||
String name = ENTITY_NAME;
|
||||
testRestClient.postAssetProfile(EntityPrototypes.defaultAssetProfile(name, description));
|
||||
this.name = name;
|
||||
|
||||
sideBarMenuView.openAssetProfiles();
|
||||
profilesPage.entity(name).click();
|
||||
jsClick(profilesPage.editPencilBtn());
|
||||
profilesPage.profileViewDescriptionField().sendKeys(newDescription);
|
||||
profilesPage.doneBtnEditView().click();
|
||||
profilesPage.setDescription();
|
||||
|
||||
Assert.assertEquals(profilesPage.getDescription(), finalDescription);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,126 @@
|
||||
/**
|
||||
* 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.assetProfileSmoke;
|
||||
|
||||
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.utils.Const.EMPTY_IMPORT_MESSAGE;
|
||||
import static org.thingsboard.server.msa.ui.utils.Const.IMPORT_ASSET_PROFILE_FILE_NAME;
|
||||
import static org.thingsboard.server.msa.ui.utils.Const.IMPORT_ASSET_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_ASSET_PROFILE_MESSAGE;
|
||||
|
||||
public class CreateAssetProfileImportTest extends AbstractDriverBaseTest {
|
||||
|
||||
private SideBarMenuViewHelper sideBarMenuView;
|
||||
private ProfilesPageHelper profilesPage;
|
||||
private final String absolutePathToFileImportAssetProfile = getClass().getClassLoader().getResource(IMPORT_ASSET_PROFILE_FILE_NAME).getPath();
|
||||
private final String absolutePathToFileImportTxt = getClass().getClassLoader().getResource(IMPORT_TXT_FILE_NAME).getPath();
|
||||
private String name;
|
||||
|
||||
@BeforeMethod
|
||||
public void login() {
|
||||
new LoginPageHelper(driver).authorizationTenant();
|
||||
sideBarMenuView = new SideBarMenuViewHelper(driver);
|
||||
profilesPage = new ProfilesPageHelper(driver);
|
||||
}
|
||||
|
||||
@AfterMethod
|
||||
public void delete() {
|
||||
if (name != null) {
|
||||
testRestClient.deleteAssetProfile(getAssetProfileByName(name).getId());
|
||||
name = null;
|
||||
}
|
||||
}
|
||||
|
||||
@Test(priority = 20, groups = "smoke")
|
||||
@Description
|
||||
public void importAssetProfile() {
|
||||
sideBarMenuView.openAssetProfiles();
|
||||
profilesPage.openImportAssetProfileView();
|
||||
profilesPage.browseFile().sendKeys(absolutePathToFileImportAssetProfile);
|
||||
profilesPage.importBrowseFileBtn().click();
|
||||
name = IMPORT_ASSET_PROFILE_NAME;
|
||||
profilesPage.refreshBtn().click();
|
||||
|
||||
Assert.assertNotNull(profilesPage.entity(IMPORT_ASSET_PROFILE_NAME));
|
||||
Assert.assertTrue(profilesPage.entity(IMPORT_ASSET_PROFILE_NAME).isDisplayed());
|
||||
}
|
||||
|
||||
@Test(priority = 20, groups = "smoke")
|
||||
@Description
|
||||
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(priority = 20, groups = "smoke")
|
||||
@Description
|
||||
public void addFileToImportAndRemove() {
|
||||
sideBarMenuView.openAssetProfiles();
|
||||
profilesPage.openImportAssetProfileView();
|
||||
profilesPage.browseFile().sendKeys(absolutePathToFileImportAssetProfile);
|
||||
profilesPage.clearImportFileBtn().click();
|
||||
|
||||
Assert.assertNotNull(profilesPage.importingFile(EMPTY_IMPORT_MESSAGE));
|
||||
Assert.assertTrue(profilesPage.importingFile(EMPTY_IMPORT_MESSAGE).isDisplayed());
|
||||
Assert.assertTrue(profilesPage.entityIsNotPresent(IMPORT_ASSET_PROFILE_NAME));
|
||||
}
|
||||
|
||||
@Test(priority = 20, groups = "smoke")
|
||||
@Description
|
||||
public void importAssetProfileWithSameName() {
|
||||
String name = IMPORT_ASSET_PROFILE_NAME;
|
||||
testRestClient.postAssetProfile(EntityPrototypes.defaultAssetProfile(name));
|
||||
this.name = name;
|
||||
|
||||
sideBarMenuView.openAssetProfiles();
|
||||
profilesPage.openImportAssetProfileView();
|
||||
profilesPage.browseFile().sendKeys(absolutePathToFileImportAssetProfile);
|
||||
profilesPage.importBrowseFileBtn().click();
|
||||
profilesPage.refreshBtn().click();
|
||||
|
||||
Assert.assertNotNull(profilesPage.warningMessage());
|
||||
Assert.assertTrue(profilesPage.warningMessage().isDisplayed());
|
||||
Assert.assertEquals(profilesPage.warningMessage().getText(), SAME_NAME_WARNING_ASSET_PROFILE_MESSAGE);
|
||||
}
|
||||
|
||||
@Test(priority = 20, groups = "smoke")
|
||||
@Description
|
||||
public void importAssetProfileWithoutRefresh() {
|
||||
sideBarMenuView.openAssetProfiles();
|
||||
profilesPage.openImportAssetProfileView();
|
||||
profilesPage.browseFile().sendKeys(absolutePathToFileImportAssetProfile);
|
||||
profilesPage.importBrowseFileBtn().click();
|
||||
name = IMPORT_ASSET_PROFILE_NAME;
|
||||
|
||||
Assert.assertNotNull(profilesPage.entity(IMPORT_ASSET_PROFILE_NAME));
|
||||
Assert.assertTrue(profilesPage.entity(IMPORT_ASSET_PROFILE_NAME).isDisplayed());
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,174 @@
|
||||
/**
|
||||
* 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.assetProfileSmoke;
|
||||
|
||||
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.utils.Const.EMPTY_ASSET_PROFILE_MESSAGE;
|
||||
import static org.thingsboard.server.msa.ui.utils.Const.ENTITY_NAME;
|
||||
import static org.thingsboard.server.msa.ui.utils.Const.SAME_NAME_WARNING_ASSET_PROFILE_MESSAGE;
|
||||
|
||||
public class CreateAssetProfileTest extends AbstractDriverBaseTest {
|
||||
|
||||
private SideBarMenuViewHelper sideBarMenuView;
|
||||
private ProfilesPageHelper profilesPage;
|
||||
private String name;
|
||||
|
||||
@BeforeMethod
|
||||
public void login() {
|
||||
new LoginPageHelper(driver).authorizationTenant();
|
||||
sideBarMenuView = new SideBarMenuViewHelper(driver);
|
||||
profilesPage = new ProfilesPageHelper(driver);
|
||||
}
|
||||
|
||||
@AfterMethod
|
||||
public void delete() {
|
||||
if (name != null) {
|
||||
testRestClient.deleteAssetProfile(getAssetProfileByName(name).getId());
|
||||
name = null;
|
||||
}
|
||||
}
|
||||
|
||||
@Test(priority = 10, groups = "smoke")
|
||||
@Description
|
||||
public void createAssetProfile() {
|
||||
String name = ENTITY_NAME;
|
||||
|
||||
sideBarMenuView.openAssetProfiles();
|
||||
profilesPage.openCreateAssetProfileView();
|
||||
profilesPage.addAssetProfileViewEnterName(name);
|
||||
profilesPage.addAssetProfileAddBtn().click();
|
||||
this.name = name;
|
||||
profilesPage.refreshBtn().click();
|
||||
|
||||
Assert.assertNotNull(profilesPage.entity(name));
|
||||
Assert.assertTrue(profilesPage.entity(name).isDisplayed());
|
||||
}
|
||||
|
||||
@Test(priority = 20, groups = "smoke")
|
||||
@Description
|
||||
public void createAssetProfileWithDetails() {
|
||||
String name = ENTITY_NAME;
|
||||
String ruleChain = "Root Rule Chain";
|
||||
String mobileDashboard = "Firmware";
|
||||
String queue = "Main";
|
||||
String description = "Description";
|
||||
|
||||
sideBarMenuView.openAssetProfiles();
|
||||
profilesPage.openCreateAssetProfileView();
|
||||
profilesPage.addAssetProfileViewEnterName(name);
|
||||
profilesPage.addAssetProfileViewChooseRuleChain(ruleChain);
|
||||
profilesPage.addAssetProfileViewChooseMobileDashboard(mobileDashboard);
|
||||
profilesPage.addAssetsProfileViewChooseQueue(queue);
|
||||
profilesPage.addAssetProfileViewEnterDescription(description);
|
||||
profilesPage.addAssetProfileAddBtn().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(priority = 20, groups = "smoke")
|
||||
@Description
|
||||
public void createAssetProfileWithSameName() {
|
||||
String name = ENTITY_NAME;
|
||||
testRestClient.postAssetProfile(EntityPrototypes.defaultAssetProfile(name));
|
||||
this.name = name;
|
||||
|
||||
sideBarMenuView.openAssetProfiles();
|
||||
profilesPage.openCreateAssetProfileView();
|
||||
profilesPage.addAssetProfileViewEnterName(name);
|
||||
profilesPage.addAssetProfileAddBtn().click();
|
||||
|
||||
Assert.assertNotNull(profilesPage.warningMessage());
|
||||
Assert.assertTrue(profilesPage.warningMessage().isDisplayed());
|
||||
Assert.assertEquals(profilesPage.warningMessage().getText(), SAME_NAME_WARNING_ASSET_PROFILE_MESSAGE);
|
||||
Assert.assertNotNull(profilesPage.addAssetProfileView());
|
||||
Assert.assertTrue(profilesPage.addAssetProfileView().isDisplayed());
|
||||
}
|
||||
|
||||
@Test(priority = 20, groups = "smoke")
|
||||
@Description
|
||||
public void createAssetProfileWithoutName() {
|
||||
sideBarMenuView.openAssetProfiles();
|
||||
profilesPage.openCreateAssetProfileView();
|
||||
|
||||
Assert.assertFalse(profilesPage.addBtnV().isEnabled());
|
||||
}
|
||||
|
||||
@Test(priority = 20, groups = "smoke")
|
||||
@Description
|
||||
public void createAssetProfileWithOnlySpaceInName() {
|
||||
sideBarMenuView.openAssetProfiles();
|
||||
profilesPage.openCreateAssetProfileView();
|
||||
profilesPage.addAssetProfileViewEnterName(" ");
|
||||
profilesPage.addAssetProfileAddBtn().click();
|
||||
|
||||
Assert.assertNotNull(profilesPage.warningMessage());
|
||||
Assert.assertTrue(profilesPage.warningMessage().isDisplayed());
|
||||
Assert.assertEquals(profilesPage.warningMessage().getText(), EMPTY_ASSET_PROFILE_MESSAGE);
|
||||
Assert.assertNotNull(profilesPage.addAssetProfileView());
|
||||
Assert.assertTrue(profilesPage.addAssetProfileView().isDisplayed());
|
||||
}
|
||||
|
||||
@Test(priority = 30, groups = "smoke")
|
||||
@Description
|
||||
public void createAssetProfileWithoutRefresh() {
|
||||
String name = ENTITY_NAME;
|
||||
|
||||
sideBarMenuView.openAssetProfiles();
|
||||
profilesPage.openCreateAssetProfileView();
|
||||
profilesPage.addAssetProfileViewEnterName(name);
|
||||
profilesPage.addAssetProfileAddBtn().click();
|
||||
this.name = name;
|
||||
|
||||
Assert.assertNotNull(profilesPage.entity(name));
|
||||
Assert.assertTrue(profilesPage.entity(name).isDisplayed());
|
||||
}
|
||||
|
||||
@Test(priority = 40, groups = "smoke")
|
||||
@Description
|
||||
public void documentation() {
|
||||
String urlPath = "docs/user-guide/asset-profiles/";
|
||||
|
||||
sideBarMenuView.openAssetProfiles();
|
||||
profilesPage.allEntity().get(0).click();
|
||||
profilesPage.goToProfileHelpPage();
|
||||
|
||||
Assert.assertTrue(urlContains(urlPath));
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,124 @@
|
||||
/**
|
||||
* 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.assetProfileSmoke;
|
||||
|
||||
import io.qameta.allure.Description;
|
||||
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;
|
||||
|
||||
public class DeleteAssetProfileTest extends AbstractDriverBaseTest {
|
||||
|
||||
private SideBarMenuViewHelper sideBarMenuView;
|
||||
private ProfilesPageHelper profilesPage;
|
||||
|
||||
@BeforeMethod
|
||||
public void login() {
|
||||
new LoginPageHelper(driver).authorizationTenant();
|
||||
sideBarMenuView = new SideBarMenuViewHelper(driver);
|
||||
profilesPage = new ProfilesPageHelper(driver);
|
||||
}
|
||||
|
||||
@Test(priority = 10, groups = "smoke")
|
||||
@Description
|
||||
public void removeAssetProfile() {
|
||||
String name = ENTITY_NAME;
|
||||
testRestClient.postAssetProfile(EntityPrototypes.defaultAssetProfile(name));
|
||||
|
||||
sideBarMenuView.openAssetProfiles();
|
||||
profilesPage.deleteBtn(name).click();
|
||||
profilesPage.warningPopUpYesBtn().click();
|
||||
profilesPage.refreshBtn();
|
||||
|
||||
Assert.assertTrue(profilesPage.entityIsNotPresent(name));
|
||||
}
|
||||
|
||||
@Test(priority = 10, groups = "smoke")
|
||||
@Description
|
||||
public void removeAssetProfileFromView() {
|
||||
String name = ENTITY_NAME;
|
||||
testRestClient.postAssetProfile(EntityPrototypes.defaultAssetProfile(name));
|
||||
|
||||
sideBarMenuView.openAssetProfiles();
|
||||
profilesPage.entity(name).click();
|
||||
profilesPage.assetProfileViewDeleteBtn().click();
|
||||
profilesPage.warningPopUpYesBtn().click();
|
||||
profilesPage.refreshBtn();
|
||||
|
||||
Assert.assertTrue(profilesPage.entityIsNotPresent(name));
|
||||
}
|
||||
|
||||
@Test(priority = 10, groups = "smoke")
|
||||
@Description
|
||||
public void removeSelectedAssetProfile() {
|
||||
String name = ENTITY_NAME;
|
||||
testRestClient.postAssetProfile(EntityPrototypes.defaultAssetProfile(name));
|
||||
|
||||
sideBarMenuView.openAssetProfiles();
|
||||
profilesPage.checkBox(name).click();
|
||||
profilesPage.deleteSelectedBtn().click();
|
||||
profilesPage.warningPopUpYesBtn().click();
|
||||
profilesPage.refreshBtn();
|
||||
|
||||
Assert.assertTrue(profilesPage.entityIsNotPresent(name));
|
||||
}
|
||||
|
||||
@Test(priority = 20, groups = "smoke")
|
||||
@Description
|
||||
public void removeDefaultAssetProfile() {
|
||||
sideBarMenuView.openAssetProfiles();
|
||||
|
||||
Assert.assertFalse(profilesPage.deleteBtn("default").isEnabled());
|
||||
}
|
||||
|
||||
@Test(priority = 20, groups = "smoke")
|
||||
@Description
|
||||
public void removeDefaultAssetProfileFromView() {
|
||||
sideBarMenuView.openAssetProfiles();
|
||||
profilesPage.entity("default").click();
|
||||
|
||||
Assert.assertTrue(profilesPage.deleteAssetProfileFromViewBtnIsNotDisplayed());
|
||||
}
|
||||
|
||||
@Test(priority = 20, groups = "smoke")
|
||||
@Description
|
||||
public void removeSelectedDefaultAssetProfile() {
|
||||
sideBarMenuView.openAssetProfiles();
|
||||
|
||||
Assert.assertNotNull(profilesPage.presentCheckBox("default"));
|
||||
Assert.assertFalse(profilesPage.presentCheckBox("default").isDisplayed());
|
||||
}
|
||||
|
||||
@Test(priority = 30, groups = "smoke")
|
||||
@Description
|
||||
public void removeAssetProfileWithoutRefresh() {
|
||||
String name = ENTITY_NAME;
|
||||
testRestClient.postAssetProfile(EntityPrototypes.defaultAssetProfile(name));
|
||||
|
||||
sideBarMenuView.openAssetProfiles();
|
||||
profilesPage.deleteBtn(name).click();
|
||||
profilesPage.warningPopUpYesBtn().click();
|
||||
|
||||
Assert.assertTrue(profilesPage.entityIsNotPresent(name));
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,103 @@
|
||||
/**
|
||||
* 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.assetProfileSmoke;
|
||||
|
||||
import io.qameta.allure.Description;
|
||||
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;
|
||||
|
||||
public class DeleteSeveralAssetProfilesTest extends AbstractDriverBaseTest {
|
||||
private SideBarMenuViewHelper sideBarMenuView;
|
||||
private ProfilesPageHelper profilesPage;
|
||||
|
||||
@BeforeMethod
|
||||
public void login() {
|
||||
new LoginPageHelper(driver).authorizationTenant();
|
||||
sideBarMenuView = new SideBarMenuViewHelper(driver);
|
||||
profilesPage = new ProfilesPageHelper(driver);
|
||||
}
|
||||
|
||||
@Test(priority = 10, groups = "smoke")
|
||||
@Description
|
||||
public void canDeleteSeveralAssetProfilesByTopBtn() {
|
||||
String name1 = ENTITY_NAME + "1";
|
||||
String name2 = ENTITY_NAME + "2";
|
||||
testRestClient.postAssetProfile(EntityPrototypes.defaultAssetProfile(name1));
|
||||
testRestClient.postAssetProfile(EntityPrototypes.defaultAssetProfile(name2));
|
||||
|
||||
sideBarMenuView.openAssetProfiles();
|
||||
profilesPage.clickOnCheckBoxes(2);
|
||||
profilesPage.deleteSelectedBtn().click();
|
||||
profilesPage.warningPopUpYesBtn().click();
|
||||
profilesPage.refreshBtn().click();
|
||||
|
||||
Assert.assertTrue(profilesPage.profileIsNotPresent(name1));
|
||||
Assert.assertTrue(profilesPage.profileIsNotPresent(name2));
|
||||
}
|
||||
|
||||
@Test(priority = 10, groups = "smoke")
|
||||
@Description
|
||||
public void selectAllDAssetProfiles() {
|
||||
String name1 = ENTITY_NAME + "1";
|
||||
String name2 = ENTITY_NAME + "2";
|
||||
testRestClient.postAssetProfile(EntityPrototypes.defaultAssetProfile(name1));
|
||||
testRestClient.postAssetProfile(EntityPrototypes.defaultAssetProfile(name2));
|
||||
|
||||
sideBarMenuView.openAssetProfiles();
|
||||
profilesPage.selectAllCheckBox().click();
|
||||
profilesPage.deleteSelectedBtn().click();
|
||||
profilesPage.warningPopUpYesBtn().click();
|
||||
profilesPage.refreshBtn().click();
|
||||
|
||||
Assert.assertTrue(profilesPage.profileIsNotPresent(name1));
|
||||
Assert.assertTrue(profilesPage.profileIsNotPresent(name2));
|
||||
}
|
||||
|
||||
@Test(priority = 20, groups = "smoke")
|
||||
@Description
|
||||
public void removeDefaultAssetProfile() {
|
||||
sideBarMenuView.openAssetProfiles();
|
||||
profilesPage.selectAllCheckBox().click();
|
||||
|
||||
Assert.assertFalse(profilesPage.checkBoxIsDisplayed("default"));
|
||||
Assert.assertFalse(profilesPage.deleteBtn("default").isEnabled());
|
||||
}
|
||||
|
||||
@Test(priority = 30, groups = "smoke")
|
||||
@Description
|
||||
public void deleteSeveralAssetProfilesByTopBtnWithoutRefresh() {
|
||||
String name1 = ENTITY_NAME + "1";
|
||||
String name2 = ENTITY_NAME + "2";
|
||||
testRestClient.postAssetProfile(EntityPrototypes.defaultAssetProfile(name1));
|
||||
testRestClient.postAssetProfile(EntityPrototypes.defaultAssetProfile(name2));
|
||||
|
||||
sideBarMenuView.openAssetProfiles();
|
||||
profilesPage.clickOnCheckBoxes(2);
|
||||
profilesPage.deleteSelectedBtn().click();
|
||||
profilesPage.warningPopUpYesBtn().click();
|
||||
|
||||
Assert.assertTrue(profilesPage.profileIsNotPresent(name1));
|
||||
Assert.assertTrue(profilesPage.profileIsNotPresent(name2));
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,78 @@
|
||||
/**
|
||||
* 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.assetProfileSmoke;
|
||||
|
||||
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.utils.Const.ENTITY_NAME;
|
||||
|
||||
public class MakeAssetProfileDefaultTest extends AbstractDriverBaseTest {
|
||||
private SideBarMenuViewHelper sideBarMenuView;
|
||||
private ProfilesPageHelper profilesPage;
|
||||
private String name;
|
||||
|
||||
@BeforeMethod
|
||||
public void login() {
|
||||
new LoginPageHelper(driver).authorizationTenant();
|
||||
sideBarMenuView = new SideBarMenuViewHelper(driver);
|
||||
profilesPage = new ProfilesPageHelper(driver);
|
||||
}
|
||||
|
||||
@AfterMethod
|
||||
public void makeProfileDefault() {
|
||||
testRestClient.setDefaultAssetProfile(getAssetProfileByName("default").getId());
|
||||
testRestClient.deleteAssetProfile(getAssetProfileByName(name).getId());
|
||||
}
|
||||
|
||||
@Test(priority = 10, groups = "smoke")
|
||||
@Description
|
||||
public void makeDeviceProfileDefaultByRightCornerBtn() {
|
||||
String name = ENTITY_NAME;
|
||||
testRestClient.postAssetProfile(EntityPrototypes.defaultAssetProfile(name));
|
||||
this.name = name;
|
||||
|
||||
sideBarMenuView.openAssetProfiles();
|
||||
profilesPage.makeProfileDefaultBtn(name).click();
|
||||
profilesPage.warningPopUpYesBtn().click();
|
||||
|
||||
Assert.assertTrue(profilesPage.defaultCheckbox(name).isDisplayed());
|
||||
}
|
||||
|
||||
@Test(priority = 10, groups = "smoke")
|
||||
@Description
|
||||
public void makeDeviceProfileDefaultFromView() {
|
||||
String name = ENTITY_NAME;
|
||||
testRestClient.postAssetProfile(EntityPrototypes.defaultAssetProfile(name));
|
||||
this.name = name;
|
||||
|
||||
sideBarMenuView.openAssetProfiles();
|
||||
profilesPage.entity(name).click();
|
||||
profilesPage.assetProfileViewMakeDefaultBtn().click();
|
||||
profilesPage.warningPopUpYesBtn().click();
|
||||
profilesPage.closeEntityViewBtn().click();
|
||||
|
||||
Assert.assertTrue(profilesPage.defaultCheckbox(name).isDisplayed());
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,62 @@
|
||||
/**
|
||||
* 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.assetProfileSmoke;
|
||||
|
||||
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 org.thingsboard.server.msa.ui.utils.EntityPrototypes;
|
||||
|
||||
public class SearchAssetProfileTest extends AbstractDriverBaseTest {
|
||||
|
||||
private SideBarMenuViewHelper sideBarMenuView;
|
||||
private ProfilesPageHelper profilesPage;
|
||||
private String name;
|
||||
|
||||
@BeforeMethod
|
||||
public void login() {
|
||||
new LoginPageHelper(driver).authorizationTenant();
|
||||
sideBarMenuView = new SideBarMenuViewHelper(driver);
|
||||
profilesPage = new ProfilesPageHelper(driver);
|
||||
}
|
||||
|
||||
@AfterMethod
|
||||
public void delete() {
|
||||
if (name != null) {
|
||||
testRestClient.deleteAssetProfile(getAssetProfileByName(name).getId());
|
||||
name = null;
|
||||
}
|
||||
}
|
||||
|
||||
@Test(priority = 10, groups = "smoke", dataProviderClass = DataProviderCredential.class, dataProvider = "assetProfileSearch")
|
||||
@Description
|
||||
public void searchFirstWord(String name, String namePath) {
|
||||
testRestClient.postAssetProfile(EntityPrototypes.defaultAssetProfile(name));
|
||||
this.name = name;
|
||||
|
||||
sideBarMenuView.openAssetProfiles();
|
||||
profilesPage.searchEntity(namePath);
|
||||
|
||||
profilesPage.allEntity().forEach(x -> Assert.assertTrue(x.getText().contains(namePath)));
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,127 @@
|
||||
/**
|
||||
* 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.assetProfileSmoke;
|
||||
|
||||
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.EntityPrototypes.defaultAssetProfile;
|
||||
|
||||
public class SortByNameTest extends AbstractDriverBaseTest {
|
||||
private SideBarMenuViewHelper sideBarMenuView;
|
||||
private ProfilesPageHelper profilesPage;
|
||||
private String name;
|
||||
|
||||
@BeforeMethod
|
||||
public void login() {
|
||||
new LoginPageHelper(driver).authorizationTenant();
|
||||
sideBarMenuView = new SideBarMenuViewHelper(driver);
|
||||
profilesPage = new ProfilesPageHelper(driver);
|
||||
}
|
||||
|
||||
@AfterMethod
|
||||
public void delete() {
|
||||
if (name != null) {
|
||||
testRestClient.deleteAssetProfile(getAssetProfileByName(name).getId());
|
||||
name = null;
|
||||
}
|
||||
}
|
||||
|
||||
@Test(priority = 10, groups = "smoke", dataProviderClass = DataProviderCredential.class, dataProvider = "nameForSort")
|
||||
@Description
|
||||
public void specialCharacterUp(String name) {
|
||||
testRestClient.postAssetProfile(defaultAssetProfile(name));
|
||||
this.name = name;
|
||||
|
||||
sideBarMenuView.openAssetProfiles();
|
||||
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 assetProfile, String assetProfileSymbol, String assetProfileNumber) {
|
||||
testRestClient.postAssetProfile(defaultAssetProfile(assetProfileSymbol));
|
||||
testRestClient.postAssetProfile(defaultAssetProfile(assetProfile));
|
||||
testRestClient.postAssetProfile(defaultAssetProfile(assetProfileNumber));
|
||||
|
||||
sideBarMenuView.openAssetProfiles();
|
||||
profilesPage.sortByNameBtn().click();
|
||||
profilesPage.setProfileName(0);
|
||||
String firstAssetProfile = profilesPage.getProfileName();
|
||||
profilesPage.setProfileName(1);
|
||||
String secondAssetProfile = profilesPage.getProfileName();
|
||||
profilesPage.setProfileName(2);
|
||||
String thirdAssetProfile = profilesPage.getProfileName();
|
||||
|
||||
testRestClient.deleteAssetProfile(getAssetProfileByName(assetProfile).getId());
|
||||
testRestClient.deleteAssetProfile(getAssetProfileByName(assetProfileNumber).getId());
|
||||
testRestClient.deleteAssetProfile(getAssetProfileByName(assetProfileSymbol).getId());
|
||||
|
||||
Assert.assertEquals(firstAssetProfile, assetProfileSymbol);
|
||||
Assert.assertEquals(secondAssetProfile, assetProfileNumber);
|
||||
Assert.assertEquals(thirdAssetProfile, assetProfile);
|
||||
}
|
||||
|
||||
@Test(priority = 10, groups = "smoke", dataProviderClass = DataProviderCredential.class, dataProvider = "nameForSort")
|
||||
@Description
|
||||
public void specialCharacterDown(String name) {
|
||||
testRestClient.postAssetProfile(defaultAssetProfile(name));
|
||||
this.name = name;
|
||||
|
||||
sideBarMenuView.openAssetProfiles();
|
||||
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 assetProfile, String assetProfileSymbol, String assetProfileNumber) {
|
||||
testRestClient.postAssetProfile(defaultAssetProfile(assetProfileSymbol));
|
||||
testRestClient.postAssetProfile(defaultAssetProfile(assetProfile));
|
||||
testRestClient.postAssetProfile(defaultAssetProfile(assetProfileNumber));
|
||||
|
||||
sideBarMenuView.openAssetProfiles();
|
||||
int lastIndex = profilesPage.allEntity().size() - 1;
|
||||
profilesPage.sortByNameDown();
|
||||
profilesPage.setProfileName(lastIndex);
|
||||
String firstAssetProfile = profilesPage.getProfileName();
|
||||
profilesPage.setProfileName(lastIndex - 1);
|
||||
String secondAssetProfile = profilesPage.getProfileName();
|
||||
profilesPage.setProfileName(lastIndex - 2);
|
||||
String thirdAssetProfile = profilesPage.getProfileName();
|
||||
|
||||
testRestClient.deleteAssetProfile(getAssetProfileByName(assetProfile).getId());
|
||||
testRestClient.deleteAssetProfile(getAssetProfileByName(assetProfileNumber).getId());
|
||||
testRestClient.deleteAssetProfile(getAssetProfileByName(assetProfileSymbol).getId());
|
||||
|
||||
Assert.assertEquals(firstAssetProfile, assetProfileSymbol);
|
||||
Assert.assertEquals(secondAssetProfile, assetProfileNumber);
|
||||
Assert.assertEquals(thirdAssetProfile, assetProfile);
|
||||
}
|
||||
}
|
||||
@ -16,6 +16,7 @@
|
||||
package org.thingsboard.server.msa.ui.tests.customerSmoke;
|
||||
|
||||
import io.qameta.allure.Description;
|
||||
import org.openqa.selenium.Keys;
|
||||
import org.testng.Assert;
|
||||
import org.testng.annotations.AfterMethod;
|
||||
import org.testng.annotations.BeforeMethod;
|
||||
@ -28,8 +29,6 @@ import org.thingsboard.server.msa.ui.pages.SideBarMenuViewElements;
|
||||
import static org.thingsboard.server.msa.ui.utils.Const.EMPTY_CUSTOMER_MESSAGE;
|
||||
import static org.thingsboard.server.msa.ui.utils.Const.ENTITY_NAME;
|
||||
import static org.thingsboard.server.msa.ui.utils.Const.SAME_NAME_WARNING_CUSTOMER_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 CreateCustomerTest extends AbstractDriverBaseTest {
|
||||
|
||||
@ -39,9 +38,7 @@ public class CreateCustomerTest extends AbstractDriverBaseTest {
|
||||
|
||||
@BeforeMethod
|
||||
public void login() {
|
||||
openLocalhost();
|
||||
new LoginPageHelper(driver).authorizationTenant();
|
||||
testRestClient.login(TENANT_EMAIL, TENANT_PASSWORD);
|
||||
sideBarMenuView = new SideBarMenuViewElements(driver);
|
||||
customerPage = new CustomerPageHelper(driver);
|
||||
}
|
||||
@ -61,7 +58,7 @@ public class CreateCustomerTest extends AbstractDriverBaseTest {
|
||||
|
||||
sideBarMenuView.customerBtn().click();
|
||||
customerPage.plusBtn().click();
|
||||
customerPage.titleFieldAddEntityView().sendKeys(customerName);
|
||||
customerPage.addCustomerViewEnterName(customerName);
|
||||
customerPage.addBtnC().click();
|
||||
this.customerName = customerName;
|
||||
customerPage.refreshBtn().click();
|
||||
@ -80,7 +77,7 @@ public class CreateCustomerTest extends AbstractDriverBaseTest {
|
||||
|
||||
sideBarMenuView.customerBtn().click();
|
||||
customerPage.plusBtn().click();
|
||||
customerPage.titleFieldAddEntityView().sendKeys(customerName);
|
||||
customerPage.addCustomerViewEnterName(customerName);
|
||||
customerPage.selectCountryAddEntityView();
|
||||
customerPage.descriptionAddEntityView().sendKeys(text);
|
||||
customerPage.cityAddEntityView().sendKeys(text);
|
||||
@ -128,7 +125,7 @@ public class CreateCustomerTest extends AbstractDriverBaseTest {
|
||||
public void createCustomerWithOnlySpace() {
|
||||
sideBarMenuView.customerBtn().click();
|
||||
customerPage.plusBtn().click();
|
||||
customerPage.titleFieldAddEntityView().sendKeys(" ");
|
||||
customerPage.addCustomerViewEnterName(Keys.SPACE);
|
||||
customerPage.addBtnC().click();
|
||||
|
||||
Assert.assertNotNull(customerPage.warningMessage());
|
||||
@ -145,7 +142,7 @@ public class CreateCustomerTest extends AbstractDriverBaseTest {
|
||||
customerPage.setCustomerName();
|
||||
String customerName = customerPage.getCustomerName();
|
||||
customerPage.plusBtn().click();
|
||||
customerPage.titleFieldAddEntityView().sendKeys(customerName);
|
||||
customerPage.addCustomerViewEnterName(customerName);
|
||||
customerPage.addBtnC().click();
|
||||
|
||||
Assert.assertNotNull(customerPage.warningMessage());
|
||||
@ -162,7 +159,7 @@ public class CreateCustomerTest extends AbstractDriverBaseTest {
|
||||
|
||||
sideBarMenuView.customerBtn().click();
|
||||
customerPage.plusBtn().click();
|
||||
customerPage.titleFieldAddEntityView().sendKeys(customerName);
|
||||
customerPage.addCustomerViewEnterName(customerName);
|
||||
customerPage.addBtnC().click();
|
||||
this.customerName = customerName;
|
||||
|
||||
|
||||
@ -26,13 +26,12 @@ import org.thingsboard.server.msa.ui.pages.DashboardPageHelper;
|
||||
import org.thingsboard.server.msa.ui.pages.LoginPageHelper;
|
||||
import org.thingsboard.server.msa.ui.pages.SideBarMenuViewElements;
|
||||
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_CUSTOMER_MESSAGE;
|
||||
import static org.thingsboard.server.msa.ui.utils.Const.ENTITY_NAME;
|
||||
import static org.thingsboard.server.msa.ui.utils.Const.PHONE_NUMBER_ERROR_MESSAGE;
|
||||
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 CustomerEditMenuTest extends AbstractDriverBaseTest {
|
||||
@ -44,9 +43,7 @@ public class CustomerEditMenuTest extends AbstractDriverBaseTest {
|
||||
|
||||
@BeforeMethod
|
||||
public void login() {
|
||||
openLocalhost();
|
||||
new LoginPageHelper(driver).authorizationTenant();
|
||||
testRestClient.login(TENANT_EMAIL, TENANT_PASSWORD);
|
||||
sideBarMenuView = new SideBarMenuViewElements(driver);
|
||||
customerPage = new CustomerPageHelper(driver);
|
||||
dashboardPage = new DashboardPageHelper(driver);
|
||||
@ -109,31 +106,21 @@ public class CustomerEditMenuTest extends AbstractDriverBaseTest {
|
||||
Assert.assertEquals(customerPage.getCustomerName(), customerPage.getHeaderName());
|
||||
}
|
||||
|
||||
@Test(priority = 20, groups = "smoke")
|
||||
@Test(priority = 20, groups = "smoke", dataProviderClass = DataProviderCredential.class, dataProvider = "editMenuDescription")
|
||||
@Description
|
||||
public void editDescription() {
|
||||
String customerName = ENTITY_NAME;
|
||||
testRestClient.postCustomer(defaultCustomerPrototype(customerName));
|
||||
this.customerName = customerName;
|
||||
String description = "Description";
|
||||
public void editDescription(String description, String newDescription, String finalDescription) {
|
||||
String name = ENTITY_NAME;
|
||||
testRestClient.postCustomer(EntityPrototypes.defaultCustomerPrototype(name, description));
|
||||
customerName = name;
|
||||
|
||||
sideBarMenuView.customerBtn().click();
|
||||
customerPage.entityTitles().get(0).click();
|
||||
customerPage.entity(name).click();
|
||||
customerPage.editPencilBtn().click();
|
||||
customerPage.descriptionEntityView().sendKeys(description);
|
||||
customerPage.doneBtnEditView().click();
|
||||
String description1 = customerPage.descriptionEntityView().getAttribute("value");
|
||||
customerPage.editPencilBtn().click();
|
||||
customerPage.descriptionEntityView().sendKeys(description);
|
||||
customerPage.doneBtnEditView().click();
|
||||
String description2 = customerPage.descriptionEntityView().getAttribute("value");
|
||||
customerPage.editPencilBtn().click();
|
||||
customerPage.changeDescription("");
|
||||
customerPage.descriptionEntityView().sendKeys(newDescription);
|
||||
customerPage.doneBtnEditView().click();
|
||||
customerPage.setDescription();
|
||||
|
||||
Assert.assertEquals(description, description1);
|
||||
Assert.assertEquals(description + description, description2);
|
||||
Assert.assertTrue(customerPage.descriptionEntityView().getAttribute("value").isEmpty());
|
||||
Assert.assertEquals(customerPage.getDescription(), finalDescription);
|
||||
}
|
||||
|
||||
@Test(priority = 20, groups = "smoke")
|
||||
|
||||
@ -26,8 +26,6 @@ import org.thingsboard.server.msa.ui.pages.RuleChainsPageHelper;
|
||||
import org.thingsboard.server.msa.ui.pages.SideBarMenuViewElements;
|
||||
|
||||
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 DeleteCustomerTest extends AbstractDriverBaseTest {
|
||||
@ -38,9 +36,7 @@ public class DeleteCustomerTest extends AbstractDriverBaseTest {
|
||||
|
||||
@BeforeMethod
|
||||
public void login() {
|
||||
openLocalhost();
|
||||
new LoginPageHelper(driver).authorizationTenant();
|
||||
testRestClient.login(TENANT_EMAIL, TENANT_PASSWORD);
|
||||
sideBarMenuView = new SideBarMenuViewElements(driver);
|
||||
customerPage = new CustomerPageHelper(driver);
|
||||
ruleChainsPage = new RuleChainsPageHelper(driver);
|
||||
|
||||
@ -25,8 +25,6 @@ import org.thingsboard.server.msa.ui.pages.LoginPageHelper;
|
||||
import org.thingsboard.server.msa.ui.pages.SideBarMenuViewElements;
|
||||
|
||||
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 DeleteSeveralCustomerTest extends AbstractDriverBaseTest {
|
||||
@ -36,9 +34,7 @@ public class DeleteSeveralCustomerTest extends AbstractDriverBaseTest {
|
||||
|
||||
@BeforeMethod
|
||||
public void login() {
|
||||
openLocalhost();
|
||||
new LoginPageHelper(driver).authorizationTenant();
|
||||
testRestClient.login(TENANT_EMAIL, TENANT_PASSWORD);
|
||||
sideBarMenuView = new SideBarMenuViewElements(driver);
|
||||
customerPage = new CustomerPageHelper(driver);
|
||||
}
|
||||
|
||||
@ -32,7 +32,6 @@ public class ManageCustomersAssetsTest extends AbstractDriverBaseTest {
|
||||
|
||||
@BeforeMethod
|
||||
public void login() {
|
||||
openLocalhost();
|
||||
new LoginPageHelper(driver).authorizationTenant();
|
||||
sideBarMenuView = new SideBarMenuViewElements(driver);
|
||||
customerPage = new CustomerPageHelper(driver);
|
||||
|
||||
@ -31,7 +31,6 @@ public class ManageCustomersDashboardsTest extends AbstractDriverBaseTest {
|
||||
|
||||
@BeforeMethod
|
||||
public void login() {
|
||||
openLocalhost();
|
||||
new LoginPageHelper(driver).authorizationTenant();
|
||||
sideBarMenuView = new SideBarMenuViewElements(driver);
|
||||
customerPage = new CustomerPageHelper(driver);
|
||||
|
||||
@ -31,7 +31,6 @@ public class ManageCustomersDevicesTest extends AbstractDriverBaseTest {
|
||||
|
||||
@BeforeMethod
|
||||
public void login() {
|
||||
openLocalhost();
|
||||
new LoginPageHelper(driver).authorizationTenant();
|
||||
sideBarMenuView = new SideBarMenuViewElements(driver);
|
||||
customerPage = new CustomerPageHelper(driver);
|
||||
|
||||
@ -32,7 +32,6 @@ public class ManageCustomersEdgesTest extends AbstractDriverBaseTest {
|
||||
|
||||
@BeforeMethod
|
||||
public void login() {
|
||||
openLocalhost();
|
||||
new LoginPageHelper(driver).authorizationTenant();
|
||||
sideBarMenuView = new SideBarMenuViewElements(driver);
|
||||
customerPage = new CustomerPageHelper(driver);
|
||||
|
||||
@ -32,7 +32,6 @@ public class ManageCustomersUsersTest extends AbstractDriverBaseTest {
|
||||
|
||||
@BeforeMethod
|
||||
public void login() {
|
||||
openLocalhost();
|
||||
new LoginPageHelper(driver).authorizationTenant();
|
||||
sideBarMenuView = new SideBarMenuViewElements(driver);
|
||||
customerPage = new CustomerPageHelper(driver);
|
||||
|
||||
@ -25,8 +25,6 @@ import org.thingsboard.server.msa.ui.pages.LoginPageHelper;
|
||||
import org.thingsboard.server.msa.ui.pages.SideBarMenuViewElements;
|
||||
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;
|
||||
|
||||
public class SearchCustomerTest extends AbstractDriverBaseTest {
|
||||
@ -36,9 +34,7 @@ public class SearchCustomerTest extends AbstractDriverBaseTest {
|
||||
|
||||
@BeforeMethod
|
||||
public void login() {
|
||||
openLocalhost();
|
||||
new LoginPageHelper(driver).authorizationTenant();
|
||||
testRestClient.login(TENANT_EMAIL, TENANT_PASSWORD);
|
||||
sideBarMenuView = new SideBarMenuViewElements(driver);
|
||||
customerPage = new CustomerPageHelper(driver);
|
||||
}
|
||||
|
||||
@ -26,8 +26,6 @@ import org.thingsboard.server.msa.ui.pages.LoginPageHelper;
|
||||
import org.thingsboard.server.msa.ui.pages.SideBarMenuViewElements;
|
||||
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;
|
||||
|
||||
public class SortByNameTest extends AbstractDriverBaseTest {
|
||||
@ -37,9 +35,7 @@ public class SortByNameTest extends AbstractDriverBaseTest {
|
||||
|
||||
@BeforeMethod
|
||||
public void login() {
|
||||
openLocalhost();
|
||||
new LoginPageHelper(driver).authorizationTenant();
|
||||
testRestClient.login(TENANT_EMAIL, TENANT_PASSWORD);
|
||||
sideBarMenuView = new SideBarMenuViewElements(driver);
|
||||
customerPage = new CustomerPageHelper(driver);
|
||||
}
|
||||
|
||||
@ -31,8 +31,6 @@ import static org.thingsboard.server.msa.ui.utils.Const.IMPORT_DEVICE_PROFILE_FI
|
||||
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;
|
||||
|
||||
public class CreateDeviceProfileImportTest extends AbstractDriverBaseTest {
|
||||
|
||||
@ -44,9 +42,7 @@ public class CreateDeviceProfileImportTest extends AbstractDriverBaseTest {
|
||||
|
||||
@BeforeMethod
|
||||
public void login() {
|
||||
openLocalhost();
|
||||
new LoginPageHelper(driver).authorizationTenant();
|
||||
testRestClient.login(TENANT_EMAIL, TENANT_PASSWORD);
|
||||
sideBarMenuView = new SideBarMenuViewHelper(driver);
|
||||
profilesPage = new ProfilesPageHelper(driver);
|
||||
}
|
||||
@ -59,7 +55,8 @@ public class CreateDeviceProfileImportTest extends AbstractDriverBaseTest {
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
@Test(priority = 10, groups = "smoke")
|
||||
@Description
|
||||
public void importDeviceProfile() {
|
||||
sideBarMenuView.openDeviceProfiles();
|
||||
profilesPage.openImportDeviceProfileView();
|
||||
@ -72,7 +69,8 @@ public class CreateDeviceProfileImportTest extends AbstractDriverBaseTest {
|
||||
Assert.assertTrue(profilesPage.entity(IMPORT_DEVICE_PROFILE_NAME).isDisplayed());
|
||||
}
|
||||
|
||||
@Test
|
||||
@Test(priority = 20, groups = "smoke")
|
||||
@Description
|
||||
public void importTxtFile() {
|
||||
sideBarMenuView.openDeviceProfiles();
|
||||
profilesPage.openImportDeviceProfileView();
|
||||
@ -82,7 +80,7 @@ public class CreateDeviceProfileImportTest extends AbstractDriverBaseTest {
|
||||
Assert.assertTrue(profilesPage.importingFile(EMPTY_IMPORT_MESSAGE).isDisplayed());
|
||||
}
|
||||
|
||||
@Test(groups = "smoke")
|
||||
@Test(priority = 20, groups = "smoke")
|
||||
@Description
|
||||
public void addFileTiImportAndRemove() {
|
||||
sideBarMenuView.openDeviceProfiles();
|
||||
@ -95,7 +93,8 @@ public class CreateDeviceProfileImportTest extends AbstractDriverBaseTest {
|
||||
Assert.assertTrue(profilesPage.entityIsNotPresent(IMPORT_DEVICE_PROFILE_NAME));
|
||||
}
|
||||
|
||||
@Test
|
||||
@Test(priority = 20, groups = "smoke")
|
||||
@Description
|
||||
public void importDeviceProfileWithSameName() {
|
||||
String name = IMPORT_DEVICE_PROFILE_NAME;
|
||||
testRestClient.postDeviceProfile(EntityPrototypes.defaultDeviceProfile(name));
|
||||
@ -112,7 +111,8 @@ public class CreateDeviceProfileImportTest extends AbstractDriverBaseTest {
|
||||
Assert.assertEquals(profilesPage.warningMessage().getText(), SAME_NAME_WARNING_DEVICE_PROFILE_MESSAGE);
|
||||
}
|
||||
|
||||
@Test
|
||||
@Test(priority = 30, groups = "smoke")
|
||||
@Description
|
||||
public void importDeviceProfileWithoutRefresh() {
|
||||
sideBarMenuView.openDeviceProfiles();
|
||||
profilesPage.openImportDeviceProfileView();
|
||||
|
||||
@ -31,8 +31,6 @@ import static org.thingsboard.server.msa.ui.utils.Const.EMPTY_DEVICE_PROFILE_MES
|
||||
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 {
|
||||
|
||||
@ -42,9 +40,7 @@ public class CreateDeviceProfileTest extends AbstractDriverBaseTest {
|
||||
|
||||
@BeforeMethod
|
||||
public void login() {
|
||||
openLocalhost();
|
||||
new LoginPageHelper(driver).authorizationTenant();
|
||||
testRestClient.login(TENANT_EMAIL, TENANT_PASSWORD);
|
||||
sideBarMenuView = new SideBarMenuViewHelper(driver);
|
||||
profilesPage = new ProfilesPageHelper(driver);
|
||||
}
|
||||
@ -57,14 +53,14 @@ public class CreateDeviceProfileTest extends AbstractDriverBaseTest {
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
@Test(priority = 10, groups = "smoke")
|
||||
@Description
|
||||
public void createDeviceProfile() {
|
||||
String name = ENTITY_NAME;
|
||||
|
||||
sideBarMenuView.openDeviceProfiles();
|
||||
profilesPage.openCreateDeviceProfileView();
|
||||
profilesPage.addDeviceProfileNameField().click();
|
||||
profilesPage.addDeviceProfileNameField().sendKeys(name);
|
||||
profilesPage.createDeviceProfileEnterName(name);
|
||||
profilesPage.addDeviceProfileAddBtn().click();
|
||||
this.name = name;
|
||||
profilesPage.refreshBtn().click();
|
||||
@ -73,7 +69,8 @@ public class CreateDeviceProfileTest extends AbstractDriverBaseTest {
|
||||
Assert.assertTrue(profilesPage.entity(name).isDisplayed());
|
||||
}
|
||||
|
||||
@Test
|
||||
@Test(priority = 20, groups = "smoke")
|
||||
@Description
|
||||
public void createDeviceProfileWithDetails() {
|
||||
String name = ENTITY_NAME;
|
||||
String ruleChain = "Root Rule Chain";
|
||||
@ -83,11 +80,11 @@ public class CreateDeviceProfileTest extends AbstractDriverBaseTest {
|
||||
|
||||
sideBarMenuView.openDeviceProfiles();
|
||||
profilesPage.openCreateDeviceProfileView();
|
||||
profilesPage.enterName(name);
|
||||
profilesPage.chooseRuleChain(ruleChain);
|
||||
profilesPage.chooseMobileDashboard(mobileDashboard);
|
||||
profilesPage.chooseQueue(queue);
|
||||
profilesPage.enterDescription(description);
|
||||
profilesPage.createDeviceProfileEnterName(name);
|
||||
profilesPage.addDeviceProfileViewChooseRuleChain(ruleChain);
|
||||
profilesPage.addDeviceProfileViewChooseMobileDashboard(mobileDashboard);
|
||||
profilesPage.addDeviceProfileViewChooseQueue(queue);
|
||||
profilesPage.addDeviceProfileViewEnterDescription(description);
|
||||
profilesPage.addDeviceProfileAddBtn().click();
|
||||
this.name = name;
|
||||
profilesPage.refreshBtn().click();
|
||||
@ -107,7 +104,8 @@ public class CreateDeviceProfileTest extends AbstractDriverBaseTest {
|
||||
Assert.assertEquals(description, profilesPage.getDescription());
|
||||
}
|
||||
|
||||
@Test
|
||||
@Test(priority = 20, groups = "smoke")
|
||||
@Description
|
||||
public void createDeviseProfileWithSameName() {
|
||||
String name = ENTITY_NAME;
|
||||
testRestClient.postDeviceProfile(EntityPrototypes.defaultDeviceProfile(name));
|
||||
@ -115,8 +113,7 @@ public class CreateDeviceProfileTest extends AbstractDriverBaseTest {
|
||||
|
||||
sideBarMenuView.openDeviceProfiles();
|
||||
profilesPage.openCreateDeviceProfileView();
|
||||
profilesPage.addDeviceProfileNameField().click();
|
||||
profilesPage.addDeviceProfileNameField().sendKeys(name);
|
||||
profilesPage.createDeviceProfileEnterName(name);
|
||||
profilesPage.addDeviceProfileAddBtn().click();
|
||||
|
||||
Assert.assertNotNull(profilesPage.warningMessage());
|
||||
@ -126,7 +123,8 @@ public class CreateDeviceProfileTest extends AbstractDriverBaseTest {
|
||||
Assert.assertTrue(profilesPage.addDeviceProfileView().isDisplayed());
|
||||
}
|
||||
|
||||
@Test
|
||||
@Test(priority = 20, groups = "smoke")
|
||||
@Description
|
||||
public void createDeviceProfileWithoutName() {
|
||||
sideBarMenuView.openDeviceProfiles();
|
||||
profilesPage.openCreateDeviceProfileView();
|
||||
@ -138,12 +136,12 @@ public class CreateDeviceProfileTest extends AbstractDriverBaseTest {
|
||||
Assert.assertEquals(profilesPage.errorMessage().getText(), NAME_IS_REQUIRED_MESSAGE);
|
||||
}
|
||||
|
||||
@Test
|
||||
@Test(priority = 20, groups = "smoke")
|
||||
@Description
|
||||
public void createDeviseProfileWithOnlySpaceInName() {
|
||||
sideBarMenuView.openDeviceProfiles();
|
||||
profilesPage.openCreateDeviceProfileView();
|
||||
profilesPage.addDeviceProfileNameField().click();
|
||||
profilesPage.addDeviceProfileNameField().sendKeys(Keys.SPACE);
|
||||
profilesPage.createDeviceProfileEnterName(Keys.SPACE);
|
||||
profilesPage.addDeviceProfileAddBtn().click();
|
||||
|
||||
Assert.assertNotNull(profilesPage.warningMessage());
|
||||
@ -153,14 +151,14 @@ public class CreateDeviceProfileTest extends AbstractDriverBaseTest {
|
||||
Assert.assertTrue(profilesPage.addDeviceProfileView().isDisplayed());
|
||||
}
|
||||
|
||||
@Test
|
||||
@Test(priority = 20, groups = "smoke")
|
||||
@Description
|
||||
public void createDeviceProfileWithoutRefresh() {
|
||||
String name = ENTITY_NAME;
|
||||
|
||||
sideBarMenuView.openDeviceProfiles();
|
||||
profilesPage.openCreateDeviceProfileView();
|
||||
profilesPage.addDeviceProfileNameField().click();
|
||||
profilesPage.addDeviceProfileNameField().sendKeys(name);
|
||||
profilesPage.createDeviceProfileEnterName(name);
|
||||
profilesPage.addDeviceProfileAddBtn().click();
|
||||
this.name = name;
|
||||
|
||||
@ -168,7 +166,7 @@ public class CreateDeviceProfileTest extends AbstractDriverBaseTest {
|
||||
Assert.assertTrue(profilesPage.entity(name).isDisplayed());
|
||||
}
|
||||
|
||||
@Test(groups = "smoke")
|
||||
@Test(priority = 30, groups = "smoke")
|
||||
@Description
|
||||
public void documentation() {
|
||||
String urlPath = "docs/user-guide/device-profiles/";
|
||||
|
||||
@ -15,6 +15,7 @@
|
||||
*/
|
||||
package org.thingsboard.server.msa.ui.tests.deviceProfileSmoke;
|
||||
|
||||
import io.qameta.allure.Description;
|
||||
import org.testng.Assert;
|
||||
import org.testng.annotations.BeforeMethod;
|
||||
import org.testng.annotations.Test;
|
||||
@ -25,8 +26,6 @@ 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 {
|
||||
|
||||
@ -35,14 +34,13 @@ public class DeleteDeviceProfileTest extends AbstractDriverBaseTest {
|
||||
|
||||
@BeforeMethod
|
||||
public void login() {
|
||||
openLocalhost();
|
||||
new LoginPageHelper(driver).authorizationTenant();
|
||||
testRestClient.login(TENANT_EMAIL, TENANT_PASSWORD);
|
||||
sideBarMenuView = new SideBarMenuViewHelper(driver);
|
||||
profilesPage = new ProfilesPageHelper(driver);
|
||||
}
|
||||
|
||||
@Test
|
||||
@Test(priority = 10, groups = "smoke")
|
||||
@Description
|
||||
public void removeDeviceProfile() {
|
||||
String name = ENTITY_NAME;
|
||||
testRestClient.postDeviceProfile(EntityPrototypes.defaultDeviceProfile(name));
|
||||
@ -55,7 +53,8 @@ public class DeleteDeviceProfileTest extends AbstractDriverBaseTest {
|
||||
Assert.assertTrue(profilesPage.entityIsNotPresent(name));
|
||||
}
|
||||
|
||||
@Test
|
||||
@Test(priority = 20, groups = "smoke")
|
||||
@Description
|
||||
public void removeDeviceProfileFromView() {
|
||||
String name = ENTITY_NAME;
|
||||
testRestClient.postDeviceProfile(EntityPrototypes.defaultDeviceProfile(name));
|
||||
@ -69,7 +68,8 @@ public class DeleteDeviceProfileTest extends AbstractDriverBaseTest {
|
||||
Assert.assertTrue(profilesPage.entityIsNotPresent(name));
|
||||
}
|
||||
|
||||
@Test
|
||||
@Test(priority = 20, groups = "smoke")
|
||||
@Description
|
||||
public void removeSelectedDeviceProfile() {
|
||||
String name = ENTITY_NAME;
|
||||
testRestClient.postDeviceProfile(EntityPrototypes.defaultDeviceProfile(name));
|
||||
@ -83,14 +83,16 @@ public class DeleteDeviceProfileTest extends AbstractDriverBaseTest {
|
||||
Assert.assertTrue(profilesPage.entityIsNotPresent(name));
|
||||
}
|
||||
|
||||
@Test
|
||||
@Test(priority = 20, groups = "smoke")
|
||||
@Description
|
||||
public void removeDefaultDeviceProfile() {
|
||||
sideBarMenuView.openDeviceProfiles();
|
||||
|
||||
Assert.assertFalse(profilesPage.deleteBtn("default").isEnabled());
|
||||
}
|
||||
|
||||
@Test
|
||||
@Test(priority = 20, groups = "smoke")
|
||||
@Description
|
||||
public void removeDefaultDeviceProfileFromView() {
|
||||
sideBarMenuView.openDeviceProfiles();
|
||||
profilesPage.entity("default").click();
|
||||
@ -98,7 +100,8 @@ public class DeleteDeviceProfileTest extends AbstractDriverBaseTest {
|
||||
Assert.assertTrue(profilesPage.deleteDeviceProfileFromViewBtnIsNotDisplayed());
|
||||
}
|
||||
|
||||
@Test
|
||||
@Test(priority = 20, groups = "smoke")
|
||||
@Description
|
||||
public void removeSelectedDefaultDeviceProfile() {
|
||||
sideBarMenuView.openDeviceProfiles();
|
||||
|
||||
@ -106,7 +109,8 @@ public class DeleteDeviceProfileTest extends AbstractDriverBaseTest {
|
||||
Assert.assertFalse(profilesPage.presentCheckBox("default").isDisplayed());
|
||||
}
|
||||
|
||||
@Test
|
||||
@Test(priority = 30, groups = "smoke")
|
||||
@Description
|
||||
public void removeDeviceProfileWithoutRefresh() {
|
||||
String name = ENTITY_NAME;
|
||||
testRestClient.postDeviceProfile(EntityPrototypes.defaultDeviceProfile(name));
|
||||
|
||||
@ -25,8 +25,6 @@ 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.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.defaultDeviceProfile;
|
||||
|
||||
public class DeleteSeveralDeviceProfilesTest extends AbstractDriverBaseTest {
|
||||
@ -35,9 +33,7 @@ public class DeleteSeveralDeviceProfilesTest extends AbstractDriverBaseTest {
|
||||
|
||||
@BeforeMethod
|
||||
public void login() {
|
||||
openLocalhost();
|
||||
new LoginPageHelper(driver).authorizationTenant();
|
||||
testRestClient.login(TENANT_EMAIL, TENANT_PASSWORD);
|
||||
sideBarMenuView = new SideBarMenuViewHelper(driver);
|
||||
profilesPage = new ProfilesPageHelper(driver);
|
||||
}
|
||||
@ -60,7 +56,7 @@ public class DeleteSeveralDeviceProfilesTest extends AbstractDriverBaseTest {
|
||||
Assert.assertTrue(profilesPage.profileIsNotPresent(name2));
|
||||
}
|
||||
|
||||
@Test(priority = 10, groups = "smoke")
|
||||
@Test(priority = 20, groups = "smoke")
|
||||
@Description
|
||||
public void selectAllDeviceProfiles() {
|
||||
sideBarMenuView.openDeviceProfiles();
|
||||
@ -78,7 +74,7 @@ public class DeleteSeveralDeviceProfilesTest extends AbstractDriverBaseTest {
|
||||
sideBarMenuView.openDeviceProfiles();
|
||||
profilesPage.selectAllCheckBox().click();
|
||||
|
||||
profilesPage.assertCheckBoxIsNotDisplayed("default");
|
||||
Assert.assertFalse(profilesPage.checkBoxIsDisplayed("default"));
|
||||
Assert.assertFalse(profilesPage.deleteBtn("default").isEnabled());
|
||||
}
|
||||
|
||||
|
||||
@ -16,6 +16,7 @@
|
||||
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;
|
||||
@ -30,8 +31,6 @@ 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;
|
||||
|
||||
public class DeviceProfileEditMenuTest extends AbstractDriverBaseTest {
|
||||
|
||||
@ -41,9 +40,7 @@ public class DeviceProfileEditMenuTest extends AbstractDriverBaseTest {
|
||||
|
||||
@BeforeMethod
|
||||
public void login() {
|
||||
openLocalhost();
|
||||
new LoginPageHelper(driver).authorizationTenant();
|
||||
testRestClient.login(TENANT_EMAIL, TENANT_PASSWORD);
|
||||
sideBarMenuView = new SideBarMenuViewHelper(driver);
|
||||
profilesPage = new ProfilesPageHelper(driver);
|
||||
}
|
||||
@ -94,7 +91,7 @@ public class DeviceProfileEditMenuTest extends AbstractDriverBaseTest {
|
||||
Assert.assertFalse(profilesPage.doneBtnEditViewVisible().isEnabled());
|
||||
}
|
||||
|
||||
@Test(priority = 10, groups = "smoke")
|
||||
@Test(priority = 20, groups = "smoke")
|
||||
@Description
|
||||
public void saveWithOnlySpaceInName() {
|
||||
String name = ENTITY_NAME;
|
||||
@ -104,7 +101,7 @@ public class DeviceProfileEditMenuTest extends AbstractDriverBaseTest {
|
||||
sideBarMenuView.openDeviceProfiles();
|
||||
profilesPage.entity(name).click();
|
||||
jsClick(profilesPage.editPencilBtn());
|
||||
profilesPage.changeNameEditMenu(" ");
|
||||
profilesPage.changeNameEditMenu(Keys.SPACE);
|
||||
profilesPage.doneBtnEditView().click();
|
||||
|
||||
Assert.assertNotNull(profilesPage.warningMessage());
|
||||
@ -112,7 +109,7 @@ public class DeviceProfileEditMenuTest extends AbstractDriverBaseTest {
|
||||
Assert.assertEquals(profilesPage.warningMessage().getText(), EMPTY_DEVICE_PROFILE_MESSAGE);
|
||||
}
|
||||
|
||||
@Test(priority = 10, groups = "smoke", dataProviderClass = DataProviderCredential.class, dataProvider = "editMenuDescription")
|
||||
@Test(priority = 30, groups = "smoke", dataProviderClass = DataProviderCredential.class, dataProvider = "editMenuDescription")
|
||||
@Description
|
||||
public void editDescription(String description, String newDescription, String finalDescription) {
|
||||
String name = ENTITY_NAME;
|
||||
|
||||
@ -25,18 +25,13 @@ 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.TENANT_EMAIL;
|
||||
import static org.thingsboard.server.msa.ui.utils.Const.TENANT_PASSWORD;
|
||||
|
||||
public class MakeDeviceProfileDefaultTest 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);
|
||||
}
|
||||
@ -58,14 +53,14 @@ public class MakeDeviceProfileDefaultTest extends AbstractDriverBaseTest {
|
||||
Assert.assertTrue(profilesPage.defaultCheckbox(profile).isDisplayed());
|
||||
}
|
||||
|
||||
@Test(priority = 20, groups = "smoke")
|
||||
@Test(priority = 10, groups = "smoke")
|
||||
@Description
|
||||
public void makeDeviceProfileDefaultFromView() {
|
||||
sideBarMenuView.openDeviceProfiles();
|
||||
profilesPage.setProfileName();
|
||||
String profile = profilesPage.getProfileName();
|
||||
profilesPage.entity(profile).click();
|
||||
profilesPage.profileViewMakeDefaultBtn().click();
|
||||
profilesPage.deviceProfileViewMakeDefaultBtn().click();
|
||||
profilesPage.warningPopUpYesBtn().click();
|
||||
profilesPage.closeEntityViewBtn().click();
|
||||
|
||||
|
||||
@ -26,8 +26,6 @@ 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 {
|
||||
@ -38,9 +36,7 @@ public class SearchDeviceProfileTest extends AbstractDriverBaseTest {
|
||||
|
||||
@BeforeMethod
|
||||
public void login() {
|
||||
openLocalhost();
|
||||
new LoginPageHelper(driver).authorizationTenant();
|
||||
testRestClient.login(TENANT_EMAIL, TENANT_PASSWORD);
|
||||
sideBarMenuView = new SideBarMenuViewHelper(driver);
|
||||
profilesPage = new ProfilesPageHelper(driver);
|
||||
}
|
||||
|
||||
@ -26,8 +26,6 @@ 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 SortByNameTest extends AbstractDriverBaseTest {
|
||||
@ -37,9 +35,7 @@ public class SortByNameTest extends AbstractDriverBaseTest {
|
||||
|
||||
@BeforeMethod
|
||||
public void login() {
|
||||
openLocalhost();
|
||||
new LoginPageHelper(driver).authorizationTenant();
|
||||
testRestClient.login(TENANT_EMAIL, TENANT_PASSWORD);
|
||||
sideBarMenuView = new SideBarMenuViewHelper(driver);
|
||||
profilesPage = new ProfilesPageHelper(driver);
|
||||
}
|
||||
|
||||
@ -32,8 +32,6 @@ import static org.thingsboard.server.msa.ui.utils.Const.EMPTY_IMPORT_MESSAGE;
|
||||
import static org.thingsboard.server.msa.ui.utils.Const.IMPORT_RULE_CHAIN_FILE_NAME;
|
||||
import static org.thingsboard.server.msa.ui.utils.Const.IMPORT_RULE_CHAIN_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;
|
||||
import static org.thingsboard.server.msa.ui.utils.EntityPrototypes.defaultRuleChainPrototype;
|
||||
|
||||
public class CreateRuleChainImportTest extends AbstractDriverBaseTest {
|
||||
@ -46,9 +44,7 @@ public class CreateRuleChainImportTest extends AbstractDriverBaseTest {
|
||||
|
||||
@BeforeMethod
|
||||
public void login() {
|
||||
openLocalhost();
|
||||
new LoginPageHelper(driver).authorizationTenant();
|
||||
testRestClient.login(TENANT_EMAIL, TENANT_PASSWORD);
|
||||
sideBarMenuView = new SideBarMenuViewElements(driver);
|
||||
ruleChainsPage = new RuleChainsPageHelper(driver);
|
||||
openRuleChainPage = new OpenRuleChainPageHelper(driver);
|
||||
|
||||
@ -30,8 +30,6 @@ import java.util.ArrayList;
|
||||
|
||||
import static org.thingsboard.server.msa.ui.utils.Const.EMPTY_RULE_CHAIN_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;
|
||||
|
||||
public class CreateRuleChainTest extends AbstractDriverBaseTest {
|
||||
|
||||
@ -41,9 +39,7 @@ public class CreateRuleChainTest extends AbstractDriverBaseTest {
|
||||
|
||||
@BeforeMethod
|
||||
public void login() {
|
||||
openLocalhost();
|
||||
new LoginPageHelper(driver).authorizationTenant();
|
||||
testRestClient.login(TENANT_EMAIL, TENANT_PASSWORD);
|
||||
sideBarMenuView = new SideBarMenuViewElements(driver);
|
||||
ruleChainsPage = new RuleChainsPageHelper(driver);
|
||||
}
|
||||
|
||||
@ -27,8 +27,6 @@ import org.thingsboard.server.msa.ui.pages.SideBarMenuViewElements;
|
||||
import static org.thingsboard.server.msa.ui.utils.Const.DELETE_RULE_CHAIN_WITH_PROFILE_MESSAGE;
|
||||
import static org.thingsboard.server.msa.ui.utils.Const.ENTITY_NAME;
|
||||
import static org.thingsboard.server.msa.ui.utils.Const.ROOT_RULE_CHAIN_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.defaultRuleChainPrototype;
|
||||
|
||||
public class DeleteRuleChainTest extends AbstractDriverBaseTest {
|
||||
@ -37,9 +35,7 @@ public class DeleteRuleChainTest extends AbstractDriverBaseTest {
|
||||
|
||||
@BeforeMethod
|
||||
public void login() {
|
||||
openLocalhost();
|
||||
new LoginPageHelper(driver).authorizationTenant();
|
||||
testRestClient.login(TENANT_EMAIL, TENANT_PASSWORD);
|
||||
sideBarMenuView = new SideBarMenuViewElements(driver);
|
||||
ruleChainsPage = new RuleChainsPageHelper(driver);
|
||||
}
|
||||
|
||||
@ -26,8 +26,6 @@ import org.thingsboard.server.msa.ui.pages.SideBarMenuViewElements;
|
||||
|
||||
import static org.thingsboard.server.msa.ui.utils.Const.ENTITY_NAME;
|
||||
import static org.thingsboard.server.msa.ui.utils.Const.ROOT_RULE_CHAIN_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.defaultRuleChainPrototype;
|
||||
|
||||
public class DeleteSeveralRuleChainsTest extends AbstractDriverBaseTest {
|
||||
@ -37,9 +35,7 @@ public class DeleteSeveralRuleChainsTest extends AbstractDriverBaseTest {
|
||||
|
||||
@BeforeMethod
|
||||
public void login() {
|
||||
openLocalhost();
|
||||
new LoginPageHelper(driver).authorizationTenant();
|
||||
testRestClient.login(TENANT_EMAIL, TENANT_PASSWORD);
|
||||
sideBarMenuView = new SideBarMenuViewElements(driver);
|
||||
ruleChainsPage = new RuleChainsPageHelper(driver);
|
||||
}
|
||||
|
||||
@ -25,9 +25,6 @@ import org.thingsboard.server.msa.ui.pages.LoginPageHelper;
|
||||
import org.thingsboard.server.msa.ui.pages.RuleChainsPageHelper;
|
||||
import org.thingsboard.server.msa.ui.pages.SideBarMenuViewElements;
|
||||
|
||||
import static org.thingsboard.server.msa.ui.utils.Const.TENANT_EMAIL;
|
||||
import static org.thingsboard.server.msa.ui.utils.Const.TENANT_PASSWORD;
|
||||
|
||||
public class MakeRuleChainRootTest extends AbstractDriverBaseTest {
|
||||
|
||||
private SideBarMenuViewElements sideBarMenuView;
|
||||
@ -35,9 +32,7 @@ public class MakeRuleChainRootTest extends AbstractDriverBaseTest {
|
||||
|
||||
@BeforeMethod
|
||||
public void login() {
|
||||
openLocalhost();
|
||||
new LoginPageHelper(driver).authorizationTenant();
|
||||
testRestClient.login(TENANT_EMAIL, TENANT_PASSWORD);
|
||||
sideBarMenuView = new SideBarMenuViewElements(driver);
|
||||
ruleChainsPage = new RuleChainsPageHelper(driver);
|
||||
}
|
||||
|
||||
@ -28,8 +28,6 @@ import org.thingsboard.server.msa.ui.pages.SideBarMenuViewElements;
|
||||
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 OpenRuleChainTest extends AbstractDriverBaseTest {
|
||||
|
||||
@ -40,9 +38,7 @@ public class OpenRuleChainTest extends AbstractDriverBaseTest {
|
||||
|
||||
@BeforeMethod
|
||||
public void login() {
|
||||
openLocalhost();
|
||||
new LoginPageHelper(driver).authorizationTenant();
|
||||
testRestClient.login(TENANT_EMAIL, TENANT_PASSWORD);
|
||||
sideBarMenuView = new SideBarMenuViewElements(driver);
|
||||
ruleChainsPage = new RuleChainsPageHelper(driver);
|
||||
openRuleChainPage = new OpenRuleChainPageHelper(driver);
|
||||
|
||||
@ -24,11 +24,11 @@ import org.thingsboard.server.msa.ui.base.AbstractDriverBaseTest;
|
||||
import org.thingsboard.server.msa.ui.pages.LoginPageHelper;
|
||||
import org.thingsboard.server.msa.ui.pages.RuleChainsPageHelper;
|
||||
import org.thingsboard.server.msa.ui.pages.SideBarMenuViewElements;
|
||||
import org.thingsboard.server.msa.ui.utils.DataProviderCredential;
|
||||
import org.thingsboard.server.msa.ui.utils.EntityPrototypes;
|
||||
|
||||
import static org.thingsboard.server.msa.ui.utils.Const.EMPTY_RULE_CHAIN_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.defaultRuleChainPrototype;
|
||||
|
||||
public class RuleChainEditMenuTest extends AbstractDriverBaseTest {
|
||||
@ -39,9 +39,7 @@ public class RuleChainEditMenuTest extends AbstractDriverBaseTest {
|
||||
|
||||
@BeforeMethod
|
||||
public void login() {
|
||||
openLocalhost();
|
||||
new LoginPageHelper(driver).authorizationTenant();
|
||||
testRestClient.login(TENANT_EMAIL, TENANT_PASSWORD);
|
||||
sideBarMenuView = new SideBarMenuViewElements(driver);
|
||||
ruleChainsPage = new RuleChainsPageHelper(driver);
|
||||
}
|
||||
@ -110,31 +108,21 @@ public class RuleChainEditMenuTest extends AbstractDriverBaseTest {
|
||||
Assert.assertEquals(ruleChainsPage.warningMessage().getText(), EMPTY_RULE_CHAIN_MESSAGE);
|
||||
}
|
||||
|
||||
@Test(priority = 20, groups = "smoke")
|
||||
@Test(priority = 20, groups = "smoke", dataProviderClass = DataProviderCredential.class, dataProvider = "editMenuDescription")
|
||||
@Description
|
||||
public void editDescription() {
|
||||
String ruleChainName = ENTITY_NAME;
|
||||
testRestClient.postRuleChain(defaultRuleChainPrototype(ruleChainName));
|
||||
this.ruleChainName = ruleChainName;
|
||||
String description = "Description";
|
||||
public void editDescription(String description, String newDescription, String finalDescription) {
|
||||
String name = ENTITY_NAME;
|
||||
testRestClient.postRuleChain(EntityPrototypes.defaultRuleChainPrototype(name, description));
|
||||
ruleChainName = name;
|
||||
|
||||
sideBarMenuView.ruleChainsBtn().click();
|
||||
ruleChainsPage.detailsBtn(ruleChainName).click();
|
||||
ruleChainsPage.detailsBtn(name).click();
|
||||
ruleChainsPage.editPencilBtn().click();
|
||||
ruleChainsPage.descriptionEntityView().sendKeys(description);
|
||||
ruleChainsPage.doneBtnEditView().click();
|
||||
String description1 = ruleChainsPage.descriptionEntityView().getAttribute("value");
|
||||
ruleChainsPage.editPencilBtn().click();
|
||||
ruleChainsPage.descriptionEntityView().sendKeys(description);
|
||||
ruleChainsPage.doneBtnEditView().click();
|
||||
String description2 = ruleChainsPage.descriptionEntityView().getAttribute("value");
|
||||
ruleChainsPage.editPencilBtn().click();
|
||||
ruleChainsPage.changeDescription("");
|
||||
ruleChainsPage.descriptionEntityView().sendKeys(newDescription);
|
||||
ruleChainsPage.doneBtnEditView().click();
|
||||
ruleChainsPage.setDescription();
|
||||
|
||||
Assert.assertTrue(ruleChainsPage.descriptionEntityView().getAttribute("value").isEmpty());
|
||||
Assert.assertEquals(description, description1);
|
||||
Assert.assertEquals(description + description, description2);
|
||||
Assert.assertEquals(ruleChainsPage.getDescription(), finalDescription);
|
||||
}
|
||||
|
||||
@Test(priority = 20, groups = "smoke")
|
||||
|
||||
@ -25,8 +25,6 @@ import org.thingsboard.server.msa.ui.pages.RuleChainsPageHelper;
|
||||
import org.thingsboard.server.msa.ui.pages.SideBarMenuViewElements;
|
||||
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.defaultRuleChainPrototype;
|
||||
|
||||
public class SearchRuleChainTest extends AbstractDriverBaseTest {
|
||||
@ -36,9 +34,7 @@ public class SearchRuleChainTest extends AbstractDriverBaseTest {
|
||||
|
||||
@BeforeMethod
|
||||
public void login() {
|
||||
openLocalhost();
|
||||
new LoginPageHelper(driver).authorizationTenant();
|
||||
testRestClient.login(TENANT_EMAIL, TENANT_PASSWORD);
|
||||
sideBarMenuView = new SideBarMenuViewElements(driver);
|
||||
ruleChainsPage = new RuleChainsPageHelper(driver);
|
||||
}
|
||||
|
||||
@ -26,8 +26,6 @@ import org.thingsboard.server.msa.ui.pages.RuleChainsPageHelper;
|
||||
import org.thingsboard.server.msa.ui.pages.SideBarMenuViewElements;
|
||||
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.defaultRuleChainPrototype;
|
||||
|
||||
public class SortByNameTest extends AbstractDriverBaseTest {
|
||||
@ -38,9 +36,7 @@ public class SortByNameTest extends AbstractDriverBaseTest {
|
||||
|
||||
@BeforeMethod
|
||||
public void login() {
|
||||
openLocalhost();
|
||||
new LoginPageHelper(driver).authorizationTenant();
|
||||
testRestClient.login(TENANT_EMAIL, TENANT_PASSWORD);
|
||||
sideBarMenuView = new SideBarMenuViewElements(driver);
|
||||
ruleChainsPage = new RuleChainsPageHelper(driver);
|
||||
}
|
||||
|
||||
@ -26,8 +26,6 @@ import org.thingsboard.server.msa.ui.pages.RuleChainsPageHelper;
|
||||
import org.thingsboard.server.msa.ui.pages.SideBarMenuViewElements;
|
||||
|
||||
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.defaultRuleChainPrototype;
|
||||
|
||||
public class SortByTimeTest extends AbstractDriverBaseTest {
|
||||
@ -38,9 +36,7 @@ public class SortByTimeTest extends AbstractDriverBaseTest {
|
||||
|
||||
@BeforeMethod
|
||||
public void login() {
|
||||
openLocalhost();
|
||||
new LoginPageHelper(driver).authorizationTenant();
|
||||
testRestClient.login(TENANT_EMAIL, TENANT_PASSWORD);
|
||||
sideBarMenuView = new SideBarMenuViewElements(driver);
|
||||
ruleChainsPage = new RuleChainsPageHelper(driver);
|
||||
}
|
||||
|
||||
@ -27,16 +27,20 @@ public class Const {
|
||||
public static final String ROOT_RULE_CHAIN_NAME = "Root Rule Chain";
|
||||
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_ASSET_PROFILE_NAME = "Asset 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_ASSET_PROFILE_FILE_NAME = "assetProfileForImport.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 EMPTY_ASSET_PROFILE_MESSAGE = "Asset 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 SAME_NAME_WARNING_ASSET_PROFILE_MESSAGE = "Asset 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.";
|
||||
}
|
||||
@ -34,6 +34,7 @@ public class DataProviderCredential {
|
||||
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";
|
||||
private static final String DEFAULT_ASSET_PROFILE_NAME = "Asset Profile";
|
||||
|
||||
@DataProvider
|
||||
public static Object[][] ruleChainNameForSearchByFirstAndSecondWord() {
|
||||
@ -87,6 +88,15 @@ public class DataProviderCredential {
|
||||
{NAME, String.valueOf(getRandomSymbol())}};
|
||||
}
|
||||
|
||||
@DataProvider
|
||||
public static Object[][] assetProfileSearch() {
|
||||
return new Object[][]{
|
||||
{DEFAULT_ASSET_PROFILE_NAME, DEFAULT_ASSET_PROFILE_NAME.split(" ")[0]},
|
||||
{DEFAULT_ASSET_PROFILE_NAME, DEFAULT_ASSET_PROFILE_NAME.split(" ")[1]},
|
||||
{NAME, ENTITY_NAME.split("`")[1]},
|
||||
{NAME, String.valueOf(getRandomSymbol())}};
|
||||
}
|
||||
|
||||
@DataProvider
|
||||
public static Object[][] editMenuDescription() {
|
||||
String newDescription = "Description" + getRandomNumber();
|
||||
|
||||
@ -15,11 +15,13 @@
|
||||
*/
|
||||
package org.thingsboard.server.msa.ui.utils;
|
||||
|
||||
import org.thingsboard.common.util.JacksonUtil;
|
||||
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.asset.AssetProfile;
|
||||
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.DeviceProfileData;
|
||||
@ -34,12 +36,26 @@ public class EntityPrototypes {
|
||||
return customer;
|
||||
}
|
||||
|
||||
public static Customer defaultCustomerPrototype(String entityName, String description) {
|
||||
Customer customer = new Customer();
|
||||
customer.setTitle(entityName);
|
||||
customer.setAdditionalInfo(JacksonUtil.newObjectNode().put("description", description));
|
||||
return customer;
|
||||
}
|
||||
|
||||
public static RuleChain defaultRuleChainPrototype(String entityName) {
|
||||
RuleChain ruleChain = new RuleChain();
|
||||
ruleChain.setName(entityName);
|
||||
return ruleChain;
|
||||
}
|
||||
|
||||
public static RuleChain defaultRuleChainPrototype(String entityName, String description) {
|
||||
RuleChain ruleChain = new RuleChain();
|
||||
ruleChain.setName(entityName);
|
||||
ruleChain.setAdditionalInfo(JacksonUtil.newObjectNode().put("description", description));
|
||||
return ruleChain;
|
||||
}
|
||||
|
||||
public static DeviceProfile defaultDeviceProfile(String entityName) {
|
||||
DeviceProfile deviceProfile = new DeviceProfile();
|
||||
deviceProfile.setName(entityName);
|
||||
@ -68,4 +84,17 @@ public class EntityPrototypes {
|
||||
deviceProfile.setProfileData(deviceProfileData);
|
||||
return deviceProfile;
|
||||
}
|
||||
|
||||
public static AssetProfile defaultAssetProfile(String entityName) {
|
||||
AssetProfile assetProfile = new AssetProfile();
|
||||
assetProfile.setName(entityName);
|
||||
return assetProfile;
|
||||
}
|
||||
|
||||
public static AssetProfile defaultAssetProfile(String entityName, String description) {
|
||||
AssetProfile assetProfile = new AssetProfile();
|
||||
assetProfile.setName(entityName);
|
||||
assetProfile.setDescription(description);
|
||||
return assetProfile;
|
||||
}
|
||||
}
|
||||
|
||||
@ -57,4 +57,14 @@
|
||||
<package name="org.thingsboard.server.msa.ui.tests.deviceProfileSmoke"/>
|
||||
</packages>
|
||||
</test>
|
||||
<test name="Smoke asset profile tests">
|
||||
<groups>
|
||||
<run>
|
||||
<exclude name="broken"/>
|
||||
</run>
|
||||
</groups>
|
||||
<packages>
|
||||
<package name="org.thingsboard.server.msa.ui.tests.assetProfileSmoke"/>
|
||||
</packages>
|
||||
</test>
|
||||
</suite>
|
||||
@ -0,0 +1,10 @@
|
||||
{
|
||||
"name": "Asset Profile For Import",
|
||||
"description": null,
|
||||
"image": null,
|
||||
"defaultRuleChainId": null,
|
||||
"defaultDashboardId": null,
|
||||
"defaultQueueName": null,
|
||||
"externalId": null,
|
||||
"default": false
|
||||
}
|
||||
@ -30,6 +30,7 @@
|
||||
</groups>
|
||||
<packages>
|
||||
<package name="org.thingsboard.server.msa.ui.tests.deviceProfileSmoke"/>
|
||||
<package name="org.thingsboard.server.msa.ui.tests.assetProfileSmoke"/>
|
||||
</packages>
|
||||
</test>
|
||||
</suite>
|
||||
@ -52,4 +52,14 @@
|
||||
<package name="org.thingsboard.server.msa.ui.tests.deviceProfileSmoke"/>
|
||||
</packages>
|
||||
</test>
|
||||
<test name="Smoke asset profile tests">
|
||||
<groups>
|
||||
<run>
|
||||
<exclude name="broken"/>
|
||||
</run>
|
||||
</groups>
|
||||
<packages>
|
||||
<package name="org.thingsboard.server.msa.ui.tests.assetProfileSmoke"/>
|
||||
</packages>
|
||||
</test>
|
||||
</suite>
|
||||
Loading…
x
Reference in New Issue
Block a user