getgauge / gauge-js

JavaScript language plugin for Gauge
MIT License
81 stars 39 forks source link

Unbale to install Javascript offling plugin provided on windows 10 #260

Closed harimadusumilli closed 4 years ago

harimadusumilli commented 4 years ago

When I click the Zipped file link to download Java script plugin which has been provided for offline installation. The plugin does not download completely. I am able to download the other plugins. The offline plugin specifically provided does not download completely. Attached screen shot

harimadusumilli commented 4 years ago

2Capture

harimadusumilli commented 4 years ago

Capture

nehashri commented 4 years ago

@harimadusumilli I am very sorry for the inconvenience caused. We do not host the nightlies in bintray anymore. However, you can build the offline js runner from source and try using it in your machine. You will need internet to build from source, so please make sure you build it in a machine with internet connectivity. You can refer here to build the offline runner.

We will also do a gauge-js release soon, so that the offline binary is available for download.

harimadusumilli commented 4 years ago

Hello Neha,

Thank you for your response. Is there any tentative time frame when the offline binary will be available ?

My Node version is as below:

C:\Travellers-Learn\Javascript_plugin\gauge-js-2.3.4>node -v v10.15.0

I tried using the documentation as suggested by you above and here is what I did. 1) I obtained the gauge-js-2.3.4. 2) unzipped it 3) changed it to the directory where the package.json file is and opened the command prompt. 4) typed npm install and hit enter at the command prompt.

I got the following output with errors:

C:\Travellers-Learn\Javascript_plugin\gauge-js-2.3.4>npm install

grpc@1.18.0 install C:\Travellers-Learn\Javascript_plugin\gauge-js-2.3.4\node_modules\grpc node-pre-gyp install --fallback-to-build --library=static_library

