Skip to content

Commit

Permalink
Fix taiko version info display (#2729)
Browse files Browse the repository at this point in the history
* Pass the right version info
---------

Signed-off-by: Zabil Cheriya Maliackal <[email protected]>
  • Loading branch information
zabil authored May 30, 2024
1 parent 16182d9 commit b4b6fbc
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 8 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Taiko
##### [Docs](https://docs.taiko.dev) | [API reference](https://docs.taiko.dev/api/reference)
##### [Docs](https://docs.taiko.dev) | [API reference](https://docs.taiko.dev/api/reference)

A Node.js library for testing modern web applications

Expand Down Expand Up @@ -48,7 +48,7 @@ This installs Taiko and the latest version of Chromium browser. We are all set t
Taiko comes with a Recorder that’s a REPL for writing test scripts. You can use Taiko’s JavaScript API to control the browser from the REPL. To launch the REPL type taiko in your favorite terminal application

$ taiko
Version: 0.8.0 (Chromium:76.0.3803.0)
Version: 1.4.0 (Chromium: 126.0.6468.0)
Type .api for help and .exit to quit
>

Expand Down Expand Up @@ -107,7 +107,7 @@ By default Taiko runs the script in headless mode, that means it does not launch
Taiko’s REPL also documents all the API’s. To view all available API’s use the special command `.api`

$ taiko
Version: 0.8.0 (Chromium:76.0.3803.0)
Version: 1.4.0 (Chromium: 126.0.6468.0)
Type .api for help and .exit to quit
> .api
Browser actions
Expand Down Expand Up @@ -191,12 +191,12 @@ Learn more about [Gauge](https://docs.gauge.org)!
### Experimental Firefox Support

#### To launch taiko with firefox:
- Download and install [firefox nightly](https://www.mozilla.org/en-US/firefox/all/#product-desktop-nightly)
- Download and install [firefox nightly](https://www.mozilla.org/en-US/firefox/all/#product-desktop-nightly)
- Set `TAIKO_BROWSER_PATH` to firefox nightly's executable.

Example: `TAIKO_BROWSER_PATH="/Applications/Firefoxnightly.app/Contents/MacOS/firefox" taiko`

#### Known Issues for now:
#### Known Issues for now:
- Highlighting element on action is set to false as overlay domain is not supported
- openTab/closeTab does not work as expected since `New` is not available in firefox yet
- Autofocus on first input field does not happen
Expand Down
6 changes: 5 additions & 1 deletion bin/taiko.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,11 @@ function printVersion() {
if (packageJson._resolved && packageJson._resolved.includes('#')) {
hash = packageJson._resolved.split('#')[1];
}
return `Version: ${packageJson.version} (Chromium: ${packageJson.taiko.chromium_version}) ${hash}`;

const taikoVersion = packageJson.version;
const browserVersion = packageJson.taiko.browser.version;

return `Version: ${taikoVersion} (Chromium: ${browserVersion}) ${hash}`;
} catch (error) {
return 'Could not find the package.json file to read version information';
}
Expand Down
6 changes: 4 additions & 2 deletions lib/repl/repl.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,13 @@ async function setVersionInfo() {
version = require('../../package.json').version;
doc = require('../api.json');
if (!browserPath) {
browserVersion = `Chromium: ${require('../../package.json').taiko.chromium_version}`;
browserVersion = `Chromium: ${require('../../package.json').taiko.browser.version}`;
} else {
browserVersion = browserPath;
}
} catch (_) {}
} catch (_) {
// ignore
}
displayTaiko(browserPath);
}

Expand Down

0 comments on commit b4b6fbc

Please sign in to comment.