小编Thi*_*ili的帖子

Angular 7:单元测试 Jasmine 在移动和 Web 上自动调整窗口大小

我需要编写一个自动化测试用例(茉莉花测试),它将在不同分辨率的 chrome 中运行,用于移动和网络视图 例如,当它在 jasmine 中运行时,它应该自动将窗口大小调整为 W: 375 H: 678 不幸的是,我无法找到解决方案来做到这一点

it('It should set sizes according to mobile', async(() => {

     //below code is not working
     //browser.manage().window().setSize(375, 678);
     let innerHeight = window.innerHeight;
     neither it won't work following code
     window.resizeTo(375, 678);

  }));
Run Code Online (Sandbox Code Playgroud)

karma-jasmine angular angular7

4
推荐指数
1
解决办法
2954
查看次数

标签 统计

angular ×1

angular7 ×1

karma-jasmine ×1