PhantomJS & Jira Software 8 issue


#1

I’m not able to run Phantom JS tests on latest Jira Software 8.0

Every time I go to a board I get “Error: No jira-agile/lib/jquery/inlined-code”
The board won’t render at all.

Is anyone else using PhantomJS?!

Here’s code sample working on Jira 7x

/**
         * Go to rapid board from the manage boards screen using boardLink click
         *
         * @param boardName string
         */
        goToRapidBoard: function (boardName) {
            'use strict';
            casper.echo('\nCalling goToRapidBoard by ' + ex.testName + '\n');
            var boardLink = xpath('//a[@title="Go to this board" and text()="' + boardName + '"]');

            casper.thenOpen(URL.manageBoards, function goToManageBoardsAndClick() {
                //wait for page board name header
                casper.waitForSelector(boardLink, function () {
                    ex.CASPER.capture('goToRapidBoard-'+boardName);
                    casper.test.assertExists(boardLink, 'board title header found');
                    casper.thenClick(boardLink, function () {
                        //wait for the board to load
                        casper.waitForSelector(xpath('//button[@id="board-tools-section-button"]'), function () {
                            casper.waitForSelector(xpath('//*[@id="ghx-pool"] | //*[@id="ghx-plan-group"]'), function () {
                                casper.wait(2000, function() {
                                    ex.CASPER.capture('goToRapidBoard-after');
                                });
                            });
                        });
                    });
                });
            });
        },

#2

@pch I’m sorry to hear that there is a problem with running your tests on JSW 8.0. This might be a problem with board implementation itself, and we will have a look.

PhantomJS is using ancient version of WebKit, and this is something we don’t really support in JIRA.
Did you consider migrating off phantomjs? It is no longer supported: https://github.com/ariya/phantomjs/issues/15344

Consider switching to chrome headless, in particular https://github.com/GoogleChrome/puppeteer is a very good alternative.


#3

@pch I would also recommend moving away from PhantomJS. You can easily switch to headless Chrome (even without puppeteer) in Selenium. If you use WebDriverManager the binaries from Chrome are automatically downloaded and you can use the following logic to bootstrap WebDriver with Chrome:

                WebDriverManager.chromedriver().setup();
                ChromeOptions options = new ChromeOptions();
                options.addArguments("--disable-gpu", "--window-size=1920,1200", "--ignore-certificate-errors", "--whitelisted-ips", "--disable-extensions", "--no-sandbox");
                if (System.getenv("DEBUG") == null || !System.getenv("DEBUG").equals("true")) {
                    options.addArguments("--headless");
                }
                return new ChromeDriver(options);

#4

Thx guys,
I’m already migrating to JEST+Puppeter :wink:

And right Phantom seems to be dead, but it was a great tool.