node-pre-gyp WARN Using needle for node-pre-gyp https download node-pre-gyp WARN Pre-built binaries not installable for grpc@1.18.0 and node@10.15.0 (node-v64 ABI, unknown) (falling back to source compile with node-gyp) node-pre-gyp WARN Hit error socket hang up gyp ERR! configure error gyp ERR! stack Error: Command failed: C:\Users\hadusumi\AppData\Local\Programs\Python\Python37\python.exe -c import sys; print "%s.%s.%s" % sys.version_info[:3]; gyp ERR! stack File "", line 1 gyp ERR! stack import sys; print "%s.%s.%s" % sys.version_info[:3]; gyp ERR! stack ^ gyp ERR! stack SyntaxError: invalid syntax gyp ERR! stack gyp ERR! stack at ChildProcess.exithandler (child_process.js:294:12) gyp ERR! stack at ChildProcess.emit (events.js:182:13) gyp ERR! stack at maybeClose (internal/child_process.js:962:16) gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:251:5) gyp ERR! System Windows_NT 10.0.17763 gyp ERR! command "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" "configure" "--fallback-to-build" "--library=static_library" "--module=C:\Travellers-Learn\Javascript_plugin\gauge-js-2.3.4\node_modules\grpc\src\node\extension_binary\node-v64-win32-x64-unknown\grpc_node.node" "--module_name=grpc_node" "--module_path=C:\Travellers-Learn\Javascript_plugin\gauge-js-2.3.4\node_modules\grpc\src\node\extension_binary\node-v64-win32-x64-unknown" "--napi_version=3" "--node_abi_napi=napi" "--napi_build_version=0" "--node_napi_label=node-v64" gyp ERR! cwd C:\Travellers-Learn\Javascript_plugin\gauge-js-2.3.4\node_modules\grpc gyp ERR! node -v v10.15.0 gyp ERR! node-gyp -v v3.8.0 gyp ERR! not ok node-pre-gyp ERR! build error node-pre-gyp ERR! stack Error: Failed to execute 'C:\Program Files\nodejs\node.exe C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js configure --fallback-to-build --library=static_library --module=C:\Travellers-Learn\Javascript_plugin\gauge-js-2.3.4\node_modules\grpc\src\node\extension_binary\node-v64-win32-x64-unknown\grpc_node.node --module_name=grpc_node --module_path=C:\Travellers-Learn\Javascript_plugin\gauge-js-2.3.4\node_modules\grpc\src\node\extension_binary\node-v64-win32-x64-unknown --napi_version=3 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v64' (1) node-pre-gyp ERR! stack at ChildProcess. (C:\Travellers-Learn\Javascript_plugin\gauge-js-2.3.4\node_modules\grpc\node_modules\node-pre-gyp\lib\util\compile.js:83:29) node-pre-gyp ERR! stack at ChildProcess.emit (events.js:182:13) node-pre-gyp ERR! stack at maybeClose (internal/child_process.js:962:16) node-pre-gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:251:5) node-pre-gyp ERR! System Windows_NT 10.0.17763 node-pre-gyp ERR! command "C:\Program Files\nodejs\node.exe" "C:\Travellers-Learn\Javascript_plugin\gauge-js-2.3.4\node_modules\grpc\node_modules\node-pre-gyp\bin\node-pre-gyp" "install" "--fallback-to-build" "--library=static_library" node-pre-gyp ERR! cwd C:\Travellers-Learn\Javascript_plugin\gauge-js-2.3.4\node_modules\grpc node-pre-gyp ERR! node -v v10.15.0 node-pre-gyp ERR! node-pre-gyp -v v0.12.0 node-pre-gyp ERR! not ok Failed to execute 'C:\Program Files\nodejs\node.exe C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js configure --fallback-to-build --library=static_library --module=C:\Travellers-Learn\Javascript_plugin\gauge-js-2.3.4\node_modules\grpc\src\node\extension_binary\node-v64-win32-x64-unknown\grpc_node.node --module_name=grpc_node --module_path=C:\Travellers-Learn\Javascript_plugin\gauge-js-2.3.4\node_modules\grpc\src\node\extension_binary\node-v64-win32-x64-unknown --napi_version=3 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v64' (1) npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! grpc@1.18.0 install: node-pre-gyp install --fallback-to-build --library=static_library npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the grpc@1.18.0 install script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in: npm ERR! C:\Users\hadusumi\AppData\Roaming\npm-cache_logs\2019-10-21T14_37_39_718Z-debug.log

If you see below, I already have Python installed on my machine with the version below:

C:\Travellers-Learn\Javascript_plugin\gauge-js-2.3.4>py --version Python 3.7.4

Please let me know if you any suggestions or recommendations or if you think this is incorrect, can you please guide me or let me know what needs to be done in order to get this installed successfully.

I am able to use taiko , but would like to use it with the Gauge-JS script plugin. Help is appreciated.

Thanks, Hari

nehashri commented 4 years ago

I tried using the documentation as suggested by you above and here is what I did.

Where did you find this documentation? The steps you followed seems to be incorrect. I would like to fix the documentation.

1) I obtained the gauge-js-2.3.4. 2) unzipped it

Where did you find this zip file?

3) changed it to the directory where the package.json file is and opened the command prompt.

I don't understand what you are trying to do here.

@harimadusumilli You need to build the offline runner from source right now.

harimadusumilli commented 4 years ago

Thank you Neha for your response. The above steps 1 and 2 was something I thought should have been done. Thank you for correcting me. I believe, I have misunderstood the documentation.

Cheers!! Hari

harimadusumilli commented 4 years ago

Hi Neha,

If you want me to open another issue, I can do it. But, this is what is happening on my side at this time. I was able to create the offline js zip file package following your instructions. I tried installing it and I am running into the following issues:

C:\Travellers-Learn\Gauge_Taiko>gauge -v Gauge version: 1.0.4 Commit Hash: 3a9a647

Plugins

csharp (0.10.5) dotnet (0.1.2.nightly-2019-02-14) html-report (4.0.7) java (0.6.9) js (2.3.6) screenshot (0.0.1)

