Protractor tests are not running in gitlab-ci after Google Chrome updated to version 75 yesterday. It worked before the update. What happened? - docker-compose

I am running a scheduled job in gitlab to run protractor tests on an application on Google Chrome. These tests were working along nicely until yesterday June 04, 2019 where Google updated chrome from version 74 to version 75. Now I am getting a "W/launcher - Ignoring uncaught error WebDriverError: Unable to parse new session response" issue since the update.
This is run on the gitlab ci environment. I don't use webdriver-manager, my team really needs me to use docker-compose to create a selenium grid. I don't really know where to start fixing this issue.
test:
stage: test
before_script:
- apk add py-pip
- pip install --upgrade pip
- pip install docker-compose==1.23.2
- docker login -u $DOCKERHUB_REGISTRY_USER -p $DOCKERHUB_REGISTRY_PASSWORD
- echo "//registry.npmjs.org/:_authToken=\${NPM_HAVENBUILD_AUTH_TOKEN}" > .npmrc
- npm install
- npm config set unsafe-perm true
- npm install -g protractor
- npm install -g protractor-console
- npm config set unsafe-perm falsesh
- ./node_modules/.bin/gulp
script:
- docker-compose up -d
- docker-compose scale chrome=2
- ./node_modules/.bin/protractor TestFiles/HConf.js --suite client --testname Happy_Path --env uat
This is the error I am getting:
[19:53:28] I/hosted - Using the selenium server at http://docker-dind:4444/wd/hub
[19:53:28] W/launcher - Ignoring uncaught error WebDriverError: Unable to parse new session response: {
"value": {
"sessionId": "d8b6ab9a6e301a943203e8af49aec285",
"capabilities": {
"acceptInsecureCerts": false,
"browserName": "chrome",
"browserVersion": "75.0.3770.80",
"chrome": {
"chromedriverVersion": "75.0.3770.8 (681f24ea911fe754973dda2fdc6d2a2e159dd300-refs\u002fbranch-heads\u002f3770#{#40})",
"userDataDir": "\u002ftmp\u002f.com.google.Chrome.zQzfpf"
},
"goog:chromeOptions": {
"debuggerAddress": "localhost:46326"
},
"networkConnectionEnabled": false,
"pageLoadStrategy": "normal",
"platformName": "linux",
"proxy": {
},
"setWindowRect": true,
"strictFileInteractability": false,
"timeouts": {
"implicit": 0,
"pageLoad": 300000,
"script": 30000
},
"unhandledPromptBehavior": "dismiss and notify",
"webdriver.remote.sessionid": "d8b6ab9a6e301a943203e8af49aec285"
}
}
}
[19:53:28] E/launcher - BUG: launcher exited with 1 tasks remaining
I am suppose to have the protractor tests run insead of this after it starts using the selenium server.
Does anyone know what the issue is?

Related

VUE 3 - weird failure in VS Code and flawless running in console

