Skip to content
Merged

V3 #1

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
100 commits
Select commit Hold shift + click to select a range
95d96e7
Created code-export-python-pytest by copying code-export-java-junit, …
Jun 4, 2019
3421637
Updated location emitters
Jun 4, 2019
ba6cab8
Updated the selection emitter
Jun 4, 2019
a54fc5f
Added quotes around values in location and selection emitters
Jun 4, 2019
80eb347
Implemented first command -- add selection
Jun 4, 2019
d26e4fa
Updated tests for location and selection emitting
Jun 4, 2019
df2ffa4
Removed whitespace padding from import statement
Jun 4, 2019
584c95a
Added `assert`, `assert alert`, and `assert checked` command emitting
Jun 4, 2019
5bfdf93
Changed location and selection emitting to output a consolidated string
Jun 5, 2019
fd87fda
Added `assert confirmation` test
Jun 5, 2019
7f5e539
Bumped babel-preset-env version to see about fixing noisy log output
Jun 6, 2019
9f4e6c4
Added dependency for Selenium actions
Jun 6, 2019
04acf3c
Added more commands to emitting
Jun 6, 2019
f8f33e7
Implemented more command emitters
Jun 6, 2019
42a84ea
Upgraded babel deps for code-export-python-pytest to fix the log trac…
Jun 6, 2019
0ccb39e
Fixed linting error
Jun 6, 2019
238945f
Fixed padding around log entries so hover highlighting is wider. Also…
Jun 10, 2019
8147730
Completed first pass on command emitting for Python code export
Jun 10, 2019
4e8280d
Added a final blank entry to dependencies hook to add a new line betw…
Jun 11, 2019
8583715
Updated hooks to return undefined on optional emitting, and filter em…
Jun 11, 2019
c32975b
Updated emitting for the window handling util method, updated `run` t…
Jun 11, 2019
d0c43f8
Added support for empyt strings in rendering. Also added the option t…
Jun 11, 2019
bc3b58c
Updated snapshots for first pass on e2e Python emitting
Jun 11, 2019
1f1f750
Updated code-export babel deps. Resolves the remainder of the chatty …
Jun 11, 2019
f43a3d1
Fixed emitted class definition
Jun 12, 2019
3d5620d
Streamlined the emitter for the check command
Jun 12, 2019
f57dbfa
Fixed the dependency for explicit waits
Jun 12, 2019
7d7a161
Added Python code export to the UI
Jun 12, 2019
6a8cd87
Prefixed driver with `self.`
Jun 12, 2019
ab27dd8
isSelected() => is_selected()
Jun 12, 2019
d883345
Fixed broken variable lookup in execute_script argument emitting
Jun 12, 2019
f330ee2
findElement => find_element (missed one)
Jun 12, 2019
cdf2b77
Added missing dependency for Keys
Jun 12, 2019
224980c
Added `self.` prefix to `vars` and updated the test snapshots
Jun 12, 2019
38f2334
Updated emitAssert to convert booleans and numbers using the correct …
Jun 12, 2019
28c1dab
Fixed incorrect find_element param declaration
Jun 12, 2019
07bdef9
Fixed `repeat if` indentation
Jun 12, 2019
1413e99
Added missing `:` for `for each`
Jun 12, 2019
546f9ea
Fixed off-by-one error in `times`
Jun 12, 2019
eb6246a
Updated explicit wait emitters
Jun 12, 2019
86f3ef3
Updated explicit wait locator emitting
Jun 12, 2019
c27cce4
Updated negative explicit wait, and streamlined `assert not editable`
Jun 13, 2019
381afd6
Updated method declaration for `wait_for_window`
Jun 13, 2019
1bef181
Updated `wait_for_window` to use time.sleep, and convert the timeout …
Jun 13, 2019
2c7d647
Updated `wait_for_window` to pop the first value out of its return set
Jun 13, 2019
2d0de6c
Added `self` to the `wait_for_window` args, and added string conversi…
Jun 13, 2019
a5a2085
Merge branch 'code-export-python' into v3
Jun 16, 2019
a9f64b0
Updated the runner to the latest version of selenium-webdriver
Jun 16, 2019
3e77935
Updated the supported Node version info in the readme for the runner
Jun 16, 2019
a8e6a14
Updated the runner to the latest version of selenium-webdriver
Jun 16, 2019
842d6fc
changelog.md -> CHANGELOG.md
Jun 16, 2019
8cd1faf
Updated changelog
Jun 16, 2019
a55c89c
v3.9.0
Jun 16, 2019
5842638
Updated the travis config to drop Node 8 and add Node 12
Jun 16, 2019
bcea771
Color match the timestamp to the rest of the line text
Jun 18, 2019
a895d11
Moved the SIDE files used to e2e test code export languages into code…
Jun 18, 2019
37ff305
Fixed typo
Jun 18, 2019
d2ab44c
First pass on code export for JS Mocha. Still a WIP.
Jun 18, 2019
a692215
Finished first pass on command emitting
Jun 19, 2019
bcbb919
Fixes for `waitForWindow` declaration, `if` expression, and `repeatIf…
Jun 19, 2019
1d8dcdc
Added `async` to test and function declarations
Jun 19, 2019
164ff2e
Updated snapshots for a few of the e2e tests. Marked remaining ones a…
Jun 19, 2019
034d4ae
Added support for an alternative terminatingKeyword when emitting met…
Jun 20, 2019
af5c764
Updated e2e tests
Jun 20, 2019
7d7c133
Enabled JS code export in the UI
Jun 20, 2019
0bbc6f8
Added a mocha timeout to the variables hook
Jun 20, 2019
7c8e95b
Added sub-closures to commands that use local variables
Jun 20, 2019
afcb143
Fixes to assert/verify selected label
Jun 20, 2019
d3ef32c
Fix for assert/verify
Jun 20, 2019
bb3d289
Removed ending close command from `select window` seed test
Jun 20, 2019
54f98f2
Added a missing paren to one of the commands in the select window uti…
Jun 20, 2019
fcc0d27
Added alphabetical sorting to the language display names on the code …
Jun 20, 2019
f66b64d
Switched the command export tests to use snapshots
Jun 20, 2019
5486dcf
Updated code export docs
Jun 20, 2019
aa7b38d
Updated changelog
Jun 23, 2019
b8b9d8f
v3.10.0
Jun 23, 2019
edfa3ec
Moved the java-junit and python-pytest command tests over to snapshots
Jun 23, 2019
4147b8a
Update README.md
Jun 23, 2019
ef9b1bf
Updated to latest of selenium-webdriver
Jun 24, 2019
a63b5f7
Update bug.md
Jun 24, 2019
22d834e
Update regression.md
Jun 24, 2019
75b941b
Work to support PR #734. Renamed code-export-utils to side-utils, whi…
Jun 30, 2019
6ed1f82
Added plugin support for adding new languages to code export. Supports
Jul 1, 2019
8f30be0
Updated changelog
Jul 1, 2019
0272ef9
v3.11.0
Jul 1, 2019
e48adcc
Updated side-utils description slightly
Jul 1, 2019
0f17f32
Added mention of side-utils to the code export plugin API docs
Jul 1, 2019
805fffc
Added readme to side-utils
Jul 1, 2019
c18884c
v3.11.1
Jul 1, 2019
c900294
Added fix for the prompt-injector so it doesn't console error on site…
Jul 2, 2019
eeecd6d
Fixed typo on Line 175 (#741)
pramilgawande Jul 9, 2019
14a1a36
Added set default value when select 'wait for...' command (#678)
sapzape Jul 9, 2019
b47e051
Made setWindowSize optional when emitting for the runner. Band-aid fi…
Jul 11, 2019
8772c00
Added improved string escaping
Jul 16, 2019
afde67b
Updated changelog
Jul 16, 2019
f843369
v3.12.0
Jul 16, 2019
ce759e3
Refactored string escape preprocessing
Jul 17, 2019
80fc8f8
Added backslash escaping to stringEscape and added test coverage for …
Jul 18, 2019
1f5745d
Updated changelog
Jul 18, 2019
61fce36
v3.12.1
Jul 18, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ Issues without a reproduction project are likely to stall.
OS: <!-- Windows 10? OSX? -->
Selenium IDE Version: <!-- e.g.: 3.0.3 -->
Selenium SIDE Runner Version: <!-- e.g.: 0.7.0
Please note that selenium-side-runner supports Node.js 8 - 10
Please note that selenium-side-runner supports Node.js 10 - 12
-->
Node version: <!-- e.g.: 10.4
Only required if using selenium-side-runner
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/regression.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ Issues without a reproduction project are likely to stall.
OS: <!-- Windows 10? OSX? -->
Selenium IDE Version: <!-- e.g.: 3.0.3 -->
Selenium SIDE Runner Version: <!-- e.g.: 0.7.0
Please note that selenium-side-runner supports Node.js 8 - 10
Please note that selenium-side-runner supports Node.js 10 - 12
-->
Node version: <!-- e.g.: 10.4
Only required if using selenium-side-runner
Expand Down
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ cache:
directories:
- .peru
node_js:
- "12"
- "10"
- "8"
services:
- docker
before_install:
Expand Down
20 changes: 20 additions & 0 deletions changelog.md → CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,25 @@
# Changelog

## v3.12.1
- Fix for string escaping, to handle backslashes

## v3.12.0
- Added default wait time to `wait for` commands (PR #678)
- Added better string escaping to code export and code emitting for the command-line runner
- Made setWindowSize optional when emitting for the runner (issue #627)

## v3.11.1
- Add the ability for new programming languages to be specified through plugins

## v3.10.0
- Code export for JavaScript (e.g., Mocha, Node 10)

## v3.9.0
- Code export for Python (e.g., pytest, Python 3)
- Fix for frames to support `relative=parent` in the runner
- Fix for frames to support `relative=top` in IDE playback
- Added timestamps to log entries (PR #688)

## v3.8.1
- Code export fixes for commands that open and switch to new windows
- Added a suffix of "Test" to class and filenames in Java code export
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<img src="packages/selenium-ide/src/icons/icon128.png" alt="logo" height="128" align="right" />

# Selenium IDE &middot; [![Build Status](https://travis-ci.org/SeleniumHQ/selenium-ide.svg?branch=master)](https://travis-ci.org/SeleniumHQ/selenium-ide)
# Selenium IDE &middot; [![Build Status](https://travis-ci.com/SeleniumHQ/selenium-ide.svg?branch=master)](https://travis-ci.com/SeleniumHQ/selenium-ide)

_[WIP] An integrated development environment for Selenium scripts_

Expand Down
42 changes: 40 additions & 2 deletions docs/introduction/code-export.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,11 @@ This will place inline code comments in the exported file with details about the

## Supported Exports

Currently, export to Java is supported. Specifically, Java for JUnit.
Currently, export to the following languages and test frameworks is supported.

- Java JUnit
- JavaScript Mocha
- Python pytest

We intend to support all of the officially supported programming language bindings for Selenium (e.g., Java, JavaScript, C#, Python, and Ruby) in at least one testing framework for each language.

Expand Down Expand Up @@ -58,6 +62,40 @@ Here's a sample `pom.xml` to help you get started.
</project>
```