C:\Travellers-Learn\Gauge_Taiko>gauge init js Compatible language plugin js is not installed. Installing plugin... Failed to install plugin 'js'. Reason: Invalid plugin. Could not download js-install.json file. Failed to install plugin 'js'. Reason: Invalid plugin. Could not download js-install.json file.

Is there anything else that I should be doing or have I done something that is incorrect ?

Help is appreciated.

nehashri commented 4 years ago

@harimadusumilli Is there any reason you are using an older version of gauge? The JS plugin 2.3.6 does not work with Gauge version 1.0.4. If you update Gauge to the latest release 1.0.6, it should work fine.

harimadusumilli commented 4 years ago

Thank you for your help once again, I believe I am progressing forward little by little. Please bear with me. Here is where I am right now after doing the following:

  1. Upgraded to the Gauge version 1.0.6

  2. Installed the Gauge JavaScript Plugin as below: C:\Tools>gauge install js --file gauge-js-offline-2.3.6.zip audited 704 packages in 3.025s found 0 vulnerabilities Successfully installed plugin 'js' version 2.3.6

  3. Created the Gauge JavaScript Plugin based project Successfully as below:

C:\Travellers-Learn\Gauge_Taiko>gauge init js Initialising Gauge JavaScript project create manifest.json create specs create specs\example.spec create .gitignore create env create env\default create env\default\default.properties Successfully initialized the project. Run specifications with "gauge run specs/".

  1. Tried running the specs using the Gauge command line as below and encountering errors:

C:\Travellers-Learn\Gauge_Taiko>gauge run specs C:\Users\hadusumi\AppData\Roaming\gauge\plugins\js\2.3.6\node_modules\protobufjs\src\root.js:94 throw err; ^

Error: ENOENT: no such file or directory, open 'C:/Users/hadusumi/AppData/Roaming/gauge/plugins/js/2.3.6/gauge-proto/lsp.proto' at Object.openSync (fs.js:439:3) at Object.readFileSync (fs.js:344:35) at fetch (C:\Users\hadusumi\AppData\Roaming\gauge\plugins\js\2.3.6\node_modules\protobufjs\src\root.js:160:34) at Root.load (C:\Users\hadusumi\AppData\Roaming\gauge\plugins\js\2.3.6\node_modules\protobufjs\src\root.js:194:13) at Root.loadSync (C:\Users\hadusumi\AppData\Roaming\gauge\plugins\js\2.3.6\node_modules\protobufjs\src\root.js:235:17) at Object.loadSync (C:\Users\hadusumi\AppData\Roaming\gauge\plugins\js\2.3.6\node_modules\@grpc\proto-loader\build\src\index.js:230:27) at Object. (C:\Users\hadusumi\AppData\Roaming\gauge\plugins\js\2.3.6\src\gauge.js:13:41) at Module._compile (internal/modules/cjs/loader.js:689:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10) at Module.load (internal/modules/cjs/loader.js:599:32) Error ----------------------------------

[Gauge] Failed to start gauge API: Timed out connecting to 127.0.0.1:54237

Get Support ---------------------------- Docs: https://docs.gauge.org Bugs: https://github.com/getgauge/gauge/issues Chat: https://gitter.im/getgauge/chat

Your Environment Information ----------- windows, 1.0.6, 2bc49db csharp (0.10.5), dotnet (0.1.2), html-report (4.0.7), java (0.6.9), js (2.3.6), screenshot (0.0.1)

Please let me know how to resolve this.

Thank you once again for your fantastic help you have offered me till date.

harimadusumilli commented 4 years ago

Hello Gauge Support,

I am following up to know if you have had a chance to look at this issue of mine. Please let me know either ways.

Thanks, Hari

nehashri commented 4 years ago

@harimadusumilli How did you download the gauge-js repository? Did you use git? If so, can you please go to the gauge-js repository and run the following commands?

git submodule init
git submodule update

try installing the offline installer again and try the same steps you ran above. Let me know if this helps.

harimadusumilli commented 4 years ago

Hello Neha,

Yes, we use Git and I cloned the repository and performed the above commands you have suggested.

