add tests on delete phone number
This commit is contained in:
parent
a0091c632a
commit
42df526966
@ -114,6 +114,24 @@ public class CreateCustomerTest extends AbstractDriverBaseTest {
|
|||||||
Assert.assertEquals(customerPage.getCustomerCity(), text);
|
Assert.assertEquals(customerPage.getCustomerCity(), text);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test(priority = 20, groups = "smoke")
|
||||||
|
@Description
|
||||||
|
public void createCustomerAddAndRemovePhoneNumber() {
|
||||||
|
String customerName = ENTITY_NAME;
|
||||||
|
String number = "12015550123";
|
||||||
|
|
||||||
|
sideBarMenuView.customerBtn().click();
|
||||||
|
customerPage.plusBtn().click();
|
||||||
|
customerPage.titleFieldAddEntityView().sendKeys(customerName);
|
||||||
|
customerPage.phoneNumberAddEntityView().sendKeys(number);
|
||||||
|
customerPage.phoneNumberAddEntityView().clear();
|
||||||
|
customerPage.addBtnC().click();
|
||||||
|
this.customerName = customerName;
|
||||||
|
customerPage.entity(customerName).click();
|
||||||
|
|
||||||
|
Assert.assertEquals(customerPage.phoneNumberEntityView().getAttribute("value"), "");
|
||||||
|
}
|
||||||
|
|
||||||
@Test(priority = 20, groups = "smoke")
|
@Test(priority = 20, groups = "smoke")
|
||||||
@Description
|
@Description
|
||||||
public void createCustomerWithoutName() {
|
public void createCustomerWithoutName() {
|
||||||
|
|||||||
@ -16,6 +16,7 @@
|
|||||||
package org.thingsboard.server.msa.ui.tests.customerSmoke;
|
package org.thingsboard.server.msa.ui.tests.customerSmoke;
|
||||||
|
|
||||||
import io.qameta.allure.Description;
|
import io.qameta.allure.Description;
|
||||||
|
import org.openqa.selenium.Keys;
|
||||||
import org.testng.Assert;
|
import org.testng.Assert;
|
||||||
import org.testng.annotations.AfterMethod;
|
import org.testng.annotations.AfterMethod;
|
||||||
import org.testng.annotations.BeforeMethod;
|
import org.testng.annotations.BeforeMethod;
|
||||||
@ -240,6 +241,24 @@ public class CustomerEditMenuTest extends AbstractDriverBaseTest {
|
|||||||
Assert.assertTrue(customerPage.phoneNumberEntityView().getAttribute("value").contains(number));
|
Assert.assertTrue(customerPage.phoneNumberEntityView().getAttribute("value").contains(number));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test(priority = 20, groups = "smoke")
|
||||||
|
@Description
|
||||||
|
public void deletePhoneNumber() {
|
||||||
|
String customerName = ENTITY_NAME;
|
||||||
|
String number = "+12015550123";
|
||||||
|
testRestClient.postCustomer(defaultCustomerPrototype(customerName, number));
|
||||||
|
this.customerName = customerName;
|
||||||
|
|
||||||
|
sideBarMenuView.customerBtn().click();
|
||||||
|
customerPage.entity(customerName).click();
|
||||||
|
customerPage.editPencilBtn().click();
|
||||||
|
customerPage.phoneNumberEntityView().click();
|
||||||
|
customerPage.phoneNumberEntityView().sendKeys(Keys.CONTROL + "A" + Keys.BACK_SPACE);
|
||||||
|
customerPage.doneBtnEditView().click();
|
||||||
|
|
||||||
|
Assert.assertEquals(customerPage.phoneNumberEntityView().getAttribute("value"), "");
|
||||||
|
}
|
||||||
|
|
||||||
@Test(priority = 20, groups = "smoke", dataProviderClass = DataProviderCredential.class, dataProvider = "incorrectPhoneNumber")
|
@Test(priority = 20, groups = "smoke", dataProviderClass = DataProviderCredential.class, dataProvider = "incorrectPhoneNumber")
|
||||||
@Description
|
@Description
|
||||||
public void addIncorrectPhoneNumber(String number) {
|
public void addIncorrectPhoneNumber(String number) {
|
||||||
|
|||||||
@ -26,6 +26,13 @@ public class EntityPrototypes {
|
|||||||
return customer;
|
return customer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static Customer defaultCustomerPrototype(String entityName, String phoneNumber){
|
||||||
|
Customer customer = new Customer();
|
||||||
|
customer.setTitle(entityName);
|
||||||
|
customer.setPhone(phoneNumber);
|
||||||
|
return customer;
|
||||||
|
}
|
||||||
|
|
||||||
public static RuleChain defaultRuleChainPrototype(String entityName){
|
public static RuleChain defaultRuleChainPrototype(String entityName){
|
||||||
RuleChain ruleChain = new RuleChain();
|
RuleChain ruleChain = new RuleChain();
|
||||||
ruleChain.setName(entityName);
|
ruleChain.setName(entityName);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user