From 94008932ae33aff96ce8f386174b8f19d055c261 Mon Sep 17 00:00:00 2001 From: Marton Sari Date: Sun, 27 Aug 2023 22:13:19 +0200 Subject: [PATCH] Add step 'Click over {{element}}' --- CHANGELOG.md | 6 ++++++ README.md | 9 +++++++-- src/core/stepnode.ts | 14 +++++++------- src/packages/browser.smash | 3 +++ tests/packages/browser.smash | 1 + 5 files changed, 24 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 99aabb1..82f0c75 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +## 1.8.7 + +- Uses selenium-webdriver@4.11 which automatically downloads browsers and their drivers, notably Chrome for Testing and chromedriver. Use the step `{browser version} = ''` to specify the browser version. Note: Chrome has a [recent bug](https://bugs.chromium.org/p/chromedriver/issues/detail?id=4532) so using `{browser version} = '113'` is recommended as of today. +- Added CLI option to disable the progress bar. Closes https://github.com/smashtestio/smashtest/issues/58 +- Added step `Click over {{element}}` which is an alias for `Hover over and click {{element}}` + ## 1.8.6 - Empty the queue when using the 'copy' REPL command, so subsequent usages only copy the new commands. diff --git a/README.md b/README.md index bb9b990..044aab1 100644 --- a/README.md +++ b/README.md @@ -111,12 +111,17 @@ await driver.wait(until.elementLocated(By.id('#success-element')), 10000); etc. ``` -### Full documentation +### Installation -[See smashtest.io](https://smashtest.io) for full documentation, setup, tutorials, and screenshots +`npm install smashtest` ### Usage `smashtest [.smash files to run] [options]` Use `smashtest -?` to list options + +### Full documentation + +[See smashtest.io](https://smashtest.io) for full documentation, setup, tutorials, and screenshots + diff --git a/src/core/stepnode.ts b/src/core/stepnode.ts index bec2dc2..e72ede2 100644 --- a/src/core/stepnode.ts +++ b/src/core/stepnode.ts @@ -81,13 +81,13 @@ class StepNode { return this.codeBlock !== undefined; } - // /** - // * Parses a line into this StepNode - // * this.text will be set to '' if this is an empty line, and to '..' if the whole line is just '..' - // * @param {String} line - The full text of the line - // * @returns {StepNode} This StepNode - // * @throws {Error} If there is a parse error - // */ + /** + * Parses a line into this StepNode + * this.text will be set to '' if this is an empty line, and to '..' if the whole line is just '..' + * @param {String} line - The full text of the line + * @returns {StepNode} This StepNode + * @throws {Error} If there is a parse error + */ parseLine(line: string) { const filename = this.filename; const lineNumber = this.lineNumber; diff --git a/src/packages/browser.smash b/src/packages/browser.smash index d2b9ddc..b384ccd 100644 --- a/src/packages/browser.smash +++ b/src/packages/browser.smash @@ -143,6 +143,9 @@ } } + * Click over {{element}} + Hover over and click {{element}} + * Native click {{element}} { await executeScript(function(element) { element.click(); diff --git a/tests/packages/browser.smash b/tests/packages/browser.smash index 29eb7c0..51057b8 100644 --- a/tests/packages/browser.smash +++ b/tests/packages/browser.smash @@ -81,6 +81,7 @@ Open test page - with an API using no target element 2 Hover over and click [target button] + Click over [target button] Verify ['I was clicked'] is visible