After doing that I then did the following :

  1. npm install
  2. npm run offlinePackage to build the offline zip installer.

I then copied the offline installer to a different folder on my machine and ran the following command

  1. gauge install js --file gauge-js-.zip

If you see below the Js package is installed successfully.

C:\Travellers-Learn\Gague_updated_Install>gauge -v Gauge version: 1.0.6 Commit Hash: 2bc49db

Plugins

csharp (0.10.5) dotnet (0.1.2.nightly-2019-02-14) html-report (4.0.7) java (0.6.9) js (2.3.6) screenshot (0.0.1) xml-report (0.2.1)

Now when I try to run the following:

C:\Travellers-Learn\Gague_updated_Install>gauge init js Compatible language plugin js is not installed. Installing plugin... Failed to install plugin 'js'. Reason: Invalid plugin. Could not download js-install.json file.

Previously the gauge init js created the project for me and now I am getting the above error.

Is there any other tip you can suggest that I can do.

as I very badly want to make Taiko work with the JavaScript plugin in our organization as I want to make it the goto tool for UI Automation Testing. I have enjoyed using Gauge with DotNetCore and have been able to establish it within our organization.

Thanks, Hari

harimadusumilli commented 4 years ago

This is additional information, I am assuming its missing this folder : C:\Users\hadusumi\AppData\Roaming\gauge\plugins\js\2.3.6

harimadusumilli commented 4 years ago

The above folder 2.3.6 does not have any file(s) in it.

nehashri commented 4 years ago

@harimadusumilli There must have been something wrong when the offline installer was built. It clearly hasn't installed properly. Just to see where the problem is, can you please copy the contents of the zip file into the 2.3.6 folder? (you need to just copy over the contents inside the zip and not the entire folder). This may work, if this is the issue, let me try to debug and see where the problems is.

List of files you should have inside the 2.3.6 folder:

README.md         index.bat         node_modules      skel
debug.bat         index.js          package-lock.json src
gauge-proto       js.json           package.json
harimadusumilli commented 4 years ago

Thank you Neha, the above suggestion of yours seemed to have worked. I was able to run the example.spec that Gauge by default creates 👍 . I tried using Taiko with Gauge and I am now running into the following error. I have installed Taiko successfully as I am able to use the command Taiko and create the .js scripts from the REPL.

The below is my spec file:

Travelers Home Page Test

This is an executable specification file. This file follows markdown syntax. Every heading in this file denotes a scenario. Every bulleted point denotes a step.

To execute this specification, run

gauge specs

Test to ensure Travelers Home page loads

Implementation file is as below: "use strict"; var assert = require("assert"); const {openBrowser,goto,closeBrowser} = require('taiko');

// Insert step text below as first parameter step("Launch Travelers Website with the following url ", async function(myurl) { //await goto("https://www.travelers.com/index"); await openBrowser(); await goto(myurl); });

step("Key in zipcode and click on Start Quote", async function(arg0) { throw 'Unimplemented Step'; }); step("The Page with caption should display", async function(arg0) { throw 'Unimplemented Step'; });

When I run the Gauge command from the command line as below: gauge run specs\maintravelers.spec --verbose

I get the error that its not able to find Taiko and the errors are as given below: Total time taken: 88ms PS C:\Travellers-Learn\Gauge_Taiko> gauge run specs\maintravelers.spec --verbose Unable to require module 'taiko' in C:\Travellers-Learn\Gauge_Taiko\tests\maintravelers_implementation.js Error: Cannot find module 'taiko' at Function.Module._resolveFilename (internal/modules/cjs/loader.js:581:15) at Function.Module._load (internal/modules/cjs/loader.js:507:25) at Module.require (internal/modules/cjs/loader.js:637:17) at C:\Users\hadusumi\AppData\Roaming\gauge\plugins\js\2.3.6\src\req-manager.js:36:18 at Req.load (C:\Users\hadusumi\AppData\Roaming\gauge\plugins\js\2.3.6\src\req-manager.js:47:5) at fn (C:\Users\hadusumi\AppData\Roaming\gauge\plugins\js\2.3.6\src\req-manager.js:58:20) at C:\Travellers-Learn\Gauge_Taiko\tests\maintravelers_implementation.js:3:41 at Script.runInContext (vm.js:107:20) at Object.runInContext (vm.js:285:6) at VM.run (C:\Users\hadusumi\AppData\Roaming\gauge\plugins\js\2.3.6\src\vm.js:59:8) Error executing tests\maintravelers_implementation.js C:\Travellers-Learn\Gauge_Taiko\tests\maintravelers_implementation.js:3 const {openBrowser,goto,closeBrowser} = require('taiko'); ^