### JavaScript Mocha

The exported code for JavaScript Mocha is built to work with Node 10, Mocha 6.1.x, and the latest version of Selenium 4.

You should be able to take the exported JavaScript file and run it after installing these dependencies (e.g., with `npm install`).

Here's a sample `package.json` to help you get started.

```javascript
{
"dependencies": {
"mocha": "^6.1.4",
"selenium-webdriver": "^4.0.0-alpha.3"
}
}
```

### Python pytest

The exported code for Python pytest is built to work with Python 3, pytest 4.6.x, and the latest version of Selenium 4.

You should be able to take the exported JavaScript file and run it after installing these dependencies (e.g., with `pip3 install`).

Here's a sample `requirements.txt` to help you get started.

```
pytest == 4.6.3
selenium == 4.0.0a1
```

```sh
> pip3 install -r ./requirements.txt
```

## How To Contribute

Code export was built in a modular way to help enable contributions.
Expand All @@ -72,7 +110,7 @@ First, copy an existing language package (e.g., `packages/code-export-java-junit

Next, add the new package as a dependency to [the `package.json` in `code-export`](https://github.com/SeleniumHQ/selenium-ide/blob/c55c556ffc947fd3f6ee8ab317915c6f879a88dc/packages/code-export/package.json#L22).

Lastly, run `yarn` from the root of the project.
Lastly, run `yarn` from the root of the project, and then build the project using `yarn watch` (full details for getting a local build going are available [here](https://github.com/SeleniumHQ/selenium-ide/blob/v3/README.md)).

### 2. Update the locators and commands

Expand Down
43 changes: 40 additions & 3 deletions docs/plugins/code-export.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,41 @@ title: Code Export Plugin Support
sidebar_label: Exporting Code
---

The plugins API enables any Selenium IDE plugin to be export code in response to certain events (or "hooks").
The plugins API enables any Selenium IDE plugin to export code for either:

1. an existing language
2. a new language

__NOTE: If adding a new language, take a look at [@seleniumhq/side-utils](https://www.npmjs.com/package/@seleniumhq/side-utils). You can see an example of it in use in existing languages for code-export (e.g., [java-junit](https://github.com/SeleniumHQ/selenium-ide/tree/v3/packages/code-export-java-junit)).__

### Export config

In your plugin manifest you'll need to specify that it exports languages, and for which ones.
In your plugin manifest you'll need to specify that it exports languages.

<u>Add to an existing language</u>

To augment an existing language, use the `languages` key and specify which ones in an array.

```javascript
"exports": {
"languages": ["java-junit"]
}
```

The currently available language ids `"java-junit"`, `"javascript-mocha"`, and `"python-pytest"`.

<u>Add a new language</u>

To add a new language to code export, use the `vendor` key and specify your langauge in an object array.

```javascript
"exports": {
"vendor": [{"your-language": "Your language"}]
}
```

The key is the ID which will be used in the export event. The value is the display name that will be used in the code export menu in the UI.

### Export event

Selenium IDE sends the following event for each entity type, which your plugin can respond to for code export.
Expand All @@ -30,7 +53,7 @@ Selenium IDE sends the following event for each entity type, which your plugin c
```

- `action` - `export`, indicating an action that requires code export
- `entity`, the entity to export, can be `command` or any of [the hooks mentioned in the next section](code-export.md#hooks)
- `entity`, the entity to export, can be `command`, any of [the hooks mentioned in the next section](code-export.md#hooks), or `vendor` if exporting a new language
- `options` - metadata to help your plugin make more informed decisions about what to export (e.g., project, test name, suite name, etc.)

## Hooks
Expand All @@ -49,6 +72,8 @@ Code export is built around the notion of hooks, which offers entry points into

## Response

### Add to an existing language

To respond to an export event, call `sendResponse` along with the string you'd like to export. If there are multiple lines to your string, separate them with newline characters (e.g., `\n`).

Or you can look into using the command object structure mentioned in the [code export getting started](introduction/code-export.md#2-update-the-locators-and-commands).
Expand All @@ -57,4 +82,16 @@ Or you can look into using the command object structure mentioned in the [code e
sendResponse(`const myLibrary = require("my-library");`);
```

### Add a new language

In response to a `vendor` export event for your new language(s), your plugin needs to respond with the an object containing the keys `filename` and `body`.

```javascript
const payload = {
filename: 'test.js',
body: '// your final exported code\n// goes here\n// etc.'
}
sendResponse(payload)
```


2 changes: 1 addition & 1 deletion gh-release.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ if (!token)

// fetch changelog details
const changelog = exec(
`sed '1,/${tag}/d;/## v/q' ./changelog.md | sed '/^ *$/q'`,
`sed '1,/${tag}/d;/## v/q' ./CHANGELOG.md | sed '/^ *$/q'`,
{
encoding: 'utf8',
}
Expand Down
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
"packages": [
"packages/*"
],
"version": "3.8.1",
"version": "3.12.1",
"npmClient": "yarn"
}
4 changes: 2 additions & 2 deletions packages/code-export-java-junit/.babelrc
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{
"presets": [
["env",
["@babel/preset-env",
{
"targets": {
"node": "8"
}
}]
],
"plugins": [
"transform-object-rest-spread",
"@babel/plugin-proposal-object-rest-spread"
]
}
Loading