Facebook
From Eratic Stork, 4 Years ago, written in Plain Text.
Embed
Download Paste or View Raw
Hits: 87
  1. @RunWith(value = Parameterized.class)
  2. public class CellListTest {
  3.     CellListPage page = new CellListPage();
  4.     private String category;
  5.  
  6.     public CellListTest(String category) {
  7.         this.category = category;
  8.     }
  9.  
  10.     @Parameterized.Parameters
  11.     public static Object[] data() {
  12.         return new Object[] { "Family" , "Friends", "Coworkers", "Businesses", "Contacts" };
  13.     }
  14.  
  15.     @BeforeClass
  16.     public static void preconditions() {
  17.         String URL = getProperty("cell_list_page");
  18.         open(URL);
  19.     }
  20.  
  21.     @Test
  22.     public void addManyUsers() {
  23.         int previousCount = page.getCount();
  24.  
  25.         page.fillFirstName("RandomUser")
  26.                 .fillLastName("RandomLastName")
  27.                 .selectCategory(category)
  28.                 .fillBirthday("January 1, 2021")
  29.                 .fillAddress("Novosibirsk")
  30.                 .createContact();
  31.  
  32.         int actualCount = page.getCount();
  33.  
  34.         assertEquals(previousCount + 1, actualCount);
  35.     }
  36.  
  37.     @Test
  38.     public void addOneUser() {
  39.         page.fillFirstName("RandomUser")
  40.                 .fillLastName("RandomLastName")
  41.                 .selectCategory("randomValue")
  42.                 .fillBirthday("January 1, 2021")
  43.                 .fillAddress("Novosibirsk")
  44.                 .createContact();
  45.     }