Error in WDIO Chai/ Cucumber testsuite after updating chromedriver: #wdio/runner: TypeError: hooks.map is not a function at Obj.executeHooksWithArgs - selenium-chromedriver

I'm working on Wdio-Chai-Cucumber based e2e-testsuite that ran fine untill I had to update the chromedriver.
This is my stack:
"devDependencies": {
"#types/chai": "^4.2.13",
"#types/cucumber": "^6.0.1",
"#types/node": "^14.11.8",
"#types/webdriverio": "^5.0.0",
"#wdio/cli": "6.6.2",
"#wdio/cucumber-framework": "^6.10.6",
"#wdio/local-runner": "6.6.2",
"#wdio/spec-reporter": "6.8.1",
"#wdio/sync": "6.10.4",
"chai": "^4.2.0",
"chromedriver": "90.0.1",
"cucumber": "^7.0.0-rc.0",
"cucumber-html-reporter": "5.2.0",
"del-cli": "^3.0.1",
"eslint": "^7.10.0",
"wdio-chromedriver-service": "^7.1.0",
"wdio-cucumber-parallel-execution": "^3.6.14",
"wdio-cucumberjs-json-reporter": "2.0.2",
"wdio-docker-service": "^3.1.2"
},
"dependencies": {
"ts-node": "^9.0.0",
"typescript": "^4.0.3"
},
After updating the projects chromedriver from v90 to v98 I get the following error when I run "yarn run test"
#wdio/runner: TypeError: hooks.map is not a function at Object.executeHooksWithArgs
There is a log-message indicating that both cucumber#6.0.5 and cucumber#7.0.0-rc.0 have moved to #cucumber/cucumber, so I tried
yarn remove cucumber
yarn remove #types/cucumber
yarn add -D #cucumber/cucumber
But I still get the same error message when trying to run the test, like nothing has changed. What am I doing wrong?

Related

Error: "Package firebase-functions has been ignored because it contains invalid configuration" - only occurs on Mac M1, not on Windows

When I try to build my react native app in both android and ios on my Mac M1, I get this error.....it does not occur when I build on Windows:
Package firebase-functions has been ignored because it contains invalid configuration. Reason: Package subpath './package.json' is not defined by "exports" in /Users/..../node_modules/firebase-functions/package.json
I took a look into my node modules folder, and at there is indeed a package.json file at the path node_modules/firebase-functions
Below is my package.json
"dependencies": {
"#react-native-community/geolocation": "^2.0.2",
"#react-native-community/masked-view": "^0.1.11",
"#react-native-community/push-notification-ios": "^1.10.1",
"#react-native-firebase/app": "^14.5.1",
"#react-native-firebase/auth": "^14.5.1",
"#react-native-firebase/database": "^14.5.1",
"#react-native-firebase/storage": "^14.5.1",
"#react-native-google-signin/google-signin": "^7.2.2",
"#react-native-picker/picker": "^2.3.1",
"#sentry/react-native": "^3.3.0",
"firebase-functions": "^3.20.1",
"flow": "^0.2.3",
"flow-bin": "^0.173.0",
"prop-types": "^15.8.1",
"react": "17.0.2",
"react-native": "0.67.0",
"react-native-background-timer": "^2.4.1",
"react-native-crypto-js": "^1.0.0",
"react-native-elements": "^3.4.2",
"react-native-fbsdk": "^3.0.0",
"react-native-form-validator": "^0.5.1",
"react-native-fs": "^2.19.0",
"react-native-gesture-handler": "^2.3.0",
"react-native-gifted-chat": "^0.16.3",
"react-native-google-places-autocomplete": "^2.4.1",
"react-native-image-crop-picker": "^0.37.3",
"react-native-maps": "^0.30.1",
"react-native-permissions": "^3.3.0",
"react-native-phone-number-input": "^2.1.0",
"react-native-push-notification": "^8.1.1",
"react-native-reanimated": "^1.13.4",
"react-native-safe-area-context": "^4.1.2",
"react-native-screens": "^3.13.1",
"react-native-sound": "^0.11.2",
"react-native-switch": "^1.5.1",
"react-native-vector-icons": "^9.1.0",
"react-navigation": "^4.4.4",
"react-navigation-stack": "^2.10.4",
"react-navigation-tabs": "^2.11.2",
"react-redux": "^7.2.6",
"redux": "^4.1.2",
"redux-thunk": "^2.4.1",
"symbol-observable": "^4.0.0",
"twitter-lite": "^1.1.0"
},
When handling node packages please ensure the following steps:
Remove package-lock.json - if this file originated using a different OS there is a chance that some dependencies are installed with wrong configuration
Manually remove node_modules folder - in order to remove current setup (it may include wrong installation of several modules)
Reinstall using npm install - this should re-create package-lock.json file as well as relevant deendencies for current OS
My personal tip: add package-lock.json to git.ignore file in order to prevent wrong setup when project moves from one developer (using some OS) to a different developer (which may use a different OS)

