Skip to content

Commit 1294889

Browse files
committed
fix select element data transform
1 parent bc171ab commit 1294889

File tree

6 files changed

+29
-12
lines changed

6 files changed

+29
-12
lines changed

packages/selenium-ide/package.json

Lines changed: 2 additions & 2 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.28",
3+
"version": "4.0.0-alpha.29",
44
"private": true,
55
"description": "Selenium IDE electron app",
66
"author": "Todd <[email protected]>",
@@ -107,7 +107,7 @@
107107
"@seleniumhq/code-export-ruby-rspec": "^4.0.0-alpha.0",
108108
"@seleniumhq/side-code-export": "^4.0.0-alpha.2",
109109
"@seleniumhq/get-driver": "^4.0.0-alpha.1",
110-
"@seleniumhq/side-api": "^4.0.0-alpha.14",
110+
"@seleniumhq/side-api": "^4.0.0-alpha.15",
111111
"@seleniumhq/side-model": "^4.0.0-alpha.2",
112112
"@seleniumhq/side-plugin-example": "^4.0.0-alpha.1",
113113
"@seleniumhq/side-runtime": "^4.0.0-alpha.15",

packages/side-api/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-api",
3-
"version": "4.0.0-alpha.14",
3+
"version": "4.0.0-alpha.15",
44
"description": "Selenium IDE shared models",
55
"author": "Todd Tarsi <[email protected]>",
66
"homepage": "http://github.com/SeleniumHQ/selenium-ide",

packages/side-api/src/commands/recorder/selectElement.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import capitalize from 'lodash/fp/capitalize'
12
import { mutator as updateStepMutator } from '../tests/updateStep'
23
import { getActiveCommand } from '../../helpers/getActiveData'
34
import { LocatorFields, Mutator } from '../../types'
@@ -17,7 +18,8 @@ export const mutator: Mutator<Shape> = (session, { params }) =>
1718
session.state.activeTestID,
1819
getActiveCommand(session).id,
1920
{
20-
[params[0]]: params[1],
21+
[params[0]]: params[1][0][0],
22+
[`fallback${capitalize(params[0])}s`]: params[1],
2123
},
2224
],
2325
result: undefined,

packages/side-commons/src/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,5 @@
1616
// under the License.
1717

1818
export * as events from './events'
19+
export * as string from './string'
1920
export * from './types'
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
export const capitalize = (str: string) =>
2+
str.split(' ').map((word) => `${word[0].toUpperCase()}${word.slice(1)}`)

tests/examples/simple-parent.side

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,6 @@
4343
"value": "runCMD",
4444
"id": "58e73596-cfaa-45a6-9d34-d49dee8f27f5"
4545
},
46-
{
47-
"command": "pause",
48-
"target": "5000",
49-
"value": "",
50-
"id": "7abca8eb-6325-48ed-92d0-968d1659675e"
51-
},
5246
{
5347
"id": "ac59c71a-4b22-4788-a928-3b89776697f7",
5448
"command": "run",
@@ -57,9 +51,27 @@
5751
},
5852
{
5953
"command": "assertElementPresent",
60-
"target": "css=.lnXdpd",
54+
"target": "id=hplogo",
6155
"value": "",
62-
"id": "c3a7876e-3202-4cf2-8cbb-f2561d14fca3"
56+
"id": "c3a7876e-3202-4cf2-8cbb-f2561d14fca3",
57+
"fallbackTargets": [
58+
[
59+
"id=hplogo",
60+
"id"
61+
],
62+
[
63+
"css=#hplogo",
64+
"css:finder"
65+
],
66+
[
67+
"xpath=(//img[@alt='Seasonal Holidays 2022'])[1]",
68+
"xpath:img"
69+
],
70+
[
71+
"xpath=(//img[@id='hplogo'])[1]",
72+
"xpath:attributes"
73+
]
74+
]
6375
},
6476
{
6577
"command": "waitForElementNotPresent",

0 commit comments

Comments
 (0)