CSS被搞砸了,而在saucelabs运行量角器

问题描述:

我有,我用量角器写了端到端测试一个角度应用程序。我在 saucelabs 运行我的测试。这里是我的网页,例如一个小问题。如果我的浏览器未最大化的一些CSS的被搞砸了(我确实打算在未来解决这个),这肯定会失败,我的一些测试用例我写的。

I have a angular application for which I wrote e2e tests using protractor. I am running my tests on saucelabs. There is a small issue with my page for instance. If my browser is not maximized some of the css gets messed up ( i do plan on fixing this in the future), and this would definitely fail some of my test cases that I wrote.

但是,如果我的浏览器最大化一切都是完美的。现在的问题是,当我在,即使浏览器的外观(根据saucelab截图)我的CSS看起来很乱因为它在我的浏览器不是本地最大化最大化saucelabs运行我的测试。

However if my browser is maximized everything is perfect. Now the issue is when I run my test on saucelabs even though the browser looks maximized (according to saucelab screenshots) my css looks messed up as it does when my browser is not maximized locally.

我做了一些研究,发现我可以使用

I did some research and found that I can use

browser.driver.manage().window().maximize();

但在我的情况,因为浏览器已经最大化我需要增加屏幕分辨率还是什么?请提供建议

However in my case since browser is already maximized do i need to increase screen resolution or something? Please provide suggestions

其实,我觉得你可能是通过提高分辨率的建议,自己回答了这个问题。因为你的本地计算机上的分辨率可能比saucelabs机器不同。我不知道什么是默认分辨率,但这里有不同的分辨率,您可以指定。

I actually think you probably answered this question yourself by the suggestion of increasing the resolution. Because the resolution on your local machine is probably different than the saucelabs machine. I'm not sure what the default resolution but here are the different resolutions you can specify.

我可能会匹配您知道与窗口的最大化沿着你的机器上工作的分辨率。

I would probably match the resolution that you know works on your machine along with the maximizing of the window.

编辑:我加你的配置与分辨率选项

I added your config with the resolution option

exports.config = {
    framework: 'jasmine2',
    sauceUser: 'blahblhablah',
    sauceKey: 'xyzabcdxyzabac',
    capabilities :  {
            screenResolution: "1280x1024",
        },
    multiCapabilities: multiCapabilities,
    specs: ['e2e/main.spec.js'],
    jasmineNodeOpts: {
        showColors: true,
        defaultTimeoutInterval: 30000
    },