Skip to Content
0

OPA Test: headless run error

Dec 11, 2017 at 10:06 AM

50

avatar image

Hi all,

I have some OPA tests, wich are successful if I run them manually in the browser, but fail (some of them) if I run them using a Grunt task and without a browser (headless).

Any idea what the problem could be? Any help would be appreciated!

Thanks,

Szilamér

opa-error.jpg (217.2 kB)
10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

Best Answer
Szilamer Joo Dec 11, 2017 at 03:14 PM
0

The problem was that the OPA tests were made on elements which were dynamic. These elements are rendered only if the browser window is bigger than a certain size.

So the solution is to set a fixed screen size for PhantomJS in the gruntfile, qunit section (page->viewportSize):

qunit: {
            options: {
                '--web-security': 'no', // yes/no
                '--proxy': 'xxxxxx', //your proxy - if you have one
            },
            opa: {
               options: {
                page : {
                    viewportSize : { width: 1920, height: 1080 }
                },
                    urls: [
                        "http://<%= settings.connect.host %>:<%= settings.connect.port %>/test/integration/opaTests.qunit.html"
                    ],
                    // same as qunits timeout 90 seconds since opa test might take a while
                    timeout: "<%= tests.opaTimeout %>"
                }
            },

Share
10 |10000 characters needed characters left characters exceeded
avatar image
Former Member Feb 27 at 08:22 PM
0

how you get the coverage report when you run headless? is is possible to share your code for grunt tasks for qunit and opa?

Thanks

Share
10 |10000 characters needed characters left characters exceeded