refactoring
This commit is contained in:
parent
6aa48a91ff
commit
d03dc24680
@ -57,12 +57,13 @@ public class CreateCustomerTest extends AbstractDriverBaseTest {
|
||||
@Test(priority = 10, groups = "smoke")
|
||||
@Description
|
||||
public void createCustomer() {
|
||||
customerName = ENTITY_NAME;
|
||||
String customerName = ENTITY_NAME;
|
||||
|
||||
sideBarMenuView.customerBtn().click();
|
||||
customerPage.plusBtn().click();
|
||||
customerPage.titleFieldAddEntityView().sendKeys(customerName);
|
||||
customerPage.addBtnC().click();
|
||||
this.customerName = customerName;
|
||||
customerPage.refreshBtn().click();
|
||||
|
||||
Assert.assertNotNull(customerPage.customer(customerName));
|
||||
|
||||
@ -64,8 +64,9 @@ public class CustomerEditMenuTest extends AbstractDriverBaseTest {
|
||||
@Test(priority = 10, groups = "smoke")
|
||||
@Description
|
||||
public void changeTitle() {
|
||||
customerName = "Changed" + getRandomNumber();
|
||||
String customerName = "Changed" + getRandomNumber();
|
||||
testRestClient.postCustomer(defaultCustomerPrototype(ENTITY_NAME));
|
||||
this.customerName = customerName;
|
||||
|
||||
sideBarMenuView.customerBtn().click();
|
||||
customerPage.entityTitles().get(0).click();
|
||||
@ -112,8 +113,9 @@ public class CustomerEditMenuTest extends AbstractDriverBaseTest {
|
||||
@Test(priority = 20, groups = "smoke")
|
||||
@Description
|
||||
public void editDescription() {
|
||||
customerName = ENTITY_NAME;
|
||||
String customerName = ENTITY_NAME;
|
||||
testRestClient.postCustomer(defaultCustomerPrototype(customerName));
|
||||
this.customerName = customerName;
|
||||
String description = "Description";
|
||||
|
||||
sideBarMenuView.customerBtn().click();
|
||||
@ -138,8 +140,9 @@ public class CustomerEditMenuTest extends AbstractDriverBaseTest {
|
||||
@Test(priority = 20, groups = "smoke")
|
||||
@Description
|
||||
public void assignedDashboardFromDashboard() {
|
||||
customerName = ENTITY_NAME;
|
||||
String customerName = ENTITY_NAME;
|
||||
testRestClient.postCustomer(defaultCustomerPrototype(customerName));
|
||||
this.customerName = customerName;
|
||||
|
||||
sideBarMenuView.dashboardBtn().click();
|
||||
dashboardPage.setDashboardTitle();
|
||||
@ -164,8 +167,9 @@ public class CustomerEditMenuTest extends AbstractDriverBaseTest {
|
||||
@Test(priority = 20, groups = "smoke")
|
||||
@Description
|
||||
public void assignedDashboard() {
|
||||
customerName = ENTITY_NAME;
|
||||
String customerName = ENTITY_NAME;
|
||||
testRestClient.postCustomer(defaultCustomerPrototype(customerName));
|
||||
this.customerName = customerName;
|
||||
|
||||
sideBarMenuView.customerBtn().click();
|
||||
customerPage.manageCustomersDashboardsBtn(customerName).click();
|
||||
@ -189,8 +193,9 @@ public class CustomerEditMenuTest extends AbstractDriverBaseTest {
|
||||
@Test(priority = 20, groups = "smoke")
|
||||
@Description
|
||||
public void assignedDashboardWithoutHide() {
|
||||
customerName = ENTITY_NAME;
|
||||
String customerName = ENTITY_NAME;
|
||||
testRestClient.postCustomer(defaultCustomerPrototype(customerName));
|
||||
this.customerName = customerName;
|
||||
|
||||
sideBarMenuView.customerBtn().click();
|
||||
customerPage.manageCustomersDashboardsBtn(customerName).click();
|
||||
@ -221,8 +226,9 @@ public class CustomerEditMenuTest extends AbstractDriverBaseTest {
|
||||
@Test(priority = 20, groups = "smoke")
|
||||
@Description
|
||||
public void addPhoneNumber() {
|
||||
customerName = ENTITY_NAME;
|
||||
String customerName = ENTITY_NAME;
|
||||
testRestClient.postCustomer(defaultCustomerPrototype(customerName));
|
||||
this.customerName = customerName;
|
||||
String number = "2015550123";
|
||||
|
||||
sideBarMenuView.customerBtn().click();
|
||||
@ -253,8 +259,9 @@ public class CustomerEditMenuTest extends AbstractDriverBaseTest {
|
||||
@Test(priority = 30, groups = "smoke")
|
||||
@Description
|
||||
public void addAllInformation() {
|
||||
customerName = ENTITY_NAME;
|
||||
String customerName = ENTITY_NAME;
|
||||
testRestClient.postCustomer(defaultCustomerPrototype(customerName));
|
||||
this.customerName = customerName;
|
||||
String text = "Text";
|
||||
String email = "email@mail.com";
|
||||
String number = "2015550123";
|
||||
|
||||
@ -55,8 +55,8 @@ public class SortByNameTest extends AbstractDriverBaseTest {
|
||||
@Test(priority = 10, groups = "smoke", dataProviderClass = DataProviderCredential.class, dataProvider = "nameForSort")
|
||||
@Description
|
||||
public void specialCharacterUp(String title) {
|
||||
customerName = title;
|
||||
testRestClient.postCustomer(defaultCustomerPrototype(title));
|
||||
this.customerName = title;
|
||||
|
||||
sideBarMenuView.customerBtn().click();
|
||||
customerPage.sortByTitleBtn().click();
|
||||
@ -81,24 +81,20 @@ public class SortByNameTest extends AbstractDriverBaseTest {
|
||||
customerPage.setCustomerName(2);
|
||||
String thirdCustomer = customerPage.getCustomerName();
|
||||
|
||||
boolean firstEquals = firstCustomer.equals(customerSymbol);
|
||||
boolean secondEquals = secondCustomer.equals(customerNumber);
|
||||
boolean thirdEquals = thirdCustomer.equals(customer);
|
||||
|
||||
testRestClient.deleteCustomer(getCustomerByName(customer).getId());
|
||||
testRestClient.deleteCustomer(getCustomerByName(customerNumber).getId());
|
||||
testRestClient.deleteCustomer(getCustomerByName(customerSymbol).getId());
|
||||
|
||||
Assert.assertTrue(firstEquals);
|
||||
Assert.assertTrue(secondEquals);
|
||||
Assert.assertTrue(thirdEquals);
|
||||
Assert.assertEquals(firstCustomer, customerSymbol);
|
||||
Assert.assertEquals(secondCustomer, customerNumber);
|
||||
Assert.assertEquals(thirdCustomer, customer);
|
||||
}
|
||||
|
||||
@Test(priority = 10, groups = "smoke", dataProviderClass = DataProviderCredential.class, dataProvider = "nameForSort")
|
||||
@Description
|
||||
public void specialCharacterDown(String title) {
|
||||
customerName = title;
|
||||
testRestClient.postCustomer(defaultCustomerPrototype(title));
|
||||
customerName = title;
|
||||
|
||||
sideBarMenuView.customerBtn().click();
|
||||
customerPage.sortByNameDown();
|
||||
@ -124,16 +120,12 @@ public class SortByNameTest extends AbstractDriverBaseTest {
|
||||
customerPage.setCustomerName(lastIndex - 2);
|
||||
String thirdCustomer = customerPage.getCustomerName();
|
||||
|
||||
boolean firstEquals = firstCustomer.equals(customerSymbol);
|
||||
boolean secondEquals = secondCustomer.equals(customerNumber);
|
||||
boolean thirdEquals = thirdCustomer.equals(customer);
|
||||
|
||||
testRestClient.deleteCustomer(getCustomerByName(customer).getId());
|
||||
testRestClient.deleteCustomer(getCustomerByName(customerNumber).getId());
|
||||
testRestClient.deleteCustomer(getCustomerByName(customerSymbol).getId());
|
||||
|
||||
Assert.assertTrue(firstEquals);
|
||||
Assert.assertTrue(secondEquals);
|
||||
Assert.assertTrue(thirdEquals);
|
||||
Assert.assertEquals(firstCustomer, customerSymbol);
|
||||
Assert.assertEquals(secondCustomer, customerNumber);
|
||||
Assert.assertEquals(thirdCustomer, customer);
|
||||
}
|
||||
}
|
||||
|
||||
@ -100,13 +100,13 @@ public class CreateRuleChainImportTest extends AbstractDriverBaseTest {
|
||||
@Test(priority = 30, groups = "smoke")
|
||||
@Description
|
||||
public void importRuleChainAndSave() {
|
||||
ruleChainName = IMPORT_RULE_CHAIN_NAME;
|
||||
sideBarMenuView.ruleChainsBtn().click();
|
||||
ruleChainsPage.openImportRuleChainView();
|
||||
ruleChainsPage.browseFile().sendKeys(absolutePathToFileImportRuleChain);
|
||||
ruleChainsPage.importBrowseFileBtn().click();
|
||||
openRuleChainPage.doneBtn().click();
|
||||
openRuleChainPage.waitUntilDoneBtnDisable();
|
||||
ruleChainName = IMPORT_RULE_CHAIN_NAME;
|
||||
sideBarMenuView.ruleChainsBtn().click();
|
||||
|
||||
Assert.assertNotNull(ruleChainsPage.entity(IMPORT_RULE_CHAIN_NAME));
|
||||
@ -116,8 +116,9 @@ public class CreateRuleChainImportTest extends AbstractDriverBaseTest {
|
||||
@Test(priority = 40, groups = "smoke")
|
||||
@Description
|
||||
public void importRuleChainAndSaveWithSameName() {
|
||||
ruleChainName = IMPORT_RULE_CHAIN_NAME;
|
||||
String ruleChainName = IMPORT_RULE_CHAIN_NAME;
|
||||
testRestClient.postRuleChain(defaultRuleChainPrototype(ruleChainName));
|
||||
this.ruleChainName = ruleChainName;
|
||||
|
||||
sideBarMenuView.ruleChainsBtn().click();
|
||||
ruleChainsPage.openImportRuleChainView();
|
||||
|
||||
@ -59,22 +59,23 @@ public class CreateRuleChainTest extends AbstractDriverBaseTest {
|
||||
@Test(priority = 10, groups = "smoke")
|
||||
@Description
|
||||
public void createRuleChain() {
|
||||
ruleChainName = ENTITY_NAME;
|
||||
String ruleChainName = ENTITY_NAME;
|
||||
|
||||
sideBarMenuView.ruleChainsBtn().click();
|
||||
ruleChainsPage.openCreateRuleChainView();
|
||||
ruleChainsPage.nameField().sendKeys(ruleChainName);
|
||||
ruleChainsPage.addBtnC().click();
|
||||
ruleChainsPage.refreshBtn().click();
|
||||
this.ruleChainName = ruleChainName;
|
||||
|
||||
Assert.assertNotNull(ruleChainsPage.entity(ruleChainName));
|
||||
Assert.assertTrue(ruleChainsPage.entity(ruleChainName).isDisplayed());
|
||||
}
|
||||
|
||||
@Test(priority = 10, groups = "smoke", enabled = false)
|
||||
@Test(priority = 10, groups = "smoke")
|
||||
@Description
|
||||
public void createRuleChainWithDescription() {
|
||||
ruleChainName = ENTITY_NAME;
|
||||
String ruleChainName = ENTITY_NAME;
|
||||
|
||||
sideBarMenuView.ruleChainsBtn().click();
|
||||
ruleChainsPage.openCreateRuleChainView();
|
||||
@ -82,6 +83,7 @@ public class CreateRuleChainTest extends AbstractDriverBaseTest {
|
||||
ruleChainsPage.descriptionAddEntityView().sendKeys(ENTITY_NAME);
|
||||
ruleChainsPage.addBtnC().click();
|
||||
ruleChainsPage.refreshBtn().click();
|
||||
this.ruleChainName = ruleChainName;
|
||||
ruleChainsPage.entity(ENTITY_NAME).click();
|
||||
ruleChainsPage.setHeaderName();
|
||||
|
||||
|
||||
@ -61,8 +61,9 @@ public class OpenRuleChainTest extends AbstractDriverBaseTest {
|
||||
@Test(priority = 10, groups = "smoke")
|
||||
@Description
|
||||
public void openRuleChainByRightCornerBtn() {
|
||||
ruleChainName = ENTITY_NAME;
|
||||
String ruleChainName = ENTITY_NAME;
|
||||
testRestClient.postRuleChain(EntityPrototypes.defaultRuleChainPrototype(ENTITY_NAME));
|
||||
this.ruleChainName = ruleChainName;
|
||||
|
||||
sideBarMenuView.ruleChainsBtn().click();
|
||||
ruleChainsPage.openRuleChainBtn(ruleChainName).click();
|
||||
@ -77,8 +78,9 @@ public class OpenRuleChainTest extends AbstractDriverBaseTest {
|
||||
@Test(priority = 10, groups = "smoke")
|
||||
@Description
|
||||
public void openRuleChainByViewBtn() {
|
||||
ruleChainName = ENTITY_NAME;
|
||||
testRestClient.postRuleChain(EntityPrototypes.defaultRuleChainPrototype(ENTITY_NAME));
|
||||
String ruleChainName = ENTITY_NAME;
|
||||
testRestClient.postRuleChain(EntityPrototypes.defaultRuleChainPrototype(ruleChainName));
|
||||
this.ruleChainName = ruleChainName;
|
||||
|
||||
sideBarMenuView.ruleChainsBtn().click();
|
||||
ruleChainsPage.entity(ruleChainName).click();
|
||||
|
||||
@ -57,8 +57,9 @@ public class RuleChainEditMenuTest extends AbstractDriverBaseTest {
|
||||
@Test(priority = 10, groups = "smoke")
|
||||
@Description
|
||||
public void changeName() {
|
||||
testRestClient.postRuleChain(defaultRuleChainPrototype(ENTITY_NAME));
|
||||
String name = "Changed";
|
||||
testRestClient.postRuleChain(defaultRuleChainPrototype(ENTITY_NAME));
|
||||
ruleChainName = name;
|
||||
|
||||
sideBarMenuView.ruleChainsBtn().click();
|
||||
ruleChainsPage.notRootRuleChainsNames().get(0).click();
|
||||
@ -69,7 +70,6 @@ public class RuleChainEditMenuTest extends AbstractDriverBaseTest {
|
||||
ruleChainsPage.doneBtnEditView().click();
|
||||
ruleChainsPage.setHeaderName();
|
||||
String nameAfter = ruleChainsPage.getHeaderName();
|
||||
ruleChainName = name;
|
||||
|
||||
Assert.assertNotEquals(nameBefore, nameAfter);
|
||||
Assert.assertEquals(name, nameAfter);
|
||||
|
||||
@ -57,11 +57,11 @@ public class SortByNameTest extends AbstractDriverBaseTest {
|
||||
@Description
|
||||
public void specialCharacterUp(String ruleChainName) {
|
||||
testRestClient.postRuleChain(defaultRuleChainPrototype(ruleChainName));
|
||||
this.ruleChainName = ruleChainName;
|
||||
|
||||
sideBarMenuView.ruleChainsBtn().click();
|
||||
ruleChainsPage.sortByNameBtn().click();
|
||||
ruleChainsPage.setRuleChainName(0);
|
||||
this.ruleChainName = ruleChainName;
|
||||
|
||||
Assert.assertEquals(ruleChainsPage.getRuleChainName(), ruleChainName);
|
||||
}
|
||||
@ -82,28 +82,24 @@ public class SortByNameTest extends AbstractDriverBaseTest {
|
||||
ruleChainsPage.setRuleChainName(2);
|
||||
String thirdRuleChain = ruleChainsPage.getRuleChainName();
|
||||
|
||||
boolean firstEquals = firstRuleChain.equals(ruleChainSymbol);
|
||||
boolean secondEquals = secondRuleChain.equals(ruleChainNumber);
|
||||
boolean thirdEquals = thirdRuleChain.equals(ruleChain);
|
||||
|
||||
testRestClient.deleteRuleChain(getRuleChainByName(ruleChain).getId());
|
||||
testRestClient.deleteRuleChain(getRuleChainByName(ruleChainNumber).getId());
|
||||
testRestClient.deleteRuleChain(getRuleChainByName(ruleChainSymbol).getId());
|
||||
|
||||
Assert.assertTrue(firstEquals);
|
||||
Assert.assertTrue(secondEquals);
|
||||
Assert.assertTrue(thirdEquals);
|
||||
Assert.assertEquals(firstRuleChain, ruleChainSymbol);
|
||||
Assert.assertEquals(secondRuleChain, ruleChainNumber);
|
||||
Assert.assertEquals(thirdRuleChain, ruleChain);
|
||||
}
|
||||
|
||||
@Test(priority = 10, groups = "smoke", dataProviderClass = DataProviderCredential.class, dataProvider = "nameForSort")
|
||||
@Description
|
||||
public void specialCharacterDown(String ruleChainName) {
|
||||
testRestClient.postRuleChain(defaultRuleChainPrototype(ruleChainName));
|
||||
this.ruleChainName = ruleChainName;
|
||||
|
||||
sideBarMenuView.ruleChainsBtn().click();
|
||||
ruleChainsPage.sortByNameDown();
|
||||
ruleChainsPage.setRuleChainName(ruleChainsPage.allNames().size() - 1);
|
||||
this.ruleChainName = ruleChainName;
|
||||
|
||||
Assert.assertEquals(ruleChainsPage.getRuleChainName(), ruleChainName);
|
||||
}
|
||||
@ -125,16 +121,12 @@ public class SortByNameTest extends AbstractDriverBaseTest {
|
||||
ruleChainsPage.setRuleChainName(lastIndex - 2);
|
||||
String thirdRuleChain = ruleChainsPage.getRuleChainName();
|
||||
|
||||
boolean firstEquals = firstRuleChain.equals(ruleChainSymbol);
|
||||
boolean secondEquals = secondRuleChain.equals(ruleChainNumber);
|
||||
boolean thirdEquals = thirdRuleChain.equals(ruleChain);
|
||||
|
||||
testRestClient.deleteRuleChain(getRuleChainByName(ruleChain).getId());
|
||||
testRestClient.deleteRuleChain(getRuleChainByName(ruleChainNumber).getId());
|
||||
testRestClient.deleteRuleChain(getRuleChainByName(ruleChainSymbol).getId());
|
||||
|
||||
Assert.assertTrue(firstEquals);
|
||||
Assert.assertTrue(secondEquals);
|
||||
Assert.assertTrue(thirdEquals);
|
||||
Assert.assertEquals(firstRuleChain, ruleChainSymbol);
|
||||
Assert.assertEquals(secondRuleChain, ruleChainNumber);
|
||||
Assert.assertEquals(thirdRuleChain, ruleChain);
|
||||
}
|
||||
}
|
||||
@ -58,12 +58,12 @@ public class SortByTimeTest extends AbstractDriverBaseTest {
|
||||
public void sortByTimeDown() {
|
||||
String ruleChain = ENTITY_NAME;
|
||||
testRestClient.postRuleChain(defaultRuleChainPrototype(ruleChain));
|
||||
ruleChainName = ruleChain;
|
||||
|
||||
sideBarMenuView.ruleChainsBtn().click();
|
||||
ruleChainsPage.setSort();
|
||||
String firstListElement = ruleChainsPage.getSort().get(ruleChainsPage.getSort().size() - 1);
|
||||
String lastCreated = ruleChainsPage.createdTime().get(0).getText();
|
||||
ruleChainName = ruleChain;
|
||||
|
||||
Assert.assertEquals(firstListElement, lastCreated);
|
||||
Assert.assertNotNull(ruleChainsPage.createdTimeEntity(ruleChain, lastCreated));
|
||||
@ -74,13 +74,13 @@ public class SortByTimeTest extends AbstractDriverBaseTest {
|
||||
public void sortByTimeUp() {
|
||||
String ruleChain = ENTITY_NAME;
|
||||
testRestClient.postRuleChain(defaultRuleChainPrototype(ruleChain));
|
||||
ruleChainName = ruleChain;
|
||||
|
||||
sideBarMenuView.ruleChainsBtn().click();
|
||||
ruleChainsPage.sortByTimeBtn().click();
|
||||
ruleChainsPage.setSort();
|
||||
String firstListElement = ruleChainsPage.getSort().get(ruleChainsPage.getSort().size() - 1);
|
||||
String lastCreated = ruleChainsPage.createdTime().get(ruleChainsPage.createdTime().size() - 1).getText();
|
||||
ruleChainName = ruleChain;
|
||||
|
||||
Assert.assertEquals(firstListElement, lastCreated);
|
||||
Assert.assertNotNull(ruleChainsPage.createdTimeEntity(ruleChain, lastCreated));
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user