Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v13 and nested key handling #1847

Open
wants to merge 1 commit into
base: trunk
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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 packages/browser-info/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@seleniumhq/browser-info",
"version": "4.0.12",
"version": "4.0.13",
"private": false,
"description": "Get information about installed browsers",
"author": "Tomer <[email protected]>",
Expand Down
4 changes: 2 additions & 2 deletions packages/code-export-csharp-commons/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@seleniumhq/code-export-csharp-commons",
"version": "4.0.12",
"version": "4.0.13",
"private": false,
"description": "Commons for exporting Selenium IDE project contents to C#",
"repository": "https://github.com/SeleniumHQ/selenium-ide",
Expand All @@ -21,6 +21,6 @@
"side-code-export": "^4.0.11"
},
"devDependencies": {
"@seleniumhq/side-model": "4.0.12"
"@seleniumhq/side-model": "4.0.13"
}
}
4 changes: 2 additions & 2 deletions packages/code-export-csharp-nunit/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@seleniumhq/code-export-csharp-nunit",
"version": "4.0.12",
"version": "4.0.13",
"private": false,
"description": "Export Selenium IDE project contents to C# NUnit",
"repository": "https://github.com/SeleniumHQ/selenium-ide",
Expand All @@ -18,7 +18,7 @@
"main": "dist/index.js",
"types": "dist/index.d.ts",
"dependencies": {
"@seleniumhq/code-export-csharp-commons": "4.0.12",
"@seleniumhq/code-export-csharp-commons": "4.0.13",
"side-code-export": "^4.0.11"
},
"gitHead": "f58e327e7616e23a3e926e4b80cf9952164e5744"
Expand Down
6 changes: 3 additions & 3 deletions packages/code-export-csharp-xunit/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@seleniumhq/code-export-csharp-xunit",
"version": "4.0.12",
"version": "4.0.13",
"private": false,
"description": "Export Selenium IDE project contents to C# XUnit",
"repository": "https://github.com/SeleniumHQ/selenium-ide",
Expand All @@ -18,11 +18,11 @@
"main": "dist/index.js",
"types": "dist/index.d.ts",
"dependencies": {
"@seleniumhq/code-export-csharp-commons": "4.0.12",
"@seleniumhq/code-export-csharp-commons": "4.0.13",
"side-code-export": "^4.0.11"
},
"devDependencies": {
"@seleniumhq/side-model": "4.0.12"
"@seleniumhq/side-model": "4.0.13"
},
"gitHead": "f58e327e7616e23a3e926e4b80cf9952164e5744"
}
4 changes: 2 additions & 2 deletions packages/code-export-java-junit/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@seleniumhq/code-export-java-junit",
"version": "4.0.12",
"version": "4.0.13",
"private": false,
"description": "Export Selenium IDE project contents to Java JUnit",
"repository": "https://github.com/SeleniumHQ/selenium-ide",
Expand All @@ -20,7 +20,7 @@
"side-code-export": "^4.0.11"
},
"devDependencies": {
"@seleniumhq/side-model": "4.0.12"
"@seleniumhq/side-model": "4.0.13"
},
"gitHead": "f58e327e7616e23a3e926e4b80cf9952164e5744"
}
4 changes: 2 additions & 2 deletions packages/code-export-javascript-mocha/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@seleniumhq/code-export-javascript-mocha",
"version": "4.0.12",
"version": "4.0.13",
"private": false,
"description": "Export Selenium IDE project contents to JavaScript Mocha",
"repository": "https://github.com/SeleniumHQ/selenium-ide",
Expand All @@ -20,7 +20,7 @@
"side-code-export": "^4.0.11"
},
"devDependencies": {
"@seleniumhq/side-model": "4.0.12"
"@seleniumhq/side-model": "4.0.13"
},
"gitHead": "f58e327e7616e23a3e926e4b80cf9952164e5744"
}
4 changes: 2 additions & 2 deletions packages/code-export-python-pytest/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@seleniumhq/code-export-python-pytest",
"version": "4.0.12",
"version": "4.0.13",
"private": false,
"description": "Export Selenium IDE project contents to Python pytest",
"repository": "https://github.com/SeleniumHQ/selenium-ide",
Expand All @@ -20,7 +20,7 @@
"side-code-export": "^4.0.11"
},
"devDependencies": {
"@seleniumhq/side-model": "4.0.12"
"@seleniumhq/side-model": "4.0.13"
},
"gitHead": "f58e327e7616e23a3e926e4b80cf9952164e5744"
}
4 changes: 2 additions & 2 deletions packages/code-export-ruby-rspec/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@seleniumhq/code-export-ruby-rspec",
"version": "4.0.12",
"version": "4.0.13",
"private": false,
"description": "Export Selenium IDE project contents to Ruby RSpec",
"repository": "https://github.com/SeleniumHQ/selenium-ide",
Expand All @@ -20,7 +20,7 @@
"side-code-export": "^4.0.11"
},
"devDependencies": {
"@seleniumhq/side-model": "4.0.12"
"@seleniumhq/side-model": "4.0.13"
},
"gitHead": "f58e327e7616e23a3e926e4b80cf9952164e5744"
}
2 changes: 1 addition & 1 deletion packages/get-driver/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@seleniumhq/get-driver",
"version": "4.0.12",
"version": "4.0.13",
"private": false,
"description": "Download browser drivers",
"author": "Tomer <[email protected]>",
Expand Down
26 changes: 13 additions & 13 deletions packages/selenium-ide/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "selenium-ide",
"version": "4.0.1-beta.14",
"version": "4.0.1-beta.15",
"private": false,
"description": "Selenium IDE electron app",
"author": "Todd <[email protected]>",
Expand Down Expand Up @@ -118,17 +118,17 @@
"@fontsource/roboto": "^5.0.8",
"@mui/icons-material": "^5.15.13",
"@mui/material": "^5.15.13",
"@seleniumhq/code-export-csharp-nunit": "4.0.12",
"@seleniumhq/code-export-csharp-xunit": "4.0.12",
"@seleniumhq/code-export-java-junit": "4.0.12",
"@seleniumhq/code-export-javascript-mocha": "4.0.12",
"@seleniumhq/code-export-python-pytest": "4.0.12",
"@seleniumhq/code-export-ruby-rspec": "4.0.12",
"@seleniumhq/get-driver": "4.0.12",
"@seleniumhq/side-api": "4.0.12",
"@seleniumhq/side-commons": "4.0.12",
"@seleniumhq/side-model": "4.0.12",
"@seleniumhq/side-runtime": "4.0.12",
"@seleniumhq/code-export-csharp-nunit": "4.0.13",
"@seleniumhq/code-export-csharp-xunit": "4.0.13",
"@seleniumhq/code-export-java-junit": "4.0.13",
"@seleniumhq/code-export-javascript-mocha": "4.0.13",
"@seleniumhq/code-export-python-pytest": "4.0.13",
"@seleniumhq/code-export-ruby-rspec": "4.0.13",
"@seleniumhq/get-driver": "4.0.13",
"@seleniumhq/side-api": "4.0.13",
"@seleniumhq/side-commons": "4.0.13",
"@seleniumhq/side-model": "4.0.13",
"@seleniumhq/side-runtime": "4.0.13",
"dnd-core": "^16.0.1",
"electron-chromedriver": "^28.0.0",
"electron-log": "^5.1.0",
Expand All @@ -150,7 +150,7 @@
},
"devDependencies": {
"@medv/finder": "^1.1.1",
"@seleniumhq/browser-info": "4.0.12",
"@seleniumhq/browser-info": "4.0.13",
"@types/copy-webpack-plugin": "8.0.1",
"@types/electron-devtools-installer": "^2.2.5",
"@types/fs-extra": "^11.0.1",
Expand Down
10 changes: 5 additions & 5 deletions packages/side-api/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@seleniumhq/side-api",
"version": "4.0.12",
"version": "4.0.13",
"private": false,
"description": "Selenium IDE API command shapes and such.",
"author": "Todd Tarsi <[email protected]>",
Expand All @@ -20,10 +20,10 @@
"dist"
],
"dependencies": {
"@seleniumhq/browser-info": "4.0.12",
"@seleniumhq/get-driver": "4.0.12",
"@seleniumhq/side-model": "4.0.12",
"@seleniumhq/side-runtime": "4.0.12",
"@seleniumhq/browser-info": "4.0.13",
"@seleniumhq/get-driver": "4.0.13",
"@seleniumhq/side-model": "4.0.13",
"@seleniumhq/side-runtime": "4.0.13",
"lodash": "^4.17.21"
},
"devDependencies": {
Expand Down
6 changes: 3 additions & 3 deletions packages/side-code-export/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "side-code-export",
"version": "4.0.12",
"version": "4.0.13",
"description": "Utils for code export from Selenium IDE",
"repository": "https://github.com/SeleniumHQ/selenium-ide",
"keywords": [
Expand All @@ -20,8 +20,8 @@
"main": "dist/index.js",
"types": "dist/index.d.ts",
"dependencies": {
"@seleniumhq/side-model": "4.0.12",
"@seleniumhq/side-runtime": "4.0.12",
"@seleniumhq/side-model": "4.0.13",
"@seleniumhq/side-runtime": "4.0.13",
"commander": "^9.4.0"
},
"gitHead": "f58e327e7616e23a3e926e4b80cf9952164e5744"
Expand Down
2 changes: 1 addition & 1 deletion packages/side-commons/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@seleniumhq/side-commons",
"version": "4.0.12",
"version": "4.0.13",
"private": false,
"description": "Selenium IDE common utilities",
"author": "Tomer <[email protected]>",
Expand Down
6 changes: 3 additions & 3 deletions packages/side-example-suite/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@seleniumhq/side-example-suite",
"version": "4.0.12",
"version": "4.0.13",
"private": true,
"description": "Selenium IDE example suite, with tests, plugin, and export format",
"author": "Todd <[email protected]>",
Expand All @@ -18,10 +18,10 @@
},
"dependencies": {
"side-code-export": "^4.0.11",
"@seleniumhq/code-export-python-pytest": "4.0.12"
"@seleniumhq/code-export-python-pytest": "4.0.13"
},
"devDependencies": {
"@seleniumhq/side-api": "4.0.12"
"@seleniumhq/side-api": "4.0.13"
},
"repository": {
"type": "git",
Expand Down
2 changes: 1 addition & 1 deletion packages/side-migrate/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@seleniumhq/side-migrate",
"version": "4.0.12",
"version": "4.0.13",
"private": false,
"description": "Selenium IDE format migrations",
"author": "Tomer <[email protected]>",
Expand Down
2 changes: 1 addition & 1 deletion packages/side-model/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@seleniumhq/side-model",
"version": "4.0.12",
"version": "4.0.13",
"private": false,
"description": "Selenium IDE shared models",
"author": "Tomer <[email protected]>",
Expand Down
6 changes: 3 additions & 3 deletions packages/side-runner/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "selenium-side-runner",
"version": "4.0.12",
"version": "4.0.13",
"private": false,
"description": "Run Selenium IDE projects in cli",
"repository": "https://github.com/SeleniumHQ/selenium-ide",
Expand All @@ -23,8 +23,8 @@
],
"license": "Apache-2.0",
"dependencies": {
"@seleniumhq/side-model": "4.0.12",
"@seleniumhq/side-runtime": "4.0.12",
"@seleniumhq/side-model": "4.0.13",
"@seleniumhq/side-runtime": "4.0.13",
"commander": "^11.0.0",
"glob": "^10.3.1",
"jest": "^29.6.0",
Expand Down
12 changes: 6 additions & 6 deletions packages/side-runtime/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@seleniumhq/side-runtime",
"version": "4.0.12",
"version": "4.0.13",
"private": false,
"description": "Selenium IDE playback and execution",
"author": "Tomer <[email protected]>",
Expand All @@ -25,13 +25,13 @@
"url": "https://github.com/SeleniumHQ/selenium-ide/issues"
},
"devDependencies": {
"@seleniumhq/get-driver": "4.0.12",
"@seleniumhq/side-testkit": "4.0.12",
"@seleniumhq/webdriver-testkit": "4.0.12"
"@seleniumhq/get-driver": "4.0.13",
"@seleniumhq/side-testkit": "4.0.13",
"@seleniumhq/webdriver-testkit": "4.0.13"
},
"dependencies": {
"@seleniumhq/side-commons": "4.0.12",
"@seleniumhq/side-model": "4.0.12",
"@seleniumhq/side-commons": "4.0.13",
"@seleniumhq/side-model": "4.0.13",
"@types/selenium-webdriver": "^4.1.22",
"selenium-webdriver": "^4.20.0"
},
Expand Down
36 changes: 33 additions & 3 deletions packages/side-runtime/src/variables.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,22 +21,52 @@ export default class Variables {
}
storedVars: Map<string, any>

static getKeySegments(key: string) {
return key.split(/[.[\]]+/g).filter(Boolean)
}

get(key: string) {
if (key.startsWith('env:')) {
return process.env[key.slice(4)]
}
return this.storedVars.get(key)
const [firstSegment, ...segments] = Variables.getKeySegments(key)
let returnValue = this.storedVars.get(firstSegment)
while (segments.length > 0) {
const segment = segments.shift()!
returnValue = returnValue[segment]
}
return returnValue
}

set(key: string, value: any) {
this.storedVars.set(key, value)
const [firstSegment, ...segments] = Variables.getKeySegments(key)
if (key === firstSegment) {
this.storedVars.set(key, value)
} else {
let returnValue = this.storedVars.get(firstSegment)
while (segments.length > 1) {
const segment = segments.shift()!
if (!returnValue[segment]) {
returnValue[segment] = {}
}
returnValue = returnValue[segment]
}
returnValue[segments[0]] = value
}
}

has(key: string) {
if (key.startsWith('env:')) {
return true
}
return this.storedVars.has(key)
const [firstSegment, ...segments] = Variables.getKeySegments(key)
let returnValue = this.storedVars.get(firstSegment)
while (segments.length > 0) {
if (returnValue === undefined) return false
const segment = segments.shift()!
returnValue = returnValue[segment]
}
return returnValue !== undefined
}

delete(key: string) {
Expand Down
2 changes: 1 addition & 1 deletion packages/side-testkit/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@seleniumhq/side-testkit",
"version": "4.0.12",
"version": "4.0.13",
"private": false,
"description": "Selenium IDE test stuff",
"author": "Tomer <[email protected]>",
Expand Down
Loading
Loading