15 changed files with 627 additions and 25 deletions
@ -0,0 +1,93 @@ |
|||||
|
/** |
||||
|
* Copyright © 2016-2022 The Thingsboard Authors |
||||
|
* |
||||
|
* Licensed under the Apache License, Version 2.0 (the "License"); |
||||
|
* you may not use this file except in compliance with the License. |
||||
|
* You may obtain a copy of the License at |
||||
|
* |
||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
* |
||||
|
* Unless required by applicable law or agreed to in writing, software |
||||
|
* distributed under the License is distributed on an "AS IS" BASIS, |
||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
||||
|
* See the License for the specific language governing permissions and |
||||
|
* limitations under the License. |
||||
|
*/ |
||||
|
package org.thingsboard.server.msa.ui.pages; |
||||
|
|
||||
|
import org.openqa.selenium.WebDriver; |
||||
|
import org.openqa.selenium.WebElement; |
||||
|
import org.w3c.dom.html.HTMLInputElement; |
||||
|
|
||||
|
public class ProfilesPageElements extends OtherPageElementsHelper { |
||||
|
public ProfilesPageElements(WebDriver driver) { |
||||
|
super(driver); |
||||
|
} |
||||
|
|
||||
|
private static final String CREATE_DEVICE_PROFILE_BTN = "//span[text()='Create new device profile']"; |
||||
|
private static final String IMPORT_PROFILE_BTN = "//span[text()='Import device profile']"; |
||||
|
private static final String ADD_DEVICE_PROFILE_VIEW = "//tb-add-device-profile-dialog"; |
||||
|
private static final String DEVICE_PROFILE_VIEW = "//tb-entity-details-panel"; |
||||
|
private static final String NAME_FIELD = "//input[@formcontrolname='name']"; |
||||
|
private static final String RULE_CHAIN_FIELD = "//input[@formcontrolname='ruleChainId']"; |
||||
|
private static final String DASHBOARD_FIELD = "//input[@formcontrolname='dashboard']"; |
||||
|
private static final String QUEUE_FIELD = "//input[@formcontrolname='queueName']"; |
||||
|
private static final String DESCRIPTION_FIELD = "//textarea[@formcontrolname='description']"; |
||||
|
private static final String ADD_DEVICE_PROFILE_ADD_BTN = ADD_DEVICE_PROFILE_VIEW + "//span[text() = 'Add']/.."; |
||||
|
|
||||
|
public WebElement createNewDeviceProfileBtn() { |
||||
|
return waitUntilElementToBeClickable(CREATE_DEVICE_PROFILE_BTN); |
||||
|
} |
||||
|
|
||||
|
public WebElement importDeviceProfileBtn() { |
||||
|
return waitUntilElementToBeClickable(IMPORT_PROFILE_BTN); |
||||
|
} |
||||
|
|
||||
|
public WebElement addDeviceProfileView() { |
||||
|
return waitUntilElementToBeClickable(ADD_DEVICE_PROFILE_VIEW); |
||||
|
} |
||||
|
|
||||
|
public WebElement addDeviceProfileNameField() { |
||||
|
return waitUntilElementToBeClickable(ADD_DEVICE_PROFILE_VIEW + NAME_FIELD); |
||||
|
} |
||||
|
|
||||
|
public WebElement profileViewNameField() { |
||||
|
return waitUntilVisibilityOfElementLocated(DEVICE_PROFILE_VIEW + NAME_FIELD); |
||||
|
} |
||||
|
|
||||
|
public WebElement addDeviceProfileRuleChainField() { |
||||
|
return waitUntilElementToBeClickable(ADD_DEVICE_PROFILE_VIEW + RULE_CHAIN_FIELD); |
||||
|
} |
||||
|
|
||||
|
public WebElement profileViewRuleChainField() { |
||||
|
return waitUntilVisibilityOfElementLocated(DEVICE_PROFILE_VIEW + RULE_CHAIN_FIELD); |
||||
|
} |
||||
|
|
||||
|
public WebElement addDeviceProfileMobileDashboardField() { |
||||
|
return waitUntilElementToBeClickable(ADD_DEVICE_PROFILE_VIEW + DASHBOARD_FIELD); |
||||
|
} |
||||
|
|
||||
|
public WebElement profileViewMobileDashboardField() { |
||||
|
return waitUntilVisibilityOfElementLocated(DEVICE_PROFILE_VIEW + DASHBOARD_FIELD); |
||||
|
} |
||||
|
|
||||
|
public WebElement addDeviceProfileQueueField() { |
||||
|
return waitUntilElementToBeClickable(ADD_DEVICE_PROFILE_VIEW + QUEUE_FIELD); |
||||
|
} |
||||
|
|
||||
|
public WebElement profileViewQueueField() { |
||||
|
return waitUntilVisibilityOfElementLocated(DEVICE_PROFILE_VIEW + QUEUE_FIELD); |
||||
|
} |
||||
|
|
||||
|
public WebElement addDeviceDescriptionField() { |
||||
|
return waitUntilElementToBeClickable(ADD_DEVICE_PROFILE_VIEW + DESCRIPTION_FIELD); |
||||
|
} |
||||
|
|
||||
|
public WebElement profileViewDescriptionField() { |
||||
|
return waitUntilVisibilityOfElementLocated(DEVICE_PROFILE_VIEW + DESCRIPTION_FIELD); |
||||
|
} |
||||
|
|
||||
|
public WebElement addDeviceProfileAddBtn() { |
||||
|
return waitUntilElementToBeClickable(ADD_DEVICE_PROFILE_ADD_BTN); |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,105 @@ |
|||||
|
/** |
||||
|
* Copyright © 2016-2022 The Thingsboard Authors |
||||
|
* |
||||
|
* Licensed under the Apache License, Version 2.0 (the "License"); |
||||
|
* you may not use this file except in compliance with the License. |
||||
|
* You may obtain a copy of the License at |
||||
|
* |
||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
* |
||||
|
* Unless required by applicable law or agreed to in writing, software |
||||
|
* distributed under the License is distributed on an "AS IS" BASIS, |
||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
||||
|
* See the License for the specific language governing permissions and |
||||
|
* limitations under the License. |
||||
|
*/ |
||||
|
package org.thingsboard.server.msa.ui.pages; |
||||
|
|
||||
|
import org.openqa.selenium.WebDriver; |
||||
|
|
||||
|
public class ProfilesPageHelper extends ProfilesPageElements { |
||||
|
public ProfilesPageHelper(WebDriver driver) { |
||||
|
super(driver); |
||||
|
} |
||||
|
|
||||
|
private String name; |
||||
|
private String ruleChain; |
||||
|
private String mobileDashboard; |
||||
|
private String queue; |
||||
|
private String description; |
||||
|
|
||||
|
public void setName() { |
||||
|
this.name = profileViewNameField().getAttribute("value"); |
||||
|
} |
||||
|
|
||||
|
public void setRuleChain() { |
||||
|
this.ruleChain = profileViewRuleChainField().getAttribute("value"); |
||||
|
} |
||||
|
|
||||
|
public void setMobileDashboard() { |
||||
|
this.mobileDashboard = profileViewMobileDashboardField().getAttribute("value"); |
||||
|
} |
||||
|
|
||||
|
public void setQueue() { |
||||
|
this.queue = profileViewQueueField().getAttribute("value"); |
||||
|
} |
||||
|
|
||||
|
public void setDescription() { |
||||
|
this.description = profileViewDescriptionField().getAttribute("value"); |
||||
|
} |
||||
|
|
||||
|
public String getName() { |
||||
|
return this.name; |
||||
|
} |
||||
|
|
||||
|
public String getRuleChain() { |
||||
|
return this.ruleChain; |
||||
|
} |
||||
|
|
||||
|
public String getMobileDashboard() { |
||||
|
return this.mobileDashboard; |
||||
|
} |
||||
|
|
||||
|
public String getQueue() { |
||||
|
return this.queue; |
||||
|
} |
||||
|
|
||||
|
public String getDescription() { |
||||
|
return this.description; |
||||
|
} |
||||
|
|
||||
|
public void enterName(String name) { |
||||
|
addDeviceProfileNameField().click(); |
||||
|
addDeviceProfileNameField().sendKeys(name); |
||||
|
} |
||||
|
|
||||
|
public void chooseRuleChain(String ruleChain) { |
||||
|
addDeviceProfileRuleChainField().click(); |
||||
|
entityFromList(ruleChain).click(); |
||||
|
} |
||||
|
|
||||
|
public void chooseMobileDashboard(String mobileDashboard) { |
||||
|
addDeviceProfileMobileDashboardField().click(); |
||||
|
entityFromList(mobileDashboard).click(); |
||||
|
} |
||||
|
|
||||
|
public void chooseQueue(String queue) { |
||||
|
addDeviceProfileQueueField().click(); |
||||
|
entityFromList(queue).click(); |
||||
|
} |
||||
|
|
||||
|
public void enterDescription(String description) { |
||||
|
addDeviceDescriptionField().sendKeys(description); |
||||
|
} |
||||
|
|
||||
|
public void openCreateDeviceProfileView() { |
||||
|
plusBtn().click(); |
||||
|
createNewDeviceProfileBtn().click(); |
||||
|
} |
||||
|
|
||||
|
public void openImportDeviceProfileView() { |
||||
|
plusBtn().click(); |
||||
|
importDeviceProfileBtn().click(); |
||||
|
} |
||||
|
} |
||||
|
|
||||
@ -0,0 +1,29 @@ |
|||||
|
/** |
||||
|
* Copyright © 2016-2022 The Thingsboard Authors |
||||
|
* |
||||
|
* Licensed under the Apache License, Version 2.0 (the "License"); |
||||
|
* you may not use this file except in compliance with the License. |
||||
|
* You may obtain a copy of the License at |
||||
|
* |
||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
* |
||||
|
* Unless required by applicable law or agreed to in writing, software |
||||
|
* distributed under the License is distributed on an "AS IS" BASIS, |
||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
||||
|
* See the License for the specific language governing permissions and |
||||
|
* limitations under the License. |
||||
|
*/ |
||||
|
package org.thingsboard.server.msa.ui.pages; |
||||
|
|
||||
|
import org.openqa.selenium.WebDriver; |
||||
|
|
||||
|
public class SideBarMenuViewHelper extends SideBarMenuViewElements{ |
||||
|
public SideBarMenuViewHelper(WebDriver driver) { |
||||
|
super(driver); |
||||
|
} |
||||
|
|
||||
|
public void openDeviceProfiles() { |
||||
|
profilesBtn().click(); |
||||
|
deviceProfileBtn().click(); |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,98 @@ |
|||||
|
package org.thingsboard.server.msa.ui.tests.deviceProfileSmoke; |
||||
|
|
||||
|
import io.qameta.allure.Description; |
||||
|
import org.testng.Assert; |
||||
|
import org.testng.annotations.AfterMethod; |
||||
|
import org.testng.annotations.BeforeMethod; |
||||
|
import org.testng.annotations.Test; |
||||
|
import org.thingsboard.server.msa.ui.base.AbstractDriverBaseTest; |
||||
|
import org.thingsboard.server.msa.ui.pages.LoginPageHelper; |
||||
|
import org.thingsboard.server.msa.ui.pages.ProfilesPageHelper; |
||||
|
import org.thingsboard.server.msa.ui.pages.SideBarMenuViewHelper; |
||||
|
|
||||
|
import static org.thingsboard.server.msa.ui.utils.Const.EMPTY_IMPORT_MESSAGE; |
||||
|
import static org.thingsboard.server.msa.ui.utils.Const.ENTITY_NAME; |
||||
|
import static org.thingsboard.server.msa.ui.utils.Const.IMPORT_DEVICE_PROFILE_FILE_NAME; |
||||
|
import static org.thingsboard.server.msa.ui.utils.Const.IMPORT_DEVICE_PROFILE_NAME; |
||||
|
import static org.thingsboard.server.msa.ui.utils.Const.IMPORT_TXT_FILE_NAME; |
||||
|
import static org.thingsboard.server.msa.ui.utils.Const.TENANT_EMAIL; |
||||
|
import static org.thingsboard.server.msa.ui.utils.Const.TENANT_PASSWORD; |
||||
|
|
||||
|
public class CreateDeviceProfileImportTest extends AbstractDriverBaseTest { |
||||
|
|
||||
|
private SideBarMenuViewHelper sideBarMenuView; |
||||
|
private ProfilesPageHelper profilesPage; |
||||
|
private final String absolutePathToFileImportDeviceProfile = getClass().getClassLoader().getResource(IMPORT_DEVICE_PROFILE_FILE_NAME).getPath(); |
||||
|
private final String absolutePathToFileImportTxt = getClass().getClassLoader().getResource(IMPORT_TXT_FILE_NAME).getPath(); |
||||
|
private String name; |
||||
|
|
||||
|
|
||||
|
@BeforeMethod |
||||
|
public void login() { |
||||
|
openLocalhost(); |
||||
|
new LoginPageHelper(driver).authorizationTenant(); |
||||
|
testRestClient.login(TENANT_EMAIL, TENANT_PASSWORD); |
||||
|
sideBarMenuView = new SideBarMenuViewHelper(driver); |
||||
|
profilesPage = new ProfilesPageHelper(driver); |
||||
|
} |
||||
|
|
||||
|
@AfterMethod |
||||
|
public void delete() { |
||||
|
if (name != null) { |
||||
|
testRestClient.deleteDeviseProfile(getDeviceProfileByName(name).getId()); |
||||
|
name = null; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
@Test |
||||
|
public void importDeviceProfile() { |
||||
|
sideBarMenuView.openDeviceProfiles(); |
||||
|
profilesPage.openImportDeviceProfileView(); |
||||
|
profilesPage.browseFile().sendKeys(absolutePathToFileImportDeviceProfile); |
||||
|
profilesPage.importBrowseFileBtn().click(); |
||||
|
name = IMPORT_DEVICE_PROFILE_NAME; |
||||
|
profilesPage.refreshBtn().click(); |
||||
|
|
||||
|
Assert.assertNotNull(profilesPage.entity(IMPORT_DEVICE_PROFILE_NAME)); |
||||
|
Assert.assertTrue(profilesPage.entity(IMPORT_DEVICE_PROFILE_NAME).isDisplayed()); |
||||
|
} |
||||
|
|
||||
|
@Test |
||||
|
public void importTxtFile() { |
||||
|
sideBarMenuView.openDeviceProfiles(); |
||||
|
profilesPage.openImportDeviceProfileView(); |
||||
|
profilesPage.browseFile().sendKeys(absolutePathToFileImportTxt); |
||||
|
|
||||
|
Assert.assertNotNull(profilesPage.importingFile(EMPTY_IMPORT_MESSAGE)); |
||||
|
Assert.assertTrue(profilesPage.importingFile(EMPTY_IMPORT_MESSAGE).isDisplayed()); |
||||
|
} |
||||
|
|
||||
|
@Test(groups = "smoke") |
||||
|
@Description |
||||
|
public void addFileTiImportAndRemove() { |
||||
|
sideBarMenuView.openDeviceProfiles(); |
||||
|
profilesPage.openImportDeviceProfileView(); |
||||
|
profilesPage.browseFile().sendKeys(absolutePathToFileImportDeviceProfile); |
||||
|
profilesPage.clearImportFileBtn().click(); |
||||
|
|
||||
|
Assert.assertNotNull(profilesPage.importingFile(EMPTY_IMPORT_MESSAGE)); |
||||
|
Assert.assertTrue(profilesPage.importingFile(EMPTY_IMPORT_MESSAGE).isDisplayed()); |
||||
|
Assert.assertTrue(profilesPage.entityIsNotPresent(IMPORT_DEVICE_PROFILE_NAME)); |
||||
|
} |
||||
|
|
||||
|
@Test |
||||
|
public void importDeviceProfileWithSameName() { |
||||
|
String name = ENTITY_NAME; |
||||
|
testRestClient.postDeviceProfile() |
||||
|
|
||||
|
sideBarMenuView.openDeviceProfiles(); |
||||
|
profilesPage.openImportDeviceProfileView(); |
||||
|
profilesPage.browseFile().sendKeys(absolutePathToFileImportDeviceProfile); |
||||
|
profilesPage.importBrowseFileBtn().click(); |
||||
|
this.name = IMPORT_DEVICE_PROFILE_NAME; |
||||
|
profilesPage.refreshBtn().click(); |
||||
|
|
||||
|
Assert.assertNotNull(profilesPage.entity(IMPORT_DEVICE_PROFILE_NAME)); |
||||
|
Assert.assertTrue(profilesPage.entity(IMPORT_DEVICE_PROFILE_NAME).isDisplayed()); |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,184 @@ |
|||||
|
/** |
||||
|
* Copyright © 2016-2022 The Thingsboard Authors |
||||
|
* |
||||
|
* Licensed under the Apache License, Version 2.0 (the "License"); |
||||
|
* you may not use this file except in compliance with the License. |
||||
|
* You may obtain a copy of the License at |
||||
|
* |
||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
* |
||||
|
* Unless required by applicable law or agreed to in writing, software |
||||
|
* distributed under the License is distributed on an "AS IS" BASIS, |
||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
||||
|
* See the License for the specific language governing permissions and |
||||
|
* limitations under the License. |
||||
|
*/ |
||||
|
package org.thingsboard.server.msa.ui.tests.deviceProfileSmoke; |
||||
|
|
||||
|
import io.qameta.allure.Description; |
||||
|
import org.openqa.selenium.Keys; |
||||
|
import org.testng.Assert; |
||||
|
import org.testng.annotations.AfterMethod; |
||||
|
import org.testng.annotations.BeforeMethod; |
||||
|
import org.testng.annotations.Test; |
||||
|
import org.thingsboard.server.msa.ui.base.AbstractDriverBaseTest; |
||||
|
import org.thingsboard.server.msa.ui.pages.LoginPageHelper; |
||||
|
import org.thingsboard.server.msa.ui.pages.ProfilesPageHelper; |
||||
|
import org.thingsboard.server.msa.ui.pages.SideBarMenuViewHelper; |
||||
|
import org.thingsboard.server.msa.ui.utils.EntityPrototypes; |
||||
|
|
||||
|
import static org.thingsboard.server.msa.ui.utils.Const.EMPTY_DEVICE_PROFILE_MESSAGE; |
||||
|
import static org.thingsboard.server.msa.ui.utils.Const.ENTITY_NAME; |
||||
|
import static org.thingsboard.server.msa.ui.utils.Const.NAME_IS_REQUIRED_MESSAGE; |
||||
|
import static org.thingsboard.server.msa.ui.utils.Const.SAME_NAME_WARNING_DEVICE_PROFILE_MESSAGE; |
||||
|
import static org.thingsboard.server.msa.ui.utils.Const.TENANT_EMAIL; |
||||
|
import static org.thingsboard.server.msa.ui.utils.Const.TENANT_PASSWORD; |
||||
|
|
||||
|
public class CreateDeviceProfileTest extends AbstractDriverBaseTest { |
||||
|
|
||||
|
private SideBarMenuViewHelper sideBarMenuView; |
||||
|
private ProfilesPageHelper profilesPage; |
||||
|
private String name; |
||||
|
|
||||
|
|
||||
|
@BeforeMethod |
||||
|
public void login() { |
||||
|
openLocalhost(); |
||||
|
new LoginPageHelper(driver).authorizationTenant(); |
||||
|
testRestClient.login(TENANT_EMAIL, TENANT_PASSWORD); |
||||
|
sideBarMenuView = new SideBarMenuViewHelper(driver); |
||||
|
profilesPage = new ProfilesPageHelper(driver); |
||||
|
} |
||||
|
|
||||
|
@AfterMethod |
||||
|
public void delete() { |
||||
|
if (name != null) { |
||||
|
testRestClient.deleteDeviseProfile(getDeviceProfileByName(name).getId()); |
||||
|
name = null; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
@Test |
||||
|
public void createDeviceProfile() { |
||||
|
String name = ENTITY_NAME; |
||||
|
|
||||
|
sideBarMenuView.openDeviceProfiles(); |
||||
|
profilesPage.openCreateDeviceProfileView(); |
||||
|
profilesPage.addDeviceProfileNameField().click(); |
||||
|
profilesPage.addDeviceProfileNameField().sendKeys(name); |
||||
|
profilesPage.addDeviceProfileAddBtn().click(); |
||||
|
this.name = name; |
||||
|
profilesPage.refreshBtn().click(); |
||||
|
|
||||
|
Assert.assertNotNull(profilesPage.entity(name)); |
||||
|
Assert.assertTrue(profilesPage.entity(name).isDisplayed()); |
||||
|
} |
||||
|
|
||||
|
@Test |
||||
|
public void createDeviceProfileWithDetails() { |
||||
|
String name = ENTITY_NAME; |
||||
|
String ruleChain = "Root Rule Chain"; |
||||
|
String mobileDashboard = "Firmware"; |
||||
|
String queue = "Main"; |
||||
|
String description = "Description"; |
||||
|
|
||||
|
sideBarMenuView.openDeviceProfiles(); |
||||
|
profilesPage.openCreateDeviceProfileView(); |
||||
|
profilesPage.enterName(name); |
||||
|
profilesPage.chooseRuleChain(ruleChain); |
||||
|
profilesPage.chooseMobileDashboard(mobileDashboard); |
||||
|
profilesPage.chooseQueue(queue); |
||||
|
profilesPage.enterDescription(description); |
||||
|
profilesPage.addDeviceProfileAddBtn().click(); |
||||
|
this.name = name; |
||||
|
profilesPage.refreshBtn().click(); |
||||
|
profilesPage.entity(name).click(); |
||||
|
profilesPage.setName(); |
||||
|
profilesPage.setRuleChain(); |
||||
|
profilesPage.setMobileDashboard(); |
||||
|
profilesPage.setQueue(); |
||||
|
profilesPage.setDescription(); |
||||
|
|
||||
|
Assert.assertNotNull(profilesPage.entity(name)); |
||||
|
Assert.assertTrue(profilesPage.entity(name).isDisplayed()); |
||||
|
Assert.assertEquals(name, profilesPage.getName()); |
||||
|
Assert.assertEquals(ruleChain, profilesPage.getRuleChain()); |
||||
|
Assert.assertEquals(mobileDashboard, profilesPage.getMobileDashboard()); |
||||
|
Assert.assertEquals(queue, profilesPage.getQueue()); |
||||
|
Assert.assertEquals(description, profilesPage.getDescription()); |
||||
|
} |
||||
|
|
||||
|
@Test |
||||
|
public void createDeviseProfileWithSameName() { |
||||
|
String name = ENTITY_NAME; |
||||
|
testRestClient.postDeviceProfile(EntityPrototypes.defaultDeviceProfile(name)); |
||||
|
this.name = name; |
||||
|
|
||||
|
sideBarMenuView.openDeviceProfiles(); |
||||
|
profilesPage.openCreateDeviceProfileView(); |
||||
|
profilesPage.addDeviceProfileNameField().click(); |
||||
|
profilesPage.addDeviceProfileNameField().sendKeys(name); |
||||
|
profilesPage.addDeviceProfileAddBtn().click(); |
||||
|
|
||||
|
Assert.assertNotNull(profilesPage.warningMessage()); |
||||
|
Assert.assertTrue(profilesPage.warningMessage().isDisplayed()); |
||||
|
Assert.assertEquals(profilesPage.warningMessage().getText(), SAME_NAME_WARNING_DEVICE_PROFILE_MESSAGE); |
||||
|
Assert.assertNotNull(profilesPage.addDeviceProfileView()); |
||||
|
Assert.assertTrue(profilesPage.addDeviceProfileView().isDisplayed()); |
||||
|
} |
||||
|
|
||||
|
@Test |
||||
|
public void createDeviceProfileWithoutName() { |
||||
|
sideBarMenuView.openDeviceProfiles(); |
||||
|
profilesPage.openCreateDeviceProfileView(); |
||||
|
profilesPage.addDeviceProfileAddBtn().click(); |
||||
|
|
||||
|
Assert.assertNotNull(profilesPage.addDeviceProfileView()); |
||||
|
Assert.assertTrue(profilesPage.addDeviceProfileView().isDisplayed()); |
||||
|
Assert.assertNotNull(profilesPage.errorMessage()); |
||||
|
Assert.assertEquals(profilesPage.errorMessage().getText(), NAME_IS_REQUIRED_MESSAGE); |
||||
|
} |
||||
|
|
||||
|
@Test |
||||
|
public void createDeviseProfileWithOnlySpaceInName() { |
||||
|
sideBarMenuView.openDeviceProfiles(); |
||||
|
profilesPage.openCreateDeviceProfileView(); |
||||
|
profilesPage.addDeviceProfileNameField().click(); |
||||
|
profilesPage.addDeviceProfileNameField().sendKeys(Keys.SPACE); |
||||
|
profilesPage.addDeviceProfileAddBtn().click(); |
||||
|
|
||||
|
Assert.assertNotNull(profilesPage.warningMessage()); |
||||
|
Assert.assertTrue(profilesPage.warningMessage().isDisplayed()); |
||||
|
Assert.assertEquals(profilesPage.warningMessage().getText(), EMPTY_DEVICE_PROFILE_MESSAGE); |
||||
|
Assert.assertNotNull(profilesPage.addDeviceProfileView()); |
||||
|
Assert.assertTrue(profilesPage.addDeviceProfileView().isDisplayed()); |
||||
|
} |
||||
|
|
||||
|
@Test |
||||
|
public void createDeviceProfileWithoutRefresh() { |
||||
|
String name = ENTITY_NAME; |
||||
|
|
||||
|
sideBarMenuView.openDeviceProfiles(); |
||||
|
profilesPage.openCreateDeviceProfileView(); |
||||
|
profilesPage.addDeviceProfileNameField().click(); |
||||
|
profilesPage.addDeviceProfileNameField().sendKeys(name); |
||||
|
profilesPage.addDeviceProfileAddBtn().click(); |
||||
|
this.name = name; |
||||
|
|
||||
|
Assert.assertNotNull(profilesPage.entity(name)); |
||||
|
Assert.assertTrue(profilesPage.entity(name).isDisplayed()); |
||||
|
} |
||||
|
|
||||
|
@Test(groups = "smoke") |
||||
|
@Description |
||||
|
public void documentation() { |
||||
|
String urlPath = "docs/user-guide/device-profiles/"; |
||||
|
|
||||
|
sideBarMenuView.openDeviceProfiles(); |
||||
|
profilesPage.allEntity().get(0).click(); |
||||
|
profilesPage.goToHelpPage(); |
||||
|
|
||||
|
Assert.assertTrue(urlContains(urlPath)); |
||||
|
} |
||||
|
} |
||||
|
|
||||
@ -0,0 +1,29 @@ |
|||||
|
{ |
||||
|
"name": "Device Profile For Import", |
||||
|
"description": "", |
||||
|
"image": null, |
||||
|
"type": "DEFAULT", |
||||
|
"transportType": "DEFAULT", |
||||
|
"provisionType": "DISABLED", |
||||
|
"defaultRuleChainId": null, |
||||
|
"defaultDashboardId": null, |
||||
|
"defaultQueueName": null, |
||||
|
"profileData": { |
||||
|
"configuration": { |
||||
|
"type": "DEFAULT" |
||||
|
}, |
||||
|
"transportConfiguration": { |
||||
|
"type": "DEFAULT" |
||||
|
}, |
||||
|
"provisionConfiguration": { |
||||
|
"type": "DISABLED", |
||||
|
"provisionDeviceSecret": null |
||||
|
}, |
||||
|
"alarms": null |
||||
|
}, |
||||
|
"provisionDeviceKey": null, |
||||
|
"firmwareId": null, |
||||
|
"softwareId": null, |
||||
|
"externalId": null, |
||||
|
"default": false |
||||
|
} |
||||
Loading…
Reference in new issue