TypeError: Cannot destructure property openBrowser of 'undefined' or 'null'. at C:\Travellers-Learn\Gauge_Taiko\tests\maintravelers_implementation.js:3:41 at Script.runInContext (vm.js:107:20) at Object.runInContext (vm.js:285:6) at VM.run (C:\Users\hadusumi\AppData\Roaming\gauge\plugins\js\2.3.6\src\vm.js:59:8) at VM.runFile (C:\Users\hadusumi\AppData\Roaming\gauge\plugins\js\2.3.6\src\vm.js:73:8) at C:\Users\hadusumi\AppData\Roaming\gauge\plugins\js\2.3.6\src\impl-loader.js:13:10 at Array.forEach () PS C:\Travellers-Learn\Gauge_Taiko> gauge run specs\maintravelers.spec --verbose Unable to require module 'taiko' in C:\Travellers-Learn\Gauge_Taiko\tests\maintravelers_implementation.js Error: Cannot find module 'taiko' at Function.Module._resolveFilename (internal/modules/cjs/loader.js:581:15) at Function.Module._load (internal/modules/cjs/loader.js:507:25) at Module.require (internal/modules/cjs/loader.js:637:17) at C:\Users\hadusumi\AppData\Roaming\gauge\plugins\js\2.3.6\src\req-manager.js:36:18 at Req.load (C:\Users\hadusumi\AppData\Roaming\gauge\plugins\js\2.3.6\src\req-manager.js:47:5) at fn (C:\Users\hadusumi\AppData\Roaming\gauge\plugins\js\2.3.6\src\req-manager.js:58:20) at C:\Travellers-Learn\Gauge_Taiko\tests\maintravelers_implementation.js:3:41 at Script.runInContext (vm.js:107:20) at Object.runInContext (vm.js:285:6) at VM.run (C:\Users\hadusumi\AppData\Roaming\gauge\plugins\js\2.3.6\src\vm.js:59:8) Error executing tests\maintravelers_implementation.js C:\Travellers-Learn\Gauge_Taiko\tests\maintravelers_implementation.js:3 const {openBrowser,goto,closeBrowser} = require('taiko'); ^

TypeError: Cannot destructure property openBrowser of 'undefined' or 'null'. at C:\Travellers-Learn\Gauge_Taiko\tests\maintravelers_implementation.js:3:41 at Script.runInContext (vm.js:107:20) at Object.runInContext (vm.js:285:6) at VM.run (C:\Users\hadusumi\AppData\Roaming\gauge\plugins\js\2.3.6\src\vm.js:59:8) at VM.runFile (C:\Users\hadusumi\AppData\Roaming\gauge\plugins\js\2.3.6\src\vm.js:73:8) at C:\Users\hadusumi\AppData\Roaming\gauge\plugins\js\2.3.6\src\impl-loader.js:13:10 at Array.forEach () at Promise (C:\Users\hadusumi\AppData\Roaming\gauge\plugins\js\2.3.6\src\impl-loader.js:10:31) at new Promise () at Object.loadImpl [as load] (C:\Users\hadusumi\AppData\Roaming\gauge\plugins\js\2.3.6\src\impl-loader.js:6:10)

Travelers Home Page Test

Test to ensure Travelers Home page loads

  * Launch Travelers Website with the following url "https://www.travelers.com/index"

