20 changed files with 945 additions and 9 deletions
@ -0,0 +1,45 @@ |
|||||
|
/** |
||||
|
* Copyright © 2016-2023 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.devicessmoke; |
||||
|
|
||||
|
import io.qameta.allure.Epic; |
||||
|
import org.testng.annotations.AfterMethod; |
||||
|
import org.testng.annotations.BeforeClass; |
||||
|
import org.thingsboard.server.msa.ui.base.AbstractDriverBaseTest; |
||||
|
import org.thingsboard.server.msa.ui.pages.DevicePageHelper; |
||||
|
import org.thingsboard.server.msa.ui.pages.LoginPageHelper; |
||||
|
import org.thingsboard.server.msa.ui.pages.SideBarMenuViewHelper; |
||||
|
|
||||
|
@Epic("Device smoke tests") |
||||
|
abstract public class AbstractDeviceTest extends AbstractDriverBaseTest { |
||||
|
|
||||
|
protected SideBarMenuViewHelper sideBarMenuView; |
||||
|
protected DevicePageHelper devicePage; |
||||
|
protected String deviceName; |
||||
|
|
||||
|
@BeforeClass |
||||
|
public void login() { |
||||
|
new LoginPageHelper(driver).authorizationTenant(); |
||||
|
sideBarMenuView = new SideBarMenuViewHelper(driver); |
||||
|
devicePage = new DevicePageHelper(driver); |
||||
|
} |
||||
|
|
||||
|
@AfterMethod |
||||
|
public void delete() { |
||||
|
deleteDeviceByName(deviceName); |
||||
|
deviceName = null; |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,214 @@ |
|||||
|
/** |
||||
|
* Copyright © 2016-2023 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.devicessmoke; |
||||
|
|
||||
|
import io.qameta.allure.Description; |
||||
|
import io.qameta.allure.Feature; |
||||
|
import org.testng.annotations.Test; |
||||
|
import org.thingsboard.server.common.data.Device; |
||||
|
import org.thingsboard.server.msa.ui.utils.EntityPrototypes; |
||||
|
|
||||
|
import static org.assertj.core.api.Assertions.assertThat; |
||||
|
import static org.thingsboard.server.msa.ui.base.AbstractBasePage.random; |
||||
|
import static org.thingsboard.server.msa.ui.utils.Const.DEVICE_PROFILE_IS_REQUIRED_MESSAGE; |
||||
|
import static org.thingsboard.server.msa.ui.utils.Const.EMPTY_DEVICE_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_MESSAGE; |
||||
|
|
||||
|
@Feature("Create device") |
||||
|
public class CreateDeviceTest extends AbstractDeviceTest { |
||||
|
|
||||
|
@Test(groups = "smoke") |
||||
|
@Description("Add device after specifying the name (text/numbers /special characters)") |
||||
|
public void createDevice() { |
||||
|
deviceName = ENTITY_NAME + random(); |
||||
|
|
||||
|
sideBarMenuView.goToDevicesPage(); |
||||
|
devicePage.openCreateDeviceView(); |
||||
|
devicePage.enterName(deviceName); |
||||
|
devicePage.addBtnC().click(); |
||||
|
devicePage.refreshBtn().click(); |
||||
|
|
||||
|
assertIsDisplayed(devicePage.entity(deviceName)); |
||||
|
} |
||||
|
|
||||
|
@Test(groups = "smoke") |
||||
|
@Description("Add device after specifying the name and description (text/numbers /special characters)") |
||||
|
public void createDeviceWithDescription() { |
||||
|
deviceName = ENTITY_NAME + random(); |
||||
|
|
||||
|
sideBarMenuView.goToDevicesPage(); |
||||
|
devicePage.openCreateDeviceView(); |
||||
|
devicePage.enterName(deviceName); |
||||
|
devicePage.enterDescription(deviceName); |
||||
|
devicePage.addBtnC().click(); |
||||
|
devicePage.refreshBtn().click(); |
||||
|
devicePage.entity(deviceName).click(); |
||||
|
devicePage.setHeaderName(); |
||||
|
|
||||
|
assertThat(devicePage.getHeaderName()).as("Header of device details tab").isEqualTo(deviceName); |
||||
|
assertThat(devicePage.descriptionEntityView().getAttribute("value")) |
||||
|
.as("Description in device details tab").isEqualTo(deviceName); |
||||
|
} |
||||
|
|
||||
|
@Test(groups = "smoke") |
||||
|
@Description("Add device without the name") |
||||
|
public void createDeviceWithoutName() { |
||||
|
sideBarMenuView.goToDevicesPage(); |
||||
|
devicePage.openCreateDeviceView(); |
||||
|
devicePage.nameField().click(); |
||||
|
devicePage.addBtnC().click(); |
||||
|
|
||||
|
assertIsDisplayed(devicePage.addDeviceView()); |
||||
|
assertThat(devicePage.errorMessage().getText()).as("Text of warning message").isEqualTo(NAME_IS_REQUIRED_MESSAGE); |
||||
|
} |
||||
|
|
||||
|
@Test(groups = "smoke") |
||||
|
@Description("Create device only with spase in name") |
||||
|
public void createDeviceWithOnlySpace() { |
||||
|
sideBarMenuView.goToDevicesPage(); |
||||
|
devicePage.openCreateDeviceView(); |
||||
|
devicePage.enterName(" "); |
||||
|
devicePage.addBtnC().click(); |
||||
|
|
||||
|
assertIsDisplayed(devicePage.warningMessage()); |
||||
|
assertThat(devicePage.warningMessage().getText()).as("Text of warning message").isEqualTo(EMPTY_DEVICE_MESSAGE); |
||||
|
assertIsDisplayed(devicePage.addDeviceView()); |
||||
|
} |
||||
|
|
||||
|
@Test(groups = "smoke") |
||||
|
@Description("Create a device with the same name") |
||||
|
public void createDeviceWithSameName() { |
||||
|
Device device = testRestClient.postDevice("", EntityPrototypes.defaultDevicePrototype(ENTITY_NAME)); |
||||
|
deviceName = device.getName(); |
||||
|
|
||||
|
sideBarMenuView.goToDevicesPage(); |
||||
|
devicePage.openCreateDeviceView(); |
||||
|
devicePage.enterName(deviceName); |
||||
|
devicePage.addBtnC().click(); |
||||
|
|
||||
|
assertIsDisplayed(devicePage.warningMessage()); |
||||
|
assertThat(devicePage.warningMessage().getText()).as("Text of warning message").isEqualTo(SAME_NAME_WARNING_DEVICE_MESSAGE); |
||||
|
assertIsDisplayed(devicePage.addDeviceView()); |
||||
|
} |
||||
|
|
||||
|
@Test(groups = "smoke") |
||||
|
@Description("Add device after specifying the name (text/numbers /special characters) without refresh") |
||||
|
public void createDeviceWithoutRefresh() { |
||||
|
deviceName = ENTITY_NAME + random(); |
||||
|
|
||||
|
sideBarMenuView.goToDevicesPage(); |
||||
|
devicePage.openCreateDeviceView(); |
||||
|
devicePage.enterName(deviceName); |
||||
|
devicePage.addBtnC().click(); |
||||
|
|
||||
|
assertIsDisplayed(devicePage.entity(deviceName)); |
||||
|
} |
||||
|
|
||||
|
@Test(groups = "smoke") |
||||
|
@Description("Add device without device profile") |
||||
|
public void createDeviceWithoutDeviceProfile() { |
||||
|
deviceName = ENTITY_NAME + random(); |
||||
|
|
||||
|
sideBarMenuView.goToDevicesPage(); |
||||
|
devicePage.openCreateDeviceView(); |
||||
|
devicePage.enterName(deviceName); |
||||
|
devicePage.clearProfileFieldBtn().click(); |
||||
|
devicePage.addBtnC().click(); |
||||
|
|
||||
|
assertIsDisplayed(devicePage.errorMessage()); |
||||
|
assertThat(devicePage.errorMessage().getText()).as("Text of warning message").isEqualTo(DEVICE_PROFILE_IS_REQUIRED_MESSAGE); |
||||
|
assertIsDisplayed(devicePage.addDeviceView()); |
||||
|
} |
||||
|
|
||||
|
@Test(groups = "smoke") |
||||
|
@Description("Add device with enabled gateway") |
||||
|
public void createDeviceWithEnableGateway() { |
||||
|
deviceName = ENTITY_NAME + random(); |
||||
|
|
||||
|
sideBarMenuView.goToDevicesPage(); |
||||
|
devicePage.openCreateDeviceView(); |
||||
|
devicePage.enterName(deviceName); |
||||
|
devicePage.checkboxGatewayCreate().click(); |
||||
|
devicePage.addBtnC().click(); |
||||
|
|
||||
|
assertIsDisplayed(devicePage.device(deviceName)); |
||||
|
assertIsDisplayed(devicePage.checkboxGatewayPage(deviceName)); |
||||
|
} |
||||
|
|
||||
|
@Test(groups = "smoke") |
||||
|
@Description("Add device with enabled overwrite activity time for connected") |
||||
|
public void createDeviceWithEnableOverwriteActivityTimeForConnected() { |
||||
|
deviceName = ENTITY_NAME + random(); |
||||
|
|
||||
|
sideBarMenuView.goToDevicesPage(); |
||||
|
devicePage.openCreateDeviceView(); |
||||
|
devicePage.enterName(deviceName); |
||||
|
devicePage.checkboxGatewayCreate().click(); |
||||
|
devicePage.checkboxOverwriteActivityTimeCreate().click(); |
||||
|
devicePage.addBtnC().click(); |
||||
|
devicePage.device(deviceName).click(); |
||||
|
|
||||
|
assertThat(devicePage.checkboxOverwriteActivityTimeDetails().getAttribute("class").contains("selected")) |
||||
|
.as("Overwrite activity time for connected is enable").isTrue(); |
||||
|
} |
||||
|
|
||||
|
@Test(groups = "smoke") |
||||
|
@Description("Add device with label") |
||||
|
public void createDeviceWithLabel() { |
||||
|
deviceName = ENTITY_NAME + random(); |
||||
|
String deviceLabel = "device label " + random(); |
||||
|
|
||||
|
sideBarMenuView.goToDevicesPage(); |
||||
|
devicePage.openCreateDeviceView(); |
||||
|
devicePage.enterName(deviceName); |
||||
|
devicePage.enterLabel(deviceLabel); |
||||
|
devicePage.addBtnC().click(); |
||||
|
|
||||
|
assertIsDisplayed(devicePage.deviceLabelOnPage(deviceName)); |
||||
|
assertThat(devicePage.deviceLabelOnPage(deviceName).getText()).as("Label added correctly").isEqualTo(deviceLabel); |
||||
|
} |
||||
|
|
||||
|
@Test(groups = "smoke") |
||||
|
@Description("Add device with assignee on customer") |
||||
|
public void createDeviceWithAssignee() { |
||||
|
deviceName = ENTITY_NAME + random(); |
||||
|
String customer = "Customer A"; |
||||
|
|
||||
|
sideBarMenuView.goToDevicesPage(); |
||||
|
devicePage.openCreateDeviceView(); |
||||
|
devicePage.enterName(deviceName); |
||||
|
devicePage.assignOnCustomer(customer); |
||||
|
devicePage.addBtnC().click(); |
||||
|
|
||||
|
assertIsDisplayed(devicePage.deviceCustomerOnPage(deviceName)); |
||||
|
assertThat(devicePage.deviceCustomerOnPage(deviceName).getText()) |
||||
|
.as("Customer added correctly").isEqualTo(customer); |
||||
|
} |
||||
|
|
||||
|
@Test(groups = "smoke") |
||||
|
@Description("Go to devices documentation page") |
||||
|
public void documentation() { |
||||
|
String urlPath = "docs/user-guide/ui/devices/"; |
||||
|
|
||||
|
sideBarMenuView.goToDevicesPage(); |
||||
|
devicePage.entity("Thermostat T1").click(); |
||||
|
devicePage.goToHelpPage(); |
||||
|
|
||||
|
assertThat(urlContains(urlPath)).as("Redirected URL contains " + urlPath).isTrue(); |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,75 @@ |
|||||
|
/** |
||||
|
* Copyright © 2016-2023 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.devicessmoke; |
||||
|
|
||||
|
import io.qameta.allure.Description; |
||||
|
import io.qameta.allure.Feature; |
||||
|
import org.testng.annotations.BeforeMethod; |
||||
|
import org.testng.annotations.Test; |
||||
|
import org.thingsboard.server.common.data.Device; |
||||
|
import org.thingsboard.server.msa.ui.utils.EntityPrototypes; |
||||
|
|
||||
|
import static org.thingsboard.server.msa.ui.utils.Const.ENTITY_NAME; |
||||
|
|
||||
|
@Feature("Delete device") |
||||
|
public class DeleteDeviceTest extends AbstractDeviceTest { |
||||
|
|
||||
|
@BeforeMethod |
||||
|
public void createDevice() { |
||||
|
Device device = testRestClient.postDevice("", EntityPrototypes.defaultDevicePrototype(ENTITY_NAME)); |
||||
|
deviceName = device.getName(); |
||||
|
} |
||||
|
|
||||
|
@Test(groups = "smoke") |
||||
|
@Description("Remove the device by clicking on the trash icon in the right side of device") |
||||
|
public void deleteDeviceByRightSideBtn() { |
||||
|
sideBarMenuView.goToDevicesPage(); |
||||
|
devicePage.deleteDeviceByRightSideBtn(deviceName); |
||||
|
devicePage.refreshBtn().click(); |
||||
|
|
||||
|
devicePage.assertEntityIsNotPresent(deviceName); |
||||
|
} |
||||
|
|
||||
|
@Test(groups = "smoke") |
||||
|
@Description("Remove device by mark in the checkbox and then click on the trash can icon in the menu that appears at the top") |
||||
|
public void deleteSelectedDevice() { |
||||
|
sideBarMenuView.goToDevicesPage(); |
||||
|
devicePage.deleteSelected(deviceName); |
||||
|
devicePage.refreshBtn().click(); |
||||
|
|
||||
|
devicePage.assertEntityIsNotPresent(deviceName); |
||||
|
} |
||||
|
|
||||
|
@Test(groups = "smoke") |
||||
|
@Description("Remove the device by clicking on the 'Delete device' btn in the entity view") |
||||
|
public void deleteDeviceFromDetailsTab() { |
||||
|
sideBarMenuView.goToDevicesPage(); |
||||
|
devicePage.entity(deviceName).click(); |
||||
|
devicePage.deleteDeviceFromDetailsTab(); |
||||
|
devicePage.refreshBtn(); |
||||
|
|
||||
|
devicePage.assertEntityIsNotPresent(deviceName); |
||||
|
} |
||||
|
|
||||
|
@Test(groups = "smoke") |
||||
|
@Description("Remove the device by clicking on the trash icon in the right side of device without refresh") |
||||
|
public void deleteDeviceWithoutRefresh() { |
||||
|
sideBarMenuView.goToDevicesPage(); |
||||
|
devicePage.deleteDeviceByRightSideBtn(deviceName); |
||||
|
|
||||
|
devicePage.assertEntityIsNotPresent(deviceName); |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,84 @@ |
|||||
|
/** |
||||
|
* Copyright © 2016-2023 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.devicessmoke; |
||||
|
|
||||
|
import io.qameta.allure.Description; |
||||
|
import io.qameta.allure.Feature; |
||||
|
import org.testng.annotations.AfterMethod; |
||||
|
import org.testng.annotations.BeforeMethod; |
||||
|
import org.testng.annotations.Test; |
||||
|
import org.thingsboard.server.common.data.Device; |
||||
|
import org.thingsboard.server.msa.ui.utils.EntityPrototypes; |
||||
|
|
||||
|
import static org.assertj.core.api.Assertions.assertThat; |
||||
|
import static org.thingsboard.server.msa.ui.utils.Const.ENTITY_NAME; |
||||
|
|
||||
|
@Feature("Delete several devices") |
||||
|
public class DeleteSeveralDevicesTest extends AbstractDeviceTest { |
||||
|
|
||||
|
private String deviceName1; |
||||
|
private String deviceName2; |
||||
|
|
||||
|
@BeforeMethod |
||||
|
public void createDevices() { |
||||
|
Device device = testRestClient.postDevice("", EntityPrototypes.defaultDevicePrototype(ENTITY_NAME)); |
||||
|
Device device1 = testRestClient.postDevice("", EntityPrototypes.defaultDevicePrototype(ENTITY_NAME)); |
||||
|
deviceName1 = device.getName(); |
||||
|
deviceName2 = device1.getName(); |
||||
|
} |
||||
|
|
||||
|
@AfterMethod |
||||
|
public void deleteDevices() { |
||||
|
deleteDeviceByName(deviceName1); |
||||
|
deleteDeviceByName(deviceName2); |
||||
|
} |
||||
|
|
||||
|
@Test(groups = "smoke") |
||||
|
@Description("Remove several devices by mark in the checkbox and then click on the trash can icon in the menu " + |
||||
|
"that appears at the top") |
||||
|
public void deleteSeveralDevicesByTopBtn() { |
||||
|
sideBarMenuView.goToDevicesPage(); |
||||
|
devicePage.deleteSelected(2); |
||||
|
devicePage.refreshBtn().click(); |
||||
|
|
||||
|
devicePage.assertEntityIsNotPresent(deviceName1); |
||||
|
devicePage.assertEntityIsNotPresent(deviceName2); |
||||
|
} |
||||
|
|
||||
|
@Test(groups = "smoke") |
||||
|
@Description("Remove several devices by mark all the devices on the page by clicking in the topmost checkbox" + |
||||
|
" and then clicking on the trash icon in the menu that appears") |
||||
|
public void selectAllDevices() { |
||||
|
sideBarMenuView.goToDevicesPage(); |
||||
|
devicePage.selectAllCheckBox().click(); |
||||
|
devicePage.deleteSelectedBtn().click(); |
||||
|
|
||||
|
assertIsDisplayed(devicePage.warningPopUpTitle()); |
||||
|
assertThat(devicePage.warningPopUpTitle().getText()).as("Warning title contains true correct of selected devices") |
||||
|
.contains(String.valueOf(devicePage.markCheckbox().size())); |
||||
|
} |
||||
|
|
||||
|
@Test(groups = "smoke") |
||||
|
@Description("Remove several devices by mark in the checkbox and then click on the trash can icon in the menu " + |
||||
|
"that appears at the top without refresh") |
||||
|
public void deleteSeveralWithoutRefresh() { |
||||
|
sideBarMenuView.goToDevicesPage(); |
||||
|
devicePage.deleteSelected(2); |
||||
|
|
||||
|
devicePage.assertEntityIsNotPresent(deviceName1); |
||||
|
devicePage.assertEntityIsNotPresent(deviceName2); |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,179 @@ |
|||||
|
/** |
||||
|
* Copyright © 2016-2023 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.devicessmoke; |
||||
|
|
||||
|
import io.qameta.allure.Description; |
||||
|
import io.qameta.allure.Feature; |
||||
|
import org.testng.annotations.Test; |
||||
|
import org.thingsboard.server.msa.ui.utils.DataProviderCredential; |
||||
|
import org.thingsboard.server.msa.ui.utils.EntityPrototypes; |
||||
|
|
||||
|
import static org.assertj.core.api.Assertions.assertThat; |
||||
|
import static org.thingsboard.server.msa.ui.base.AbstractBasePage.getRandomNumber; |
||||
|
import static org.thingsboard.server.msa.ui.utils.Const.EMPTY_DEVICE_MESSAGE; |
||||
|
import static org.thingsboard.server.msa.ui.utils.Const.ENTITY_NAME; |
||||
|
|
||||
|
@Feature("Edit device") |
||||
|
public class EditDeviceTest extends AbstractDeviceTest { |
||||
|
|
||||
|
@Test(groups = "smoke") |
||||
|
@Description("Change name by edit menu") |
||||
|
public void changeName() { |
||||
|
String newDeviceName = "Changed" + getRandomNumber(); |
||||
|
deviceName = testRestClient.postDevice("", EntityPrototypes.defaultDevicePrototype(ENTITY_NAME)).getName(); |
||||
|
|
||||
|
sideBarMenuView.goToDevicesPage(); |
||||
|
devicePage.entity(deviceName).click(); |
||||
|
devicePage.setHeaderName(); |
||||
|
String nameBefore = devicePage.getHeaderName(); |
||||
|
devicePage.editPencilBtn().click(); |
||||
|
devicePage.changeNameEditMenu(newDeviceName); |
||||
|
devicePage.doneBtnEditView().click(); |
||||
|
deviceName = newDeviceName; |
||||
|
devicePage.setHeaderName(); |
||||
|
String nameAfter = devicePage.getHeaderName(); |
||||
|
|
||||
|
assertThat(nameAfter).as("The name has changed").isNotEqualTo(nameBefore); |
||||
|
assertThat(nameAfter).as("The name has changed correctly").isEqualTo(newDeviceName); |
||||
|
} |
||||
|
|
||||
|
@Test(groups = "smoke") |
||||
|
@Description("Delete name and save") |
||||
|
public void deleteName() { |
||||
|
deviceName = testRestClient.postDevice("", EntityPrototypes.defaultDevicePrototype(ENTITY_NAME)).getName(); |
||||
|
|
||||
|
sideBarMenuView.goToDevicesPage(); |
||||
|
devicePage.entity(deviceName).click(); |
||||
|
devicePage.editPencilBtn().click(); |
||||
|
devicePage.changeNameEditMenu(""); |
||||
|
|
||||
|
assertIsDisable(devicePage.doneBtnEditViewVisible()); |
||||
|
} |
||||
|
|
||||
|
@Test(groups = "smoke") |
||||
|
@Description("Save only with space") |
||||
|
public void saveOnlyWithSpace() { |
||||
|
deviceName = testRestClient.postDevice("", EntityPrototypes.defaultDevicePrototype(ENTITY_NAME)).getName(); |
||||
|
|
||||
|
sideBarMenuView.goToDevicesPage(); |
||||
|
devicePage.entity(deviceName).click(); |
||||
|
devicePage.editPencilBtn().click(); |
||||
|
devicePage.changeNameEditMenu(" "); |
||||
|
devicePage.doneBtnEditView().click(); |
||||
|
|
||||
|
assertIsDisplayed(devicePage.warningMessage()); |
||||
|
assertThat(devicePage.warningMessage().getText()).as("Text of warning message").isEqualTo(EMPTY_DEVICE_MESSAGE); |
||||
|
} |
||||
|
|
||||
|
@Test(groups = "smoke", dataProviderClass = DataProviderCredential.class, dataProvider = "editMenuDescription") |
||||
|
@Description("Write the description and save the changes/Change the description and save the changes/Delete the description and save the changes") |
||||
|
public void editDescription(String description, String newDescription, String finalDescription) { |
||||
|
deviceName = testRestClient.postDevice("", EntityPrototypes.defaultDevicePrototype(ENTITY_NAME, description)).getName(); |
||||
|
|
||||
|
sideBarMenuView.goToDevicesPage(); |
||||
|
devicePage.entity(deviceName).click(); |
||||
|
devicePage.editPencilBtn().click(); |
||||
|
devicePage.descriptionEntityView().sendKeys(newDescription); |
||||
|
devicePage.doneBtnEditView().click(); |
||||
|
devicePage.setDescription(); |
||||
|
|
||||
|
assertThat(devicePage.getDescription()).as("The description changed correctly").isEqualTo(finalDescription); |
||||
|
} |
||||
|
|
||||
|
@Test(groups = "smoke", dataProviderClass = DataProviderCredential.class, dataProvider = "enable") |
||||
|
@Description("Enable gateway mode/Disable gateway") |
||||
|
public void isGateway(boolean isGateway) { |
||||
|
deviceName = testRestClient.postDevice("", EntityPrototypes.defaultDevicePrototype(ENTITY_NAME, isGateway)).getName(); |
||||
|
|
||||
|
sideBarMenuView.goToDevicesPage(); |
||||
|
devicePage.entity(deviceName).click(); |
||||
|
devicePage.editPencilBtn().click(); |
||||
|
devicePage.checkboxGatewayEdit().click(); |
||||
|
devicePage.doneBtnEditView().click(); |
||||
|
|
||||
|
if (isGateway) { |
||||
|
assertThat(devicePage.checkboxGatewayDetailsTab().getAttribute("class").contains("selected")) |
||||
|
.as("Gateway is disable").isFalse(); |
||||
|
} else { |
||||
|
assertThat(devicePage.checkboxGatewayDetailsTab().getAttribute("class").contains("selected")) |
||||
|
.as("Gateway is enable").isTrue(); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
@Test(groups = "smoke", dataProviderClass = DataProviderCredential.class, dataProvider = "enable") |
||||
|
@Description("Enable overwrite activity time for connected/Disable overwrite activity time for connected") |
||||
|
public void isOverwriteActivityTimeForConnectedDevice(boolean isOverwriteActivityTimeForConnected) { |
||||
|
deviceName = testRestClient.postDevice("", |
||||
|
EntityPrototypes.defaultDevicePrototype(ENTITY_NAME, true, isOverwriteActivityTimeForConnected)).getName(); |
||||
|
|
||||
|
sideBarMenuView.goToDevicesPage(); |
||||
|
devicePage.entity(deviceName).click(); |
||||
|
devicePage.editPencilBtn().click(); |
||||
|
devicePage.checkboxOverwriteActivityTimeEdit().click(); |
||||
|
devicePage.doneBtnEditView().click(); |
||||
|
|
||||
|
if (isOverwriteActivityTimeForConnected) { |
||||
|
assertThat(devicePage.checkboxOverwriteActivityTimeDetails().getAttribute("class").contains("selected")) |
||||
|
.as("Overwrite activity time for connected is disable").isFalse(); |
||||
|
} else { |
||||
|
assertThat(devicePage.checkboxOverwriteActivityTimeDetails().getAttribute("class").contains("selected")) |
||||
|
.as("Overwrite activity time for connected is enable").isTrue(); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
@Test(groups = "smoke") |
||||
|
@Description("Change device profile") |
||||
|
public void changeDeviceProfile() { |
||||
|
deviceName = testRestClient.postDevice("", EntityPrototypes.defaultDevicePrototype(ENTITY_NAME)).getName(); |
||||
|
|
||||
|
sideBarMenuView.goToDevicesPage(); |
||||
|
devicePage.entity(deviceName).click(); |
||||
|
devicePage.editPencilBtn().click(); |
||||
|
devicePage.changeDeviceProfile("DEFAULT"); |
||||
|
devicePage.doneBtnEditView().click(); |
||||
|
|
||||
|
assertIsDisplayed(devicePage.deviceProfileRedirectedBtn()); |
||||
|
assertThat(devicePage.deviceProfileRedirectedBtn().getText()).as("Profile changed correctly").isEqualTo("DEFAULT"); |
||||
|
} |
||||
|
|
||||
|
@Test(groups = "smoke") |
||||
|
@Description("Save without device profile") |
||||
|
public void saveWithoutDeviceProfile() { |
||||
|
deviceName = testRestClient.postDevice("", EntityPrototypes.defaultDevicePrototype(ENTITY_NAME)).getName(); |
||||
|
|
||||
|
sideBarMenuView.goToDevicesPage(); |
||||
|
devicePage.entity(deviceName).click(); |
||||
|
devicePage.editPencilBtn().click(); |
||||
|
devicePage.clearProfileFieldBtn().click(); |
||||
|
|
||||
|
assertIsDisable(devicePage.doneBtnEditViewVisible()); |
||||
|
} |
||||
|
|
||||
|
@Test(groups = "smoke", dataProviderClass = DataProviderCredential.class, dataProvider = "editDeviceLabel") |
||||
|
@Description("Write the label and save the changes/Change the label and save the changes/Delete the label and save the changes") |
||||
|
public void editLabel(String label, String newLabel, String finalLabel) { |
||||
|
deviceName = testRestClient.postDevice("", EntityPrototypes.defaultDevicePrototype(ENTITY_NAME, "", label)).getName(); |
||||
|
|
||||
|
sideBarMenuView.goToDevicesPage(); |
||||
|
devicePage.entity(deviceName).click(); |
||||
|
devicePage.editPencilBtn().click(); |
||||
|
devicePage.deviceLabelEditField().sendKeys(newLabel); |
||||
|
devicePage.doneBtnEditView().click(); |
||||
|
devicePage.setLabel(); |
||||
|
|
||||
|
assertThat(devicePage.getLabel()).as("The label changed correctly").isEqualTo(finalLabel); |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,35 @@ |
|||||
|
<?xml version="1.0" encoding="ISO-8859-1"?> |
||||
|
<!-- |
||||
|
|
||||
|
Copyright © 2016-2023 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. |
||||
|
|
||||
|
--> |
||||
|
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" > |
||||
|
|
||||
|
<suite name="Devices Smoke Tests"> |
||||
|
<listeners> |
||||
|
<listener class-name="org.thingsboard.server.msa.ui.listeners.RetryTestListener"/> |
||||
|
</listeners> |
||||
|
<test name="Devices ui smoke tests"> |
||||
|
<groups> |
||||
|
<run> |
||||
|
<exclude name="broken"/> |
||||
|
</run> |
||||
|
</groups> |
||||
|
<packages> |
||||
|
<package name="org.thingsboard.server.msa.ui.tests.devicessmoke"/> |
||||
|
</packages> |
||||
|
</test> |
||||
|
</suite> |
||||
@ -0,0 +1,17 @@ |
|||||
|
# Security Policy |
||||
|
|
||||
|
## Reporting a Vulnerability |
||||
|
|
||||
|
Security is of the highest importance and all security vulnerabilities or suspected security vulnerabilities should be reported to Thingsboard privately, |
||||
|
to minimize attacks against current users of Thingsboard before they are fixed. Vulnerabilities will be investigated and release as soon as possible. |
||||
|
|
||||
|
To report a vulnerability or a security-related issue, please email the private address security@thingsboard.io with the details of the vulnerability. |
||||
|
Emails will be addressed within 3 business days, including a detailed plan to investigate the issue and any potential workarounds to perform in the meantime. |
||||
|
Do not report non-security-impacting bugs through this channel. Use GitHub issues instead. |
||||
|
|
||||
|
**Proposed Email Content** |
||||
|
Provide a descriptive subject line and in the body of the email include the following information: |
||||
|
|
||||
|
- Basic identity information, such as your name and your affiliation or company. |
||||
|
- Detailed steps to reproduce the vulnerability (log errors, screenshots are all helpful to us). |
||||
|
- Description of the effects of the vulnerability on Thingsboard. |
||||
Loading…
Reference in new issue