Exemplo n.º 1
0
 void Size(IWebElement checkbox)
 {
     checkbox.Click();
     bool passed = true;
     var newPage = new LaptopPage();
     newPage.getResults();
     var temp = newPage.getKey(checkbox);
     Cons.log(temp);
     var key = newPage.parseSize(temp);
     foreach (var item in newPage.results)
     {
         var value = newPage.parseSize(newPage.getShort(item));
         if ( value[0] < key[0] || value[0] > key[1])
         {
             passed = false;
             Cons.log("Results mismatch");
             Cons.log("Test passed: " + passed.ToString() + "\n");
             throw new Exception();
         }
     }
     Cons.log("Test passed: " + passed.ToString() + "\n");
     newPage.BtnReset.Click();
 }
Exemplo n.º 2
0
 void Manufacturer(IWebElement checkbox)
 {
     Cons.log(DateTime.Now.ToString() + " Performing TestManufacturer");
     checkbox.Click();
     bool passed = true;
     var newPage = new LaptopPage();
     newPage.getResults();
     var key = newPage.getKey(checkbox);
     Cons.log(key);
     foreach (var item in newPage.results)
     {
         var value = newPage.getManufacturer(item);
         if (!value.Contains(key))
         {
             passed = false;
             Cons.log("Results mismatch");
             Cons.log("Test passed: " + passed.ToString() + "\n");
             throw new Exception();
         }
     }
     Cons.log("Test passed: " + passed.ToString() + "\n");
     newPage.BtnReset.Click();
 }
Exemplo n.º 3
0
 void Resolution(IWebElement checkbox, bool exact = true)
 {
     page.ResolutionAll.Click();
     checkbox.Click();
     bool passed = true;
     var newPage = new LaptopPage();
     newPage.getResults();
     var temp = newPage.getKey(checkbox);
     Cons.log(temp);
     int key = newPage.getResolution(temp);
     foreach (var item in newPage.results)
     {
         var value = newPage.getResolution(newPage.getShort(item));
         if (exact ? (value != key) : (value <= key))
             {
                 passed = false;
                 Cons.log("Results mismatch");
                 Cons.log("Test passed: " + passed.ToString() + "\n");
                 throw new Exception();
             }
     }
     Cons.log("Test passed: " + passed.ToString() + "\n");
     newPage.BtnReset.Click();
 }
Exemplo n.º 4
0
 void CPU(IWebElement checkbox)
 {
     page.CPUAll.Click();
     checkbox.Click();
     bool passed = true;
     var newPage = new LaptopPage();
     newPage.getResults();
     var key = newPage.getKey(checkbox);
     Cons.log(key);
     foreach (var item in newPage.results)
     {
         if (!newPage.CPUCheck(newPage.getShort(item), key))
         {
             passed = false;
             Cons.log("Results mismatch");
             Cons.log("Test passed: " + passed.ToString() + "\n");
             throw new Exception();
         }
     }
     Cons.log("Test passed: " + passed.ToString() + "\n");
     newPage.BtnReset.Click();
 }