C:\Users\hadusumi\AppData\Roaming\gauge\plugins\js\2.3.6\src\executor.js:50 new Test(step.fn, parameters, timeout).run().then( ^

TypeError: Cannot read property 'fn' of undefined at Object.executeStep [as step] (C:\Users\hadusumi\AppData\Roaming\gauge\plugins\js\2.3.6\src\executor.js:50:17) at MessageProcessor.executeStep (C:\Users\hadusumi\AppData\Roaming\gauge\plugins\js\2.3.6\src\message-processor.js:50:26) at MessageProcessor.getResponseFor (C:\Users\hadusumi\AppData\Roaming\gauge\plugins\js\2.3.6\src\message-processor.js:346:40) at ExecutionConnection. (C:\Users\hadusumi\AppData\Roaming\gauge\plugins\js\2.3.6\src\gauge.js:70:21) at ExecutionConnection.emit (events.js:182:13) at Socket.messageHandler (C:\Users\hadusumi\AppData\Roaming\gauge\plugins\js\2.3.6\src\connection.js:20:12) at Socket.emit (events.js:182:13) at addChunk (_stream_readable.js:283:12) at readableAddChunk (_stream_readable.js:264:11) Error ----------------------------------

[Gauge] Connection to runner with Pid 19656 lost. The runner probably quit unexpectedly. Inspect logs for potential reasons. Error : read tcp 127.0.0.1:51034->127.0.0.1:51035: use of closed network connection

Get Support ---------------------------- Docs: https://docs.gauge.org Bugs: https://github.com/getgauge/gauge/issues Chat: https://gitter.im/getgauge/chat

Your Environment Information ----------- windows, 1.0.6, 2bc49db csharp (0.10.5), dotnet (0.1.2), html-report (4.0.7), java (0.6.9), js (2.3.6), screenshot (0.0.1), xml-report (0.2.1)

harimadusumilli commented 4 years ago

Taiko version installed : C:\Travellers-Learn\Gague_updated_Install>taiko -v Version: 1.0.2 (Chromium: 76.0.3803.0) RELEASE

harimadusumilli commented 4 years ago

Hello Gauge Support,

In addition to the above, I have also done this. I have installed taiko in my project folder using the following command npm install --save-dev taiko. It did get installed and when I tried to run using the gauge run specs, I am getting the following error message.

Failed Step: Open Travelers website Specification: specs\testsample.spec:7 Error Message: Error: Timed out Stacktrace: Error: Timed out at Timeout. (C:\Users\hadusumi\AppData\Roaming\gauge\plugins\js\2.3.6\src\test.js:43:23) at ontimeout (timers.js:436:11) at tryOnTimeout (timers.js:300:5) at listOnTimeout (timers.js:263:5) at Timer.processTimers (timers.js:223:10)

shubhamsc commented 4 years ago

@harimadusumilli Try with increasing the test_timeout in Gauge properties file. You can find this property under the env/default/js.properties.

harimadusumilli commented 4 years ago

Hello Shumbham,

Thank you for the suggestion, I increased the time out from 1000 to 3000. I would imagine that this is in milliseconds. The Tests run without any errors. The other question I have is does it by default run in headless mode ? If it has to run in a headful mode ? Is there any setting that I need to do in the Javascript file(s) implementation files.

Thank you all for the fantastic support and help you have been providing all along the way till now.

Hari

zabil commented 4 years ago

For options to run in headful mode and other options you can refer. https://taiko.gauge.org/#openbrowser

harimadusumilli commented 4 years ago

Zabil, Thank you very much.. It works and I am right now in Tears with happiness. Do you guys do any working videos of how you use this framework. If not, I would like to know if I can do some videos and post them on Udemy for free, so that other people can benefit from this.

Thanks, Hari

zabil commented 4 years ago

That's good news :) We have a few basic demo videos. But it will be great if you can make videos about your experience of Gauge and Taiko. Please feel free to reach out to us on our http://gitter.im/getgauge/chat for any help or discuss this.