From da2c0d308c53388f41b9a20f321be01c45e5b1b0 Mon Sep 17 00:00:00 2001 From: Seraphym-Tuhai Date: Wed, 24 May 2023 13:55:13 +0300 Subject: [PATCH] added Epic --- .../ui/tests/devicessmoke/DeviceFilterTest.java | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/tests/devicessmoke/DeviceFilterTest.java b/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/tests/devicessmoke/DeviceFilterTest.java index 0b49ca39c2..f454c874c7 100644 --- a/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/tests/devicessmoke/DeviceFilterTest.java +++ b/msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/tests/devicessmoke/DeviceFilterTest.java @@ -17,6 +17,7 @@ package org.thingsboard.server.msa.ui.tests.devicessmoke; import com.fasterxml.jackson.core.JsonProcessingException; import io.qameta.allure.Description; +import io.qameta.allure.Epic; import org.testng.annotations.AfterClass; import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; @@ -31,6 +32,7 @@ import static org.thingsboard.server.msa.ui.utils.Const.DEVICE_ACTIVE_STATE; import static org.thingsboard.server.msa.ui.utils.Const.DEVICE_INACTIVE_STATE; import static org.thingsboard.server.msa.ui.utils.Const.ENTITY_NAME; +@Epic("Filter devices (By device profile and state)") public class DeviceFilterTest extends AbstractDeviceTest { private String activeDeviceName; @@ -38,23 +40,25 @@ public class DeviceFilterTest extends AbstractDeviceTest { private String activeDeviceWithProfileName; @BeforeClass - public void create() throws JsonProcessingException { + public void createTestEntities() throws JsonProcessingException { DeviceProfile deviceProfile = testRestClient.postDeviceProfile(EntityPrototypes.defaultDeviceProfile(ENTITY_NAME + random())); - deviceProfileTitle = deviceProfile.getName(); Device deviceWithProfile = testRestClient.postDevice("", EntityPrototypes.defaultDevicePrototype(ENTITY_NAME + random(), deviceProfile.getId())); - deviceWithProfileName = deviceWithProfile.getName(); Device activeDevice = testRestClient.postDevice("", EntityPrototypes.defaultDevicePrototype(ENTITY_NAME + random())); - activeDeviceName = activeDevice.getName(); Device activeDeviceWithProfile = testRestClient.postDevice("", EntityPrototypes.defaultDevicePrototype(ENTITY_NAME + random(), deviceProfile.getId())); - activeDeviceWithProfileName = activeDeviceWithProfile.getName(); + DeviceCredentials deviceCredentials = testRestClient.getDeviceCredentialsByDeviceId(activeDevice.getId()); DeviceCredentials deviceCredentials1 = testRestClient.getDeviceCredentialsByDeviceId(activeDeviceWithProfile.getId()); testRestClient.postTelemetry(deviceCredentials.getCredentialsId(), mapper.readTree(createPayload().toString())); testRestClient.postTelemetry(deviceCredentials1.getCredentialsId(), mapper.readTree(createPayload().toString())); + + deviceProfileTitle = deviceProfile.getName(); + deviceWithProfileName = deviceWithProfile.getName(); + activeDeviceName = activeDevice.getName(); + activeDeviceWithProfileName = activeDeviceWithProfile.getName(); } @AfterClass - public void delete() { + public void deleteTestEntities() { deleteDevicesByName(deviceWithProfileName, activeDeviceName, activeDeviceWithProfileName); deleteDeviceProfileByTitle(deviceProfileTitle); }