Skip to Content

OPA Test: headless run error

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)
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Best Answer
    Dec 11, 2017 at 03:14 PM

    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 %>"
                    }
                },
    
    
    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Feb 27 at 08:22 PM

    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

    Add comment
    10|10000 characters needed characters exceeded