Skip to content

Commit 292e594

Browse files
committed
interpolate variables in run command script
1 parent 51b6ca4 commit 292e594

File tree

8 files changed

+28
-13
lines changed

8 files changed

+28
-13
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"test:e2e": "jest --testMatch \"**/packages/**/__tests__/**/*.e2e.js\"",
1616
"lint": "pnpm run lint:scripts",
1717
"lint:scripts": "eslint --ignore-pattern node_modules --ignore-pattern third-party --ignore-pattern dist --ignore-pattern build --ignore-pattern json --ext .ts,.tsx --ext .js packages/",
18-
"test:side-runner": "node ./packages/side-runner/dist/bin.js -t 15000 -f 'else$' ./tests/examples/control-flow.side",
18+
"test:side-runner": "node ./packages/side-runner/dist/bin.js -t 15000 ./tests/examples/simple-parent.side",
1919
"typecheck": "tsc --noEmit --composite false",
2020
"watch": "run-p watch:ts watch:webpack",
2121
"watch:webpack": "pnpm run --stream --filter @seleniumhq/selenium-ide watch",

packages/selenium-ide/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@seleniumhq/selenium-ide",
3-
"version": "4.0.0-alpha.20",
3+
"version": "4.0.0-alpha.21",
44
"private": true,
55
"description": "Selenium IDE electron app",
66
"author": "Todd <[email protected]>",
@@ -100,10 +100,10 @@
100100
"@mui/lab": "^5.0.0-alpha.72",
101101
"@mui/material": "^5.5.0",
102102
"@seleniumhq/get-driver": "^4.0.0-alpha.1",
103-
"@seleniumhq/side-api": "^4.0.0-alpha.7",
103+
"@seleniumhq/side-api": "^4.0.0-alpha.8",
104104
"@seleniumhq/side-model": "^4.0.0-alpha.2",
105105
"@seleniumhq/side-plugin-example": "^4.0.0-alpha.1",
106-
"@seleniumhq/side-runtime": "^4.0.0-alpha.12",
106+
"@seleniumhq/side-runtime": "^4.0.0-alpha.13",
107107
"dnd-core": "16.0.1",
108108
"electron-chromedriver": "^18.0.0",
109109
"electron-log": "^4.4.8",

packages/side-api/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@seleniumhq/side-api",
3-
"version": "4.0.0-alpha.7",
3+
"version": "4.0.0-alpha.8",
44
"description": "Selenium IDE shared models",
55
"author": "Todd Tarsi <[email protected]>",
66
"homepage": "http://github.com/SeleniumHQ/selenium-ide",
@@ -19,7 +19,7 @@
1919
"@seleniumhq/browser-info": "^4.0.0-alpha.1",
2020
"@seleniumhq/get-driver": "^4.0.0-alpha.2",
2121
"@seleniumhq/side-model": "^4.0.0-alpha.2",
22-
"@seleniumhq/side-runtime": "^4.0.0-alpha.12",
22+
"@seleniumhq/side-runtime": "^4.0.0-alpha.13",
2323
"@types/electron": "1.6.10",
2424
"lodash": "^4.17.21"
2525
},

packages/side-plugin-example/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@seleniumhq/side-plugin-example",
33
"private": true,
4-
"version": "4.0.0-alpha.4",
4+
"version": "4.0.0-alpha.5",
55
"description": "Selenium IDE example plugin",
66
"author": "Todd <[email protected]>",
77
"homepage": "http://github.com/SeleniumHQ/selenium-ide",
@@ -16,7 +16,7 @@
1616
"watch": "tsc --watch"
1717
},
1818
"devDependencies": {
19-
"@seleniumhq/side-runtime": "^4.0.0-alpha.12"
19+
"@seleniumhq/side-runtime": "^4.0.0-alpha.13"
2020
},
2121
"repository": {
2222
"type": "git",

packages/side-runner/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "selenium-side-runner",
3-
"version": "4.0.0-alpha.30",
3+
"version": "4.0.0-alpha.31",
44
"description": "Run Selenium IDE projects in cli",
55
"repository": "https://github.com/SeleniumHQ/selenium-ide",
66
"scripts": {
@@ -23,7 +23,7 @@
2323
"license": "Apache-2.0",
2424
"dependencies": {
2525
"@seleniumhq/side-model": "^4.0.0-alpha.2",
26-
"@seleniumhq/side-runtime": "^4.0.0-alpha.12",
26+
"@seleniumhq/side-runtime": "^4.0.0-alpha.13",
2727
"commander": "^9.4.0",
2828
"glob": "^7.2.0",
2929
"jest": "^27.5.1",

packages/side-runtime/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@seleniumhq/side-runtime",
3-
"version": "4.0.0-alpha.12",
3+
"version": "4.0.0-alpha.13",
44
"description": "Selenium IDE playback and execution",
55
"author": "Tomer <[email protected]>",
66
"homepage": "http://github.com/SeleniumHQ/selenium-ide",

packages/side-runtime/src/playback.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ import Variables from './variables'
2424
import { WebDriverExecutor } from '.'
2525
import { CommandShape, TestShape } from '@seleniumhq/side-model'
2626
import { CommandNode, CommandType } from './playback-tree/command-node'
27+
import { interpolateString } from './preprocessors'
2728

2829
const EE = 'event-emitter'
2930
const state = 'state'
@@ -561,7 +562,9 @@ export default class Playback {
561562
if (!this.getTestByName) {
562563
throw new Error("'run' command is not supported")
563564
}
564-
const test = await this.getTestByName(testName)
565+
const test = await this.getTestByName(
566+
interpolateString(testName, this.variables)
567+
)
565568
if (!test) {
566569
throw new Error(`Can't run unknown test: ${testName}`)
567570
}

tests/examples/simple-parent.side

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,16 +34,28 @@
3434
"id": "8b8e2497-1a65-46e4-baa5-a4dd2a0670c0",
3535
"name": "outer",
3636
"commands": [
37+
{
38+
"command": "store",
39+
"target": "open page",
40+
"value": "runCMD",
41+
"id": "58e73596-cfaa-45a6-9d34-d49dee8f27f5"
42+
},
3743
{
3844
"id": "ac59c71a-4b22-4788-a928-3b89776697f7",
3945
"command": "run",
40-
"target": "open page",
46+
"target": "${runCMD}",
4147
"value": ""
4248
},
4349
{
4450
"command": "assertElementPresent",
4551
"target": "css=.lnXdpd",
4652
"value": "",
53+
"id": "c3a7876e-3202-4cf2-8cbb-f2561d14fca3"
54+
},
55+
{
56+
"command": "waitForElementNotPresent",
57+
"target": "css=.dne",
58+
"value": "",
4759
"id": "d341e173-b4f8-4645-b25d-1b58f55ef371"
4860
}
4961
]

0 commit comments

Comments
 (0)