自動化 UI 測試工具:Viff

jopen 9年前發布 | 16K 次閱讀 Viff 測試工具

Viff 測試框架,它可以不同環境(developing, staging, production)和瀏覽器下的 Web 頁面的視覺差異。

示例

Checkout viff-examples repository for more examples, including:

  1. Tiny CSS difference
  2. Chart difference
  3. Content difference
  4. Partial difference
  5. Event Handling
  6. Responsive
  7. Multiple browsers
  8. Multiple Environments
  9. Browserstack
  10. Programmable
  11. Using Viff Server (beta)

示例代碼:

var Viff = require('viff');var viff = new Viff('http://localhost:4444/wd/hub');

viff.takeScreenshot('firefox', 'http://localhost:3000', '/path1', function (bufferImg) 
{  /* buffer of images */  });
// partial of web pages
viff.takeScreenshot('firefox', 'http://localhost:3000', ['path1', '#css-selecor'], 
function (bufferPartialImg) {});
// responsive of web pages
function size(width) {  return function (driver) {
    driver.setWindowSize(width, 600 /* any height*/);
  };
}

viff.takeScreenshot('firefox', 'http://localhost:3000', ['path', size(1024)], 
function (bufferImg) {});
// Q promiseviff.takeScreenshot('firefox', 'http://localhost:3000', ['path', size(1024)])
  .done(function (bufferImg) 
{    /* generate image here */
  })
  .catch(function (err) 
{    /* handle err here */
  })
// using browser
stackviff = new Viff('http://hub.browserstack.com/wd/hub');
viff.takeScreenshot({  'browserName' : 'iPhone',  'platform' : 'MAC',  
'device' : 'iPhone 5',  'browserstack.user': /* your name */,  
'browserstack.key': /* your key */}, 
'http://www.google.com', 'path1', function (bufferImg) {});

自動化 UI 測試工具:Viff

項目主頁:http://www.baiduhome.net/lib/view/home/1433901774801

 本文由用戶 jopen 自行上傳分享,僅供網友學習交流。所有權歸原作者,若您的權利被侵害,請聯系管理員。
 轉載本站原創文章,請注明出處,并保留原始鏈接、圖片水印。
 本站是一個以用戶分享為主的開源技術平臺,歡迎各類分享!