The problem seems to be karma: `Task :frontendBrow...
# kvision
m
The problem seems to be karma:
Task :frontendBrowserTest FAILED
- /Users/max/IdeaProjects/chess/build/js/node_modules/karma/bin/karma
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:982:15)
at Function.Module._load (internal/modules/cjs/loader.js:864:27)
at Module.require (internal/modules/cjs/loader.js:1044:19)
at require (internal/modules/cjs/helpers.js:77:18)
at Object.<anonymous> (/Users/max/IdeaProjects/chess/build/js/node_modules/braces/index.js:15:17)
at Module._compile (internal/modules/cjs/loader.js:1158:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1178:10)
at Module.load (internal/modules/cjs/loader.js:1002:32)
at Function.Module._load (internal/modules/cjs/loader.js:901:14)
at Module.require (internal/modules/cjs/loader.js:1044:19) {
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':frontendBrowserTest'.
r
Hi
🖖🏻 1
How did you create your project? With Project Wizard? Copied the ktor fullstack template?
m
Project Wizard
r
do you run gradle task from the command line or from IntelliJ?
m
IntelliJ
r
can you try running it from the command line?
m
Give me one sec
r
Some issues were reported when running gradle tasks from IntelIJ. It could be it.
m
I have deleted that test project and now I recreate another one
What's the command to give on terminal?
I don't see the task here anymore
r
./gradlew frontendBrowserTest
m
> Task :frontendBrowserTest FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':frontendBrowserTest'.
> Errors occurred during launch of browser for testing.
- ChromeHeadless
Please make sure that you have installed browsers.
Or change it via
browser {
testTask {
useKarma {
useFirefox()
useChrome()
useSafari()
}
}
}
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at <https://help.gradle.org>
BUILD FAILED in 1m 31s
12 actionable tasks: 12 executed
I think is a problem with headless browser architecture now?
r
It looks so
you can try changing it to Safari
m
I can execute the tests only in CI
Or I can try to use Safari?
BUILD SUCCESSFUL in 24s 12 actionable tasks: 5 executed, 7 up-to-date
I changed in useSafari()
r
do you have Chrome installed in your system?
m
No, but I can install
But I think useChromeHeadless() use a headless version
r
I'm not sure but I think it uses the browser from your system - it just runs it in headless mode
m
This use the browsers
useKarma {
useFirefox()
useChrome()
useSafari()
}
This use headless
Copy code
useKarma {
    useChromeHeadless()
}
What I want to do at this point is to have gradle use the browser locally and headless chrome on CI
r
I think both
useChrome()
and
useChromeheadless()
options are using the browser installed in your system. The first option is running it as normal browser (and the GUI session is required). And the second option is using the headless mode, so can be run on CI. But the builder for CI needs to have chrome installed anyway.
m
You are right. Downloaded and run. Worked!
Thanks a lot
BTW now it works also from IntelliJ
👍 1