cancel
Showing results for 
Search instead for 
Did you mean: 

OPA Test: headless run error

12-11-2017 11:06 AM
xyla Participant
1134 views 2 comments Go to solution
0 Likes
SAP Managed Tags
Subscribe

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

0 Likes

Accepted Solutions (1)

Accepted Solutions (1)

xyla
Participant
0 Likes

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 %>"
                }
            },

Answers (1)

Answers (1)

Former Member
0 Likes

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