Browse Source

add suite for all tests

pull/7746/head
Serafym Tuhai 4 years ago
parent
commit
de4cc224a6
  1. 8
      msa/black-box-tests/README.md
  2. 4
      msa/black-box-tests/pom.xml
  3. 5
      msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/pages/CustomerPageElements.java
  4. 1
      msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/tests/customerSmoke/CustomerEditMenuTest.java
  5. 7
      msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/tests/customerSmoke/DeleteCustomerTest.java
  6. 3
      msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/tests/ruleChainsSmoke/CreateRuleChainImportTest.java
  7. 26
      msa/black-box-tests/src/test/resources/all.xml
  8. 0
      msa/black-box-tests/src/test/resources/blackBox.xml
  9. 2
      msa/black-box-tests/src/test/resources/uiTests.xml

8
msa/black-box-tests/README.md

@ -34,9 +34,13 @@ As result, in REPOSITORY column, next images should be present:
mvn clean install -DblackBoxTests.skip=false -DrunLocal=true
- To run ui smoke tests in the [msa/black-box-tests](../black-box-tests) directory specifying suiteFile property:
- To run ui smoke tests in the [msa/black-box-tests](../black-box-tests) directory specifying suite name:
mvn clean install -DblackBoxTests.skip=false -DsuiteFile=src/test/resources/smokeTests.xml
mvn clean install -DblackBoxTests.skip=false -Dsuite=uiTests
- To run all tests in the [msa/black-box-tests](../black-box-tests) directory specifying suite name:
mvn clean install -DblackBoxTests.skip=false -Dsuite=all

4
msa/black-box-tests/pom.xml

@ -34,7 +34,7 @@
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<main.dir>${basedir}/../..</main.dir>
<suiteFile>src/test/resources/testNG.xml</suiteFile>
<suite>blackBox</suite>
</properties>
<dependencies>
@ -184,7 +184,7 @@
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<suiteXmlFiles>
<suiteXmlFile>${suiteFile}</suiteXmlFile>
<suiteXmlFile>src/test/resources/${suite}.xml</suiteXmlFile>
</suiteXmlFiles>
<skipTests>${blackBoxTests.skip}</skipTests>
</configuration>

5
msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/pages/CustomerPageElements.java

@ -70,6 +70,7 @@ public class CustomerPageElements extends OtherPageElementsHelper {
private static final String MANAGE_CUSTOMERS_DEVICE_BTN_VIEW = "Manage devices";
private static final String MANAGE_CUSTOMERS_DASHBOARD_BTN_VIEW = "Manage dashboards";
private static final String MANAGE_CUSTOMERS_EDGE_BTN_VIEW = "Manage edges ";
private static final String DELETE_FROM_VIEW_BTN = "//tb-customer//span[contains(text(),' Delete')]";
public WebElement titleFieldAddEntityView() {
return waitUntilElementToBeClickable(ADD_ENTITY_VIEW + String.format(INPUT_FIELD, INPUT_FIELD_NAME_TITLE));
@ -274,4 +275,8 @@ public class CustomerPageElements extends OtherPageElementsHelper {
public WebElement manageCustomersEdgeBtnView() {
return waitUntilElementToBeClickable(String.format(MANAGE_BTN_VIEW, MANAGE_CUSTOMERS_EDGE_BTN_VIEW));
}
public WebElement customerViewDeleteBtn() {
return waitUntilElementToBeClickable(DELETE_FROM_VIEW_BTN);
}
}

1
msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/tests/customerSmoke/CustomerEditMenuTest.java

@ -256,7 +256,6 @@ public class CustomerEditMenuTest extends AbstractDiverBaseTest {
public void addAllInformation() {
customerName = ENTITY_NAME;
testRestClient.postCustomer(defaultCustomerPrototype(customerName));
;
String text = "Text";
String email = "email@mail.com";
String number = "2015550123";

7
msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/tests/customerSmoke/DeleteCustomerTest.java

@ -81,10 +81,11 @@ public class DeleteCustomerTest extends AbstractDiverBaseTest {
sideBarMenuView.customerBtn().click();
customerPage.entity(customerName).click();
String deletedCustomer = ruleChainsPage.deleteRuleChainFromView(customerName);
ruleChainsPage.refreshBtn().click();
customerPage.customerViewDeleteBtn().click();
customerPage.warningPopUpYesBtn().click();
customerPage.refreshBtn().click();
Assert.assertTrue(ruleChainsPage.entityIsNotPresent(deletedCustomer));
Assert.assertTrue(customerPage.entityIsNotPresent(customerName));
}
@Test(priority = 20, groups = "smoke")

3
msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/tests/ruleChainsSmoke/CreateRuleChainImportTest.java

@ -101,6 +101,7 @@ public class CreateRuleChainImportTest extends AbstractDiverBaseTest {
@Test(priority = 30, groups = "smoke")
@Description
public void importRuleChainAndSave() {
ruleChainName = IMPORT_RULE_CHAIN_NAME;
sideBarMenuView.ruleChainsBtn().click();
ruleChainsPage.openImportRuleChainView();
ruleChainsPage.browseFile().sendKeys(absolutePathToFileImportRuleChain);
@ -108,7 +109,6 @@ public class CreateRuleChainImportTest extends AbstractDiverBaseTest {
openRuleChainPage.doneBtn().click();
openRuleChainPage.waitUntilDoneBtnDisable();
sideBarMenuView.ruleChainsBtn().click();
ruleChainName = IMPORT_RULE_CHAIN_NAME;
Assert.assertNotNull(ruleChainsPage.entity(IMPORT_RULE_CHAIN_NAME));
Assert.assertTrue(ruleChainsPage.entity(IMPORT_RULE_CHAIN_NAME).isDisplayed());
@ -119,7 +119,6 @@ public class CreateRuleChainImportTest extends AbstractDiverBaseTest {
public void importRuleChainAndSaveWithSameName() {
ruleChainName = IMPORT_RULE_CHAIN_NAME;
testRestClient.postRuleChain(defaultRuleChainPrototype(ruleChainName));
;
sideBarMenuView.ruleChainsBtn().click();
ruleChainsPage.openImportRuleChainView();

26
msa/black-box-tests/src/test/resources/all.xml

@ -0,0 +1,26 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<!--
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.
-->
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" >
<suite name="All tests">
<suite-files>
<suite-file path="blackBox.xml"/>
<suite-file path="uiTests.xml"/>
</suite-files>
</suite>

0
msa/black-box-tests/src/test/resources/testNG.xml → msa/black-box-tests/src/test/resources/blackBox.xml

2
msa/black-box-tests/src/test/resources/smokeTests.xml → msa/black-box-tests/src/test/resources/uiTests.xml

@ -18,7 +18,7 @@
-->
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" >
<suite name="Smoke tests">
<suite name="UI smoke tests">
<suite-files>
<suite-file path="smokesRuleChain.xml"/>
<suite-file path="smokesCustomer.xml"/>
Loading…
Cancel
Save