Skip to content

Commit

Permalink
Add step 'Click over {{element}}'
Browse files Browse the repository at this point in the history
  • Loading branch information
sarimarton committed Aug 27, 2023
1 parent 4024631 commit 9400893
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 9 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

## 1.8.7

- Uses [email protected] which automatically downloads browsers and their drivers, notably Chrome for Testing and chromedriver. Use the step `{browser version} = '<major 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.
Expand Down
9 changes: 7 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

14 changes: 7 additions & 7 deletions src/core/stepnode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
3 changes: 3 additions & 0 deletions src/packages/browser.smash
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,9 @@
}
}

* Click over {{element}}
Hover over and click {{element}}

* Native click {{element}} {
await executeScript(function(element) {
element.click();
Expand Down
1 change: 1 addition & 0 deletions tests/packages/browser.smash
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 9400893

Please sign in to comment.