gemini-testing / gemini

💀💀💀[DEPRECATED] Use hermione
https://github.com/gemini-testing/hermione
MIT License
1.5k stars 149 forks source link

Cannot launch browser chrome: Could not calibrate. (MacOs) #753

Open bjornicus opened 7 years ago

bjornicus commented 7 years ago

Following the basic example in the readme does not work for me because of chrom calibration failing. If I disable calibration it seems to work as expected.

Output of gemini --version: 4.18.1

Contents of .gemini.js file:

module.exports = {
    rootUrl: 'http://yandex.ru',
    gridUrl: 'http://127.0.0.1:4444/wd/hub',

    browsers: {
        chrome: {
            desiredCapabilities: {
                browserName: 'chrome'
            }
        }
    }
};

Test source code:

gemini.suite('yandex-search', (suite) => {
    suite.setUrl('/')
        .setCaptureElements('.home-logo')
        .capture('plain');
});

Command used to run the test:

gemini test --reporter flat --reporter html

Expected behaviour: A chrome window should open, load the yandex.ru page, and generate a test report

Actual behavior: A chrome window opens with a solid green background, waits for some time, and then closes. The command line shows the message:

annot launch browser chrome:
Could not calibrate. This could be due to calibration page has failed to open properly.
Total: 1 Passed: 0 Failed: 1 Skipped: 0 Retries: 0
Your HTML report is here: file:///Users/bjorn/test/gemini-report/index.html

simply adding calibrate: false, to the gemini.js file makes it work. Here is the updated contents:

module.exports = {
    rootUrl: 'http://yandex.ru',
    gridUrl: 'http://127.0.0.1:4444/wd/hub',
    calibrate: false,

    browsers: {
        chrome: {
            desiredCapabilities: {
                browserName: 'chrome'
            }
        }
    }
};
rostik404 commented 7 years ago

Hello! In my case everything works fine without calibrate: false. Which version of chrome and selenium-standalone do you use?

bjornicus commented 7 years ago

chrome is Version 56.0.2924.87 (64-bit) selenium is from https://www.npmjs.com/package/selenium-standalone, which looks to have installed Selenium build info: version: '3.0.1', revision: '1969d75'

On Fri, Mar 24, 2017 at 8:38 AM, Rostislav Shtanko <notifications@github.com

wrote:

Hello! In my case everything works fine without calibrate: false. Which version of chrome and selenium-standalone do you use?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/gemini-testing/gemini/issues/753#issuecomment-289058295, or mute the thread https://github.com/notifications/unsubscribe-auth/ABpiGAtCY_wxjqsq2T99ZMJ2dDbLcOJLks5ro-OEgaJpZM4Ml8n5 .

sipayRT commented 7 years ago

I tried to reproduce it on latest gemini and selenium-standalone versions (macOS) - all works fine for me

varya commented 7 years ago

I have the same issue. Can it be OS thing? I switched to Sierra and it's not working. Last time I've been on my old Mac, it used to launch normally.

varya commented 7 years ago

Ah, my issue it a little bit different, but I suppose related

✘ 2.1 plain [chrome-latest]
Cannot launch browser chrome-latest:
undefined while parsing file: /Users/varya/WebDev/SC5/sc5-styleguide-visualtest/node_modules/gemini/lib/browser/client-scripts/gemini.js.
sipayRT commented 7 years ago

I have the same issue. Can it be OS thing?

I will try it on latest version. But it works on Sierra 10.12.3

Ah, my issue it a little bit different, but I suppose related

it can be because of switching node version. You can try to reinstall gemini

bruk1977 commented 7 years ago

I'm getting this error intermittently on build machines... @sipayRT any update? @varya @bjornicus any workaround you came up with?

campside commented 6 years ago

Same issue here... I'm making it as written in https://github.com/gemini-testing/gemini, selenium-standalone: Selenium build info: version: '3.6.0', revision: '6fbf3ec767'.

Chrome launches but there is a green screen then it fails with: Cannot launch browser chrome: Could not calibrate. This could be due to calibration page has failed to open properly.

Chrome is latest for today: 62.0.3202.94, also tried with ChromeDriver 2.33.506106, gemini: 5.0.0-alpha.10, MacOs 10.12.6, node v6.10.2

with firefox I get: Cannot launch browser firefox: Not a PNG.

sipayRT commented 6 years ago

@campside try to check your page on client errors - while calibration gemini should execute js-scripts on the page. So if there will be some client errors calibration will fail

lahmatiy commented 6 years ago