Windows 10 x64 21H2, running my project in VS Code and get the following error:
Executing task: npm run serve
> weatherApp#0.1.0 serve
> vue-cli-service serve
Browserslist: caniuse-lite is outdated. Please run:
npx browserslist#latest --update-db
Why you should do it regularly: https://github.com/browserslist/browserslist#browsers-data-updating
INFO Starting development server...
10% building 2/5 modules 3 active ...babel-loader\lib\index.js!C:\tmp\VUE Weather apps\VUE 3 - weather\node_modules\eslint-loader\index.js??ref--13-0!C:\tmp\VUE Weather apps\VUE 3 - weather\src\main.jsError: error:0308010C:digital envelope routines::unsupported
at new Hash (node:internal/crypto/hash:71:19)
at Object.createHash (node:crypto:133:10)
at module.exports (C:\tmp\VUE Weather apps\VUE 3 -
...
{
opensslErrorStack: [ 'error:03000086:digital envelope routines::initialization error' ],
library: 'digital envelope routines',
reason: 'unsupported',
code: 'ERR_OSSL_EVP_UNSUPPORTED'
}
Node.js v18.12.1
* The terminal process "C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -Command npm run serve" terminated with exit code: 1.
* Terminal will be reused by tasks, press any key to close it.
At the same time the command npm run serve runs w/o any issues. What should I do to have the issue fixed?

Commands not recognised in GitHub Action Mocha tests

My unit tests pass when run locally. When executed by a GitHub Action when a branch is committed, this action
on:
push:
branches:
- '*' # matches every branch that doesn't contain a '/'
- '*/*' # matches every branch containing a single '/'
- '**' # matches every branch
- '!master' # excludes master
workflow_dispatch:
inputs:
build:
description: Unit tests
type: boolean
required: true
default: "true"
jobs:
build:
strategy:
matrix:
os: [windows-latest]
# os: [ubuntu-latest, windows-latest, macos-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout#v2
- name: Install Node.js
uses: actions/setup-node#v1
with:
node-version: 16.x
- run: npm install
- run: npm i gulp gulp-cli -g
if: runner.os == 'MacOS'
- run: gulp
- run: xvfb-run -a npm test
if: runner.os == 'Linux'
- run: npm test
if: runner.os != 'Linux'
basically runs npm test.
When I do that locally, it works fine:
npm test
> vscode-print#0.9.25 test
> node ./out/test/runTest.js
Debugger listening on ws://127.0.0.1:63067/252bd7f9-c748-45b4-b9e6-8ba21e9fc909
For help, see: https://nodejs.org/en/docs/inspector
Debugger attached.
Found existing install in C:\Users\Peter\source\vsc-print\.vscode-test\vscode-win32-x64-archive-1.68.1. Skipping download
[16792:0704/000228.095:ERROR:node_bindings.cc(286)] Most NODE_OPTIONs are not supported in packaged apps. See documentation for more details.
[16792:0704/000228.095:ERROR:node_bindings.cc(286)] Most NODE_OPTIONs are not supported in packaged apps. See documentation for more details.
[main 2022-07-03T14:02:28.455Z] update#ctor - updates are disabled by the environment
[main 2022-07-03T14:02:29.679Z] Starting extension host with pid 32 (fork() took 15 ms).
Loading development extension at c:\Users\Peter\source\vsc-print
Decryption failed
Print Extension Test Suite
✔ Check platform browser launch command on win32 (200ms)
✔ Check platform alternate browser launch command on win32 (112ms)
✔ Print active editor (304ms)
Could not find the language 'jsonc', did you forget to load/include a language module?
✔ Print folder (812ms)
4 passing (2s)
[main 2022-07-03T14:02:32.887Z] Extension host with pid 32 exited with code: 0, signal: null.
Exit code: 0
Done
Waiting for the debugger to disconnect...
When the Action runs it, this is the output.
Downloaded VS Code into D:\a\vsc-print\vsc-print\.vscode-test\vscode-win32-x64-archive-1.68.1
[main 2022-07-03T13:06:32.496Z] update#ctor - updates are disabled by the environment
workbench#open()
[main 2022-07-03T13:06:37.868Z] Calling fork to start extension host...
[main 2022-07-03T13:06:37.879Z] Starting extension host with pid 776 (fork() took 11 ms).
IExtensionHostStarter.start() took 42 ms.
Loading development extension at d:\a\vsc-print\vsc-print
Print Extension Test Suite
1) Check platform browser launch command on win32
Error: 4 tests failed.
2) Check platform alternate browser launch command on win32
3) Print active editor
at d:\a\vsc-print\vsc-print\out\test\suite\index.js:25:27
4) Print folder
at done (d:\a\vsc-print\vsc-print\node_modules\mocha\lib\mocha.js:1009:7)
0 passing (518ms)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
4 failing
1) Print Extension Test Suite
Check platform browser launch command on win32:
Error: command 'extension.test.browserLaunchCommand' not found
at v._tryExecuteCommand (vscode-file://vscode-app/d:/a/vsc-print/vsc-print/.vscode-test/vscode-win32-x64-archive-1.68.1/resources/app/out/vs/workbench/workbench.desktop.main.js:1706:3532)
at v.executeCommand (vscode-file://vscode-app/d:/a/vsc-print/vsc-print/.vscode-test/vscode-win32-x64-archive-1.68.1/resources/app/out/vs/workbench/workbench.desktop.main.js:1706:3414)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
2) Print Extension Test Suite
Check platform alternate browser launch command on win32:
Error: command 'extension.test.browserLaunchCommand' not found
at v._tryExecuteCommand (vscode-file://vscode-app/d:/a/vsc-print/vsc-print/.vscode-test/vscode-win32-x64-archive-1.68.1/resources/app/out/vs/workbench/workbench.desktop.main.js:1706:3532)
at v.executeCommand (vscode-file://vscode-app/d:/a/vsc-print/vsc-print/.vscode-test/vscode-win32-x64-archive-1.68.1/resources/app/out/vs/workbench/workbench.desktop.main.js:1706:3414)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
3) Print Extension Test Suite
Print active editor:
Error: command 'extension.test.flags' not found
at v._tryExecuteCommand (vscode-file://vscode-app/d:/a/vsc-print/vsc-print/.vscode-test/vscode-win32-x64-archive-1.68.1/resources/app/out/vs/workbench/workbench.desktop.main.js:1706:3532)
at v.executeCommand (vscode-file://vscode-app/d:/a/vsc-print/vsc-print/.vscode-test/vscode-win32-x64-archive-1.68.1/resources/app/out/vs/workbench/workbench.desktop.main.js:1706:3414)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
4) Print Extension Test Suite
Print folder:
Error: command 'extension.test.flags' not found
at v._tryExecuteCommand (vscode-file://vscode-app/d:/a/vsc-print/vsc-print/.vscode-test/vscode-win32-x64-archive-1.68.1/resources/app/out/vs/workbench/workbench.desktop.main.js:1706:3532)
at v.executeCommand (vscode-file://vscode-app/d:/a/vsc-print/vsc-print/.vscode-test/vscode-win32-x64-archive-1.68.1/resources/app/out/vs/workbench/workbench.desktop.main.js:1706:3414)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
[main 2022-07-03T13:06:41.294Z] Waiting for extension host with pid 776 to exit.
[main 2022-07-03T13:06:41.330Z] Extension host with pid 776 exited with code: 1, signal: null.
Exit code: 1
Failed
Failed to run tests
Error: Process completed with exit code 1.
The unrecognised commands are registered near the start of the extension's activation event.
export function activate(context: vscode.ExtensionContext) {
let ecmPrint = vscode.workspace.getConfiguration("print", null).editorContextMenuItemPosition,
etmButton = vscode.workspace.getConfiguration("print", null).editorTitleMenuButton,
disposable: vscode.Disposable;
vscode.commands.executeCommand("setContext", "ecmPrint", ecmPrint);
vscode.commands.executeCommand("setContext", "etmButton", etmButton);
context.subscriptions.push(vscode.workspace.onDidChangeConfiguration(checkConfigurationChange));
context.subscriptions.push(vscode.commands.registerCommand("extension.print", printCommand));
context.subscriptions.push(vscode.commands.registerCommand("extension.printFolder", printFolderCommand));
context.subscriptions.push(vscode.commands.registerCommand("extension.test.flags", () => testFlags));
context.subscriptions.push(vscode.commands.registerCommand("extension.test.browserLaunchCommand", PrintSession.getLaunchBrowserCommand));
This suggests that the activation method hasn't been called. Is this something I must do explicitly?
I just noticed this up the top of extension.test.ts
// You can import and use all API from the 'vscode' module
// as well as import your extension to test it
import * as vscode from 'vscode';
// import * as myExtension from '../../extension';
That's not how my tests are written. They don't import the code and call it directly, they assume the extension is installed and active and they use registered commands. Some of these commands were added for no other reason than to allow fine grained unit tests.
The problem I describe in the question is due to the fact that the extension is not installed.
Discovering I can import from the extension doesn't solve all the problems. Some of my tests are strictly speaking integration tests. They need the extension to be installed and active.
To meet that requirement, gulp package rather than gulp build will also produce the VSIX. The only real trick is obtaining the VSIX name to install it in the test environment.
const vsixName = fs.readdirSync(extensionDevelopmentPath)
.filter(p => path.extname(p) === ".vsix")
.sort((a, b) => a < b ? 1 : a > b ? -1 : 0)[0];
const launchArgs = [
path.resolve(__dirname, '../../src/test/test-docs'),
"--install-extension",
vsixName
];
A hybrid approach is possible; some of the registered commands exist only for use by unit tests. These could be junked in favour of direct calls.

Git, Conda - How can I "pip install git+git:<repo>" with the new Git policies in place?

I have this conda yml file for installing dependencies and creating a new conda env.
conda_env.yml forked from https://github.com/MishaLaskin/rad:
name: rad
channels:
- defaults
dependencies:
- python=3.6
- pytorch
- torchvision
- cudatoolkit=9.2
- absl-py
- pyparsing
- pillow=6.1
- pip:
- termcolor
- git+git://github.com/deepmind/dm_control.git
- git+git://github.com/1nadequacy/dmc2gym.git
- tb-nightly
- imageio
- imageio-ffmpeg
- torchvision
- scikit-image
- tabulate
I try to run conda env create --file conda_env.yml and here's the stack trace I get.
Collecting package metadata (repodata.json): done
Solving environment: done
Installing pip dependencies: - Ran pip subprocess with arguments:
['/home/dyung6/anaconda3/envs/rad/bin/python', '-m', 'pip', 'install', '-U', '-r', '/home/dyung6/rad/condaenv.835gcx7g.requirements.txt']
Pip subprocess output:
Collecting git+git://github.com/deepmind/dm_control.git (from -r /home/dyung6/rad/condaenv.835gcx7g.requirements.txt (line 2))
Cloning git://github.com/deepmind/dm_control.git to /tmp/pip-req-build-nc4w5hv8
Pip subprocess error:
Running command git clone -q git://github.com/deepmind/dm_control.git /tmp/pip-req-build-nc4w5hv8
fatal: remote error:
The unauthenticated git protocol on port 9418 is no longer supported.
Please see https://github.blog/2021-09-01-improving-git-protocol-security-github/ for more information.
WARNING: Discarding git+git://github.com/deepmind/dm_control.git. Command errored out with exit status 128: git clone -q git://github.com/deepmind/dm_control.git /tmp/pip-req-build-nc4w5hv8 Check the logs for full command output.
ERROR: Command errored out with exit status 128: git clone -q git://github.com/deepmind/dm_control.git /tmp/pip-req-build-nc4w5hv8 Check the logs for full command output.
failed
CondaEnvException: Pip failed
Seems like the new git policies block you from doing this. Is there anyway around this?
As #torek points out, and the documentation directed to in the error message explains, the git:// protocol has phased out on GitHub. Switch to using https://, i.e., in this case:
- pip:
- git+https://github.com/deepmind/dm_control.git
- git+https://github.com/1nadequacy/dmc2gym.git
...

Using multi capabilities is throwing error

I want to run my tests on multiple browsers and I am using the multi capabilities option to run my protractor tests in browser-stack.
Here is my protractor config file I am using
exports.config = {
specs: [
'./src/**/*.e2e-spec.ts'
],
commonCapabilities: {
browserstackUser: browserstackCredentials.user,
browserstackKey: browserstackCredentials.key,
'browserstack.debug': true,
'browserstack.local': true
},
multiCapabilities: [{
browserName: 'chrome',
os: 'Windows',
os_version: '10'
}, {
os: 'OS X',
os_version: 'High Sierra',
browserName: 'Safari'
}],
SELENIUM_PROMISE_MANAGER: false,
directConnect: false,
connectionRetryCount: 3,
connectionRetryTimeout: 90000,
framework: 'jasmine'
}
I get the below error when I run tests with these config. Below is the error I get :
[chrome #01-0] [13:46:12] E/local - Error code: 135
[chrome #01-0] [13:46:12] E/local - Error message: No update-config.json found. Run 'webdriver-manager update' to download binaries.
[chrome #01-0] [13:46:12] E/local - Error: No update-config.json found. Run 'webdriver-manager update' to download binaries.
[chrome #01-0] at Local.addDefaultBinaryLocs_ (/home/travis/build/xxx/xxx/node_modules/protractor/built/driverProviders/local.js:39:23)
[chrome #01-0] at Local.setupDriverEnv (/home/travis/build/xxx/xxx/node_modules/protractor/built/driver.
Appreciate your help.
Thanks
Looking at the error, The problem is with the file update-config.json
The behavior of protractor is to first locate the update-config.json file which contains the information of chrome/firefox driver. If the same file is not located then Protractor throw the same error as you mentioned.
Fix - Go to the path node_modules\protractor\node_modules\webdriver-manager\bin which contains webdriver-manager file.
use >> node webdriver-manager update
This command will create selenium folder under the path " your project directory\node_modules\protractor\node_modules\webdriver-manager.
Once selenium folder is created then it will have version of chrome/gecko drivers and update-config.json file.

Travis-CI build - PhantomJS error preventing QUnit tests from running

I have a repository with a simple js function and a QUnit test. I have attempted to integrate it with Travis-CI using a grunt task. Everything works fine locally but PhantomJS throws an error during the build process preventing my tests from running.
Build:
https://travis-ci.org/DaveKingsnorth/ciSandbox/builds/40909225
Repo:
https://github.com/DaveKingsnorth/ciSandbox
//.travis.yaml
language: node_js
node_js:
- "0.11"
before_install: npm install -g grunt-cli
install: npm install
// Gruntfile.js
module.exports = function(grunt) {
grunt.initConfig({
pkg: '<json:package.json>',
qunit: {
src: ['test/**/*.html']
}
});
grunt.loadNpmTasks('grunt-contrib-qunit');
grunt.registerTask('test', ['qunit']);
grunt.registerTask('default', 'qunit');
};
Error:
Testing test/index.html
PhantomJS threw an error:ERROR
/home/travis/build/DaveKingsnorth/ciSandbox/node_modules/grunt-contrib-qunit/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/bin/phantomjs: 4: /home/travis/build/DaveKingsnorth/ciSandbox/node_modules/grunt-contrib-qunit/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/bin/phantomjs: Syntax error: Unterminated quoted string 0 [ '/home/travis/build/DaveKingsnorth/ciSandbox/node_modules/grunt-contrib-qunit/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/bin/phantomjs: 4: /home/travis/build/DaveKingsnorth/ciSandbox/node_modules/grunt-contrib-qunit/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/bin/phantomjs: Syntax error: Unterminated quoted string' ]
Warning: PhantomJS exited unexpectedly with exit code 2. Use --force to continue.
Aborted due to warnings.
The command "npm test" exited with 0.
Done. Your build exited with 0.