Webdriver IO - Error: Command "printPage" is not yet implemented

Unable to use printPage and I also get the same error for savePDF
await browser.url('https://stackoverflow.com/')
await browser.printPage()
Results in:
Error: Command "printPage" is not yet implemented
at Browser.retries (D:\Code\Repositories\auto-browse\node_modules\devtools\build\devtoolsdriver.js:90:34)
at Browser.wrapCommandFn (D:\Code\Repositories\auto-browse\node_modules\#wdio\utils\build\shim.js:131:38)
at Browser.<anonymous> (D:\Code\Repositories\auto-browse\node_modules\#wdio\utils\build\shim.js:270:24)
at makePuzzle (D:\Code\Repositories\auto-browse\index.js:153:19)
at runMicrotasks (<anonymous>)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async D:\Code\Repositories\auto-browse\index.js:183:5
package.json
"devDependencies": {
"#babel/core": "^7.15.8",
"#babel/preset-env": "^7.15.8",
"#babel/register": "^7.15.3",
"#wdio/cli": "^7.16.2",
"#wdio/local-runner": "^7.16.2",
"#wdio/mocha-framework": "^7.16.1",
"#wdio/spec-reporter": "^7.16.1",
"chromedriver": "^95.0.0",
"wdio-chromedriver-service": "^7.2.2"
},
"dependencies": {
"#wdio/selenium-standalone-service": "^7.16.3",
"cors": "^2.8.5",
"express": "^4.17.1",
"xlsx": "^0.17.3"
}
Any ideas? I thought it might have been because Chrome is on version 95xxxx and chromedriver was on 94xxx but I sill get the same issue after deleting Node Modules and reinstalling with the above dependencies.

How to fix: Error while executing ssh://git#github.com/ethereumjs/ethereumjs-abi.git

I am working with Material UI and React and while on my Windows and Ubuntu the app runs ok, on my colleagues Mac and Ubuntu the compiler gives this error:
npm ERR! Error while executing:
npm ERR! /usr/bin/git ls-remote -h -t ssh://git#github.com/ethereumjs/ethereumjs-abi.git
The only dependency I thought it was related to was ethereumjs which I removed because actually it wasn't needed, but the problem persists.
These are the dependencies:
"dependencies": {
"#emotion/react": "^11.4.0",
"#emotion/styled": "^11.3.0",
"#ethersproject/providers": "^5.4.1",
"#material-ui/core": "^5.0.0-beta.0",
"#material-ui/icons": "^5.0.0-beta.0",
"#material-ui/styled-engine-sc": "^5.0.0-beta.0",
"#material-ui/styles": "^4.11.4",
"#testing-library/jest-dom": "^5.12.0",
"#testing-library/react": "^11.2.7",
"#testing-library/user-event": "^12.8.3",
"#walletconnect/web3-provider": "^1.4.1",
"#web3-react/core": "^6.1.9",
"#web3-react/injected-connector": "^6.0.7",
"flag-icon-css": "^3.5.0",
"i18next": "^20.3.1",
"i18next-browser-languagedetector": "^6.1.1",
"i18next-http-backend": "^1.2.6",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react-i18next": "^11.10.0",
"react-router-dom": "^5.2.0",
"react-scripts": "4.0.3",
"react-stepper-horizontal": "^1.0.11",
"styled-components": "^5.3.0",
"web-vitals": "^1.1.2",
"web3": "^1.3.6"
},
Any idea why this happens?
This could be due to ethereumjs-abi dependency which needs to be downloaded in ssh mode where the repo is cloned using https.
As a fix, Adding github identity with ssh-add solves the issue.
ssh-add -K <path to private key>
$ ssh-add -K ~/.ssh/github
Identity added: /Users/abc/.ssh/github

Can't compile assets with Gulp

Every tutorial or doc I find says that I should do something like this:
var elixir = require('laravel-elixir');
elixir.config.assetsPath = 'themes/ei/assets/src';
elixir.config.publicPath = 'themes/ei/assets/'
elixir(function(mix) {
mix.sass('style.scss');
mix.scripts('main.js');
});
But when I run gulp from the command line I get:
AssertionError [ERR_ASSERTION]: Task function must be specified
at Gulp.set [as _setTask] (/home/andrew/Development/eiweb/node_modules/undertaker/lib/set-task.js:10:3)
at Gulp.task (/home/andrew/Development/eiweb/node_modules/undertaker/lib/task.js:13:8)
at Object.<anonymous> (/home/andrew/Development/eiweb/node_modules/laravel-elixir/dist/tasks/recipes/default.js:30:6)
at Module._compile (internal/modules/cjs/loader.js:816:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:827:10)
at Module.load (internal/modules/cjs/loader.js:685:32)
at Function.Module._load (internal/modules/cjs/loader.js:620:12)
at Module.require (internal/modules/cjs/loader.js:723:19)
at require (internal/modules/cjs/helpers.js:14:16)
at requireDir (/home/andrew/Development/eiweb/node_modules/require-dir/index.js:123:33)
My package.json file includes:
"dependencies": {
"gulp": "^4.0.2",
"laravel-elixir": "^6.0.0-18"
}
...and I have gulp-cli installed global.
What am I missing?
This issue occurs because of version issue gulp 4 has different signature for the task and laravel-elixir uses old signature of gulp 3 so it will cause error.
Best case would be to move https://laravel-mix.com as its based on webpack so it support more functionalities. also laravel-mix syntax is similar so its plus point.
For laravel-mix create this pacjage package.json file in root. or user latest from [ https://github.com/laravel/laravel ] public repo.
{
"private": true,
"scripts": {
"dev": "npm run development",
"development": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js",
"watch": "npm run development -- --watch",
"watch-poll": "npm run watch -- --watch-poll",
"hot": "cross-env NODE_ENV=development node_modules/webpack-dev-server/bin/webpack-dev-server.js --inline --hot --config=node_modules/laravel-mix/setup/webpack.config.js",
"prod": "npm run production",
"production": "cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --no-progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js"
},
"devDependencies": {
"axios": "^0.18",
"bootstrap": "^4.1.0",
"cross-env": "^5.1",
"jquery": "^3.2",
"laravel-mix": "^4.0.7",
"lodash": "^4.17.5",
"popper.js": "^1.12",
"resolve-url-loader": "^2.3.1",
"sass": "^1.15.2",
"sass-loader": "^7.1.0",
"vue": "^2.5.17",
"vue-template-compiler": "^2.6.10"
}
}
Create webpack.mix.js in your root
const mix = require('laravel-mix');
// change theme path according to your need.
const themePath = 'themes/rainlab-bonjour';
mix.options({
publicPath: themePath + '/assets/compiled/'
})
// change script name and path according to your need.
mix.js(themePath + '/assets/src/main.js', 'main.js')
.sass(themePath + '/assets/src/main.scss', 'main.css');
Commands [ you can use this command with yarn or npm (I am using yarn)], you can read more info here. [ https://laravel-mix.com/docs/4.0/workflow ]
yarn watch -> it will watch files and compile files then generate compiled out-put in publicPath directory. in our case files will be.
themes/rainlab-bonjour/assets/compiled/main.js
themes/rainlab-bonjour/assets/compiled/main.css
Now you can just include them in theme using 'assets/compiled/main.js'|theme OctoberCms filter.
if you have any doubts please comment.

Unable to run npm install successfully due to karma: none was installed

I have package.json file in which following devDependencies are mentioned:
{ "name": "tabs-torico",
"version": "1.0.0",
"dependencies": {},
"devDependencies": {
"grunt": "~0.4.2",
"grunt-angular-templates": "~0.5.1",
"grunt-autoprefixer": "~0.4.0",
"grunt-cli": "~0.1.11",
"grunt-concurrent": "~0.4.1",
"grunt-connect-proxy": "~0.1.7",
"grunt-contrib-clean": "~0.5.0",
"grunt-contrib-compass": "~0.6.0",
"grunt-contrib-concat": "~0.3.0",
"grunt-contrib-connect": "~0.5.0",
"grunt-contrib-copy": "~0.4.1",
"grunt-contrib-cssmin": "~0.7.0",
"grunt-contrib-htmlmin": "~0.1.3",
"grunt-contrib-jshint": "~0.7.1",
"grunt-contrib-uglify": "~0.2.0",
"grunt-contrib-watch": "^0.5.3",
"grunt-karma": "~0.6.2",
"grunt-newer": "~0.5.4",
"grunt-ngmin": "~0.0.2",
"grunt-protractor-runner": "~0.2.1",
"grunt-rev": "~0.1.0",
"grunt-usemin": "~2.0.0",
"jasmine-core": "^2.6.2",
"jshint-stylish": "~0.1.3",
"karma": "^0.10.10",
"karma-chrome-launcher": "^0.1.12",
"karma-html2js-preprocessor": "~0.1.0",
"karma-jasmine": "^0.1.6",
"karma-ng-html2js-preprocessor": "~0.1.0",
"karma-ng-scenario": "~0.1.0",
"karma-requirejs": "~0.2.1",
"karma-script-launcher": "~0.1.0",
"load-grunt-tasks": "~0.2.0",
"phantomjs": "^2.1.7",
"phantomjs-prebuilt": "^2.1.14",
"protractor": "~0.18.1",
"requirejs": "~2.1.10",
"time-grunt": "~0.2.1"
},
"engines": {
"node": ">=0.8.0"
},
"scripts": {
"test": "grunt test"
}
}
Now when I run npm install gives me the following error:
npm WARN optional SKIPPING OPTIONAL DEPENDENCY:
fsevents#github:pipobscure/fseve
nts#7dcdf9fa3f8956610fd6f69f72c67bace2de7138
(node_modules\chokidar\node_modules
\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for
fsevents#
0.2.1: wanted {"os":"darwin","arch":"any"} (current:
{"os":"win32","arch":"x64"}
)
npm WARN karma#0.10.10 requires a peer of karma-coffee-preprocessor#~0.1.0
but none was installed.
npm WARN karma#0.10.10 requires a peer of karma-firefox-launcher#~0.1.0 but
none was installed.
npm WARN karma#0.10.10 requires a peer of karma-phantomjs-launcher#~0.1.0
but none was installed.
Will running npm install install all the dependencies mentioned in the package.json or do I need to install jasmine-core and karma-jasmine separately?
npm install installs all the dependencies specified in your package.json. You should find the in your node_modules folder.
It's the problem with your version of karma.
In the package.json file includes the following line instead of the current line of karma.
"karma": "^0.11.14"
Also, it is important to note that if you are using karma-chrome-launcher
you need to include that as well in your package.json file as the new version of karma doesn't come with it.
So include the following line as well.
"karma-chrome-launcher": "^0.1.2"
I hope this will solve your problem.