added Epic
This commit is contained in:
parent
e7813db9b7
commit
da2c0d308c
@ -17,6 +17,7 @@ package org.thingsboard.server.msa.ui.tests.devicessmoke;
|
|||||||
|
|
||||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||||
import io.qameta.allure.Description;
|
import io.qameta.allure.Description;
|
||||||
|
import io.qameta.allure.Epic;
|
||||||
import org.testng.annotations.AfterClass;
|
import org.testng.annotations.AfterClass;
|
||||||
import org.testng.annotations.BeforeClass;
|
import org.testng.annotations.BeforeClass;
|
||||||
import org.testng.annotations.Test;
|
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.DEVICE_INACTIVE_STATE;
|
||||||
import static org.thingsboard.server.msa.ui.utils.Const.ENTITY_NAME;
|
import static org.thingsboard.server.msa.ui.utils.Const.ENTITY_NAME;
|
||||||
|
|
||||||
|
@Epic("Filter devices (By device profile and state)")
|
||||||
public class DeviceFilterTest extends AbstractDeviceTest {
|
public class DeviceFilterTest extends AbstractDeviceTest {
|
||||||
|
|
||||||
private String activeDeviceName;
|
private String activeDeviceName;
|
||||||
@ -38,23 +40,25 @@ public class DeviceFilterTest extends AbstractDeviceTest {
|
|||||||
private String activeDeviceWithProfileName;
|
private String activeDeviceWithProfileName;
|
||||||
|
|
||||||
@BeforeClass
|
@BeforeClass
|
||||||
public void create() throws JsonProcessingException {
|
public void createTestEntities() throws JsonProcessingException {
|
||||||
DeviceProfile deviceProfile = testRestClient.postDeviceProfile(EntityPrototypes.defaultDeviceProfile(ENTITY_NAME + random()));
|
DeviceProfile deviceProfile = testRestClient.postDeviceProfile(EntityPrototypes.defaultDeviceProfile(ENTITY_NAME + random()));
|
||||||
deviceProfileTitle = deviceProfile.getName();
|
|
||||||
Device deviceWithProfile = testRestClient.postDevice("", EntityPrototypes.defaultDevicePrototype(ENTITY_NAME + random(), deviceProfile.getId()));
|
Device deviceWithProfile = testRestClient.postDevice("", EntityPrototypes.defaultDevicePrototype(ENTITY_NAME + random(), deviceProfile.getId()));
|
||||||
deviceWithProfileName = deviceWithProfile.getName();
|
|
||||||
Device activeDevice = testRestClient.postDevice("", EntityPrototypes.defaultDevicePrototype(ENTITY_NAME + random()));
|
Device activeDevice = testRestClient.postDevice("", EntityPrototypes.defaultDevicePrototype(ENTITY_NAME + random()));
|
||||||
activeDeviceName = activeDevice.getName();
|
|
||||||
Device activeDeviceWithProfile = testRestClient.postDevice("", EntityPrototypes.defaultDevicePrototype(ENTITY_NAME + random(), deviceProfile.getId()));
|
Device activeDeviceWithProfile = testRestClient.postDevice("", EntityPrototypes.defaultDevicePrototype(ENTITY_NAME + random(), deviceProfile.getId()));
|
||||||
activeDeviceWithProfileName = activeDeviceWithProfile.getName();
|
|
||||||
DeviceCredentials deviceCredentials = testRestClient.getDeviceCredentialsByDeviceId(activeDevice.getId());
|
DeviceCredentials deviceCredentials = testRestClient.getDeviceCredentialsByDeviceId(activeDevice.getId());
|
||||||
DeviceCredentials deviceCredentials1 = testRestClient.getDeviceCredentialsByDeviceId(activeDeviceWithProfile.getId());
|
DeviceCredentials deviceCredentials1 = testRestClient.getDeviceCredentialsByDeviceId(activeDeviceWithProfile.getId());
|
||||||
testRestClient.postTelemetry(deviceCredentials.getCredentialsId(), mapper.readTree(createPayload().toString()));
|
testRestClient.postTelemetry(deviceCredentials.getCredentialsId(), mapper.readTree(createPayload().toString()));
|
||||||
testRestClient.postTelemetry(deviceCredentials1.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
|
@AfterClass
|
||||||
public void delete() {
|
public void deleteTestEntities() {
|
||||||
deleteDevicesByName(deviceWithProfileName, activeDeviceName, activeDeviceWithProfileName);
|
deleteDevicesByName(deviceWithProfileName, activeDeviceName, activeDeviceWithProfileName);
|
||||||
deleteDeviceProfileByTitle(deviceProfileTitle);
|
deleteDeviceProfileByTitle(deviceProfileTitle);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user