The same issue. Even adding calibrate: false to the config doesn't help:

gemini: 5.0.0-alpha.10 Mac OS 10.12.6 node v9.2.0

sipayRT commented 6 years ago

can you provide your error log without calibration? Also it will be helpful to get your page which you tried to open.

miripiruni commented 6 years ago

👀

varya commented 6 years ago

Now I have the same issue as @lahmatiy. Green Chrome, adding calibrate: false does not work. What kind of logs you need to investigate this?

sipayRT commented 6 years ago

What kind of logs you need to investigate this?

all logs from terminal, pls.

varya commented 6 years ago

In terminal, it is like that

  𝒟ℴ gulp test:visual
[13:23:44] Failed to load external module @babel/register
[13:23:44] Requiring external module babel-register
[13:23:49] Using gulpfile ~/WebDev/SC5/Elisa/pattern-library/gulpfile.babel.js
(node:43088) [DEP0022] DeprecationWarning: os.tmpDir() is deprecated. Use os.tmpdir() instead.
[13:23:49] Starting 'dev:options'...
[13:23:49] Finished 'dev:options' after 245 μs
[13:23:49] Starting 'test:visual'...
Test server:  selenium
Test resolution:  1250x730
Test server: SELENIUM
Selenium started
✘ 1.1.1.1 plain [chrome-latest]
Cannot launch browser chrome-latest:
Could not calibrate. This could be due to calibration page has failed to open properly.
sipayRT commented 6 years ago

can you share your test page? so I can check your problem locally

varya commented 6 years ago

I will try to develop the test page later today.

lahmatiy commented 6 years ago

I had the issue on example from the readme, nothing extra. Try to install gemini and its deps on a clean macOS and run a basic test from readme. I suppose the problem is about using https, but not sure. I switched off calibration and it doesn't help. Later I opened yandex.ru in Chrome (since this host is used in example test), and some time later I tried to run the test again and it worked as expected. However calibration still doesn't work. I suppose something additional should be done to make genimi works.

hisivasankar commented 6 years ago

I am facing this issue as well.

MacOS: 10.13.4

package.json

    "chromedriver": "^2.36.0",
    "gemini": "^5.6.2",
    "selenium-standalone": "^6.14.0"

.gemini.js

const puppeteer = require("puppeteer");

module.exports = {
  rootUrl: "http://localhost:9000",
  gridUrl: "http://127.0.0.1:5678/wd/hub",
  calibrate: true,
  windowSize: "1920x1080",
  screenshotsDir: "./tests/screenshots",
  browsers: {
    chrome: {
      desiredCapabilities: {
        browserName: "chrome",
        chromeOptions: {
          args: ["--no-sandbox", "--headless"],
          binary: puppeteer.executablePath()
        }
      }
    }
  },
  system: {
    debug: true,
    plugins: {
      "html-reporter/gemini": {
        enabled: true,
        path: "gemini-reports/",
        defaultView: "all"
      }
    }
  }
};

Error message:

message: Cannot launch browser chrome: Could not calibrate. This could be due to calibration page has failed to open properly. stack: GeminiError: Cannot launch browser chrome: Could not calibrate. This could be due to calibration page has failed to open properly. at initSession.then.then.then.then.then.catch (/All-Data/SAC/orca-react-ui/node_modules/gemini/lib/browser/new-browser.js:115:31) at runCallback (timers.js:794:20) at tryOnImmediate (timers.js:752:5) at processImmediate [as _immediateCallback] (timers.js:729:5) From previous event: at NewBrowser.launch (/All-Data/SAC/orca-react-ui/node_modules/gemini/lib/browser/new-browser.js:107:19) at Object.start (/All-Data/SAC/orca-react-ui/node_modules/gemini/lib/browser-pool.js:13:37) at BasicPool.getBrowser (/All-Data/SAC/orca-react-ui/node_modules/gemini-core/lib/browser-pool/basic-pool.js:26:33) at CachingPool.getBrowser (/All-Data/SAC/orca-react-ui/node_modules/gemini-core/lib/browser-pool/caching-pool.js:43:40) at LimitedPool._newBrowser (/All-Data/SAC/orca-react-ui/node_modules/gemini-core/lib/browser-pool/limited-pool.js:77:36) at LimitedPool._getBrowser (/All-Data/SAC/orca-react-ui/node_modules/gemini-core/lib/browser-pool/limited-pool.js:62:25) at LimitedPool.getBrowser (/All-Data/SAC/orca-react-ui/node_modules/gemini-core/lib/browser-pool/limited-pool.js:34:21) at PerBrowserLimitedPool.getBrowser (/All-Data/SAC/orca-react-ui/node_modules/gemini-core/lib/browser-pool/per-browser-limited-pool.js:26:39) at BrowserAgent.getBrowser (/All-Data/SAC/orca-react-ui/node_modules/gemini-core/lib/browser-agent/index.js:17:27) at RegularSuiteRunner._doRun (/All-Data/SAC/orca-react-ui/node_modules/gemini/lib/runner/suite-runner/regular-suite-runner.js:29:35) at RegularSuiteRunner.run (/All-Data/SAC/orca-react-ui/node_modules/gemini/lib/runner/suite-runner/suite-runner.js:18:21) at InsistentSuiteRunner._doRun (/All-Data/SAC/orca-react-ui/node_modules/gemini/lib/runner/suite-runner/insistent-suite-runner.js:27:34) at InsistentSuiteRunner.run (/All-Data/SAC/orca-react-ui/node_modules/gemini/lib/runner/suite-runner/suite-runner.js:18:21) at BrowserRunner._runSuite (/All-Data/SAC/orca-react-ui/node_modules/gemini/lib/runner/browser-runner/index.js:71:23) at _.filter.map (/All-Data/SAC/orca-react-ui/node_modules/gemini/lib/runner/browser-runner/index.js:37:29) at arrayMap (/All-Data/SAC/orca-react-ui/node_modules/lodash/lodash.js:631:23) at Function.map (/All-Data/SAC/orca-react-ui/node_modules/lodash/lodash.js:9546:14) at interceptor (/All-Data/SAC/orca-react-ui/node_modules/lodash/lodash.js:16983:35) From previous event: at TestsRunner.run (/All-Data/SAC/orca-react-ui/node_modules/gemini/lib/runner/index.js:42:14) at getTests.then (/All-Data/SAC/orca-react-ui/node_modules/gemini/lib/gemini.js:190:31) From previous event: at Gemini._run (/All-Data/SAC/orca-react-ui/node_modules/gemini/lib/gemini.js:179:14) at _exec (/All-Data/SAC/orca-react-ui/node_modules/gemini/lib/gemini.js:89:38) at _init.then (/All-Data/SAC/orca-react-ui/node_modules/gemini/lib/gemini.js:97:40) From previous event: at Gemini._exec (/All-Data/SAC/orca-react-ui/node_modules/gemini/lib/gemini.js:97:29) at Gemini.test (/All-Data/SAC/orca-react-ui/node_modules/gemini/lib/gemini.js:89:21) at /All-Data/SAC/orca-react-ui/node_modules/gemini/lib/cli/index.js:106:30 at Command.program.command.allowUnknownOption.option.description.on.action (/All-Data/SAC/orca-react-ui/node_modules/gemini/lib/cli/index.js:47:69) at Command.listener (/All-Data/SAC/orca-react-ui/node_modules/commander/index.js:315:8) at emitTwo (events.js:126:13) at Command.emit (events.js:214:7) at Command.parseArgs (/All-Data/SAC/orca-react-ui/node_modules/commander/index.js:651:12) at Command.parse (/All-Data/SAC/orca-react-ui/node_modules/commander/index.js:474:21) at Object.exports.run (/All-Data/SAC/orca-react-ui/node_modules/gemini/lib/cli/index.js:80:13) at Object.<anonymous> (/All-Data/SAC/orca-react-ui/node_modules/gemini/bin/gemini:33:25) at Module._compile (module.js:652:30) at Object.Module._extensions..js (module.js:663:10) at Module.load (module.js:565:32) at tryModuleLoad (module.js:505:12) at Function.Module._load (module.js:497:3) at Function.Module.runMain (module.js:693:10) at startup (bootstrap_node.js:188:16) at bootstrap_node.js:609:3

hisivasankar commented 6 years ago

I found more info that might help.

Gemini is not working fine in following cases:

Investigation details: I compared the resolution of the image taken in my mac(without calibration and calibration doesn't work in mac display in my case).

Right now solved my issue by just using an external monitor and enabling calibrate: true so that everything works fine in travis

Pomax commented 5 years ago

I'm seeing this happen in Windows 10 Pro x64 as well, using today's gemini, and selenium-standalone 6.15.4 with the example files as indicated over on https://github.com/gemini-testing/gemini

Chrome gets launched in "used for testing" mode, but it ends up showing a green screen, with the URL bar showing that it's trying to load data:, followed by about:blank, instead of loading the url indicated in the .gemini.js configuration.