Skip to content

Commit 4ad0ce7

Browse files
committed
beta v4, relax whitespace comparisons on wait for text
1 parent 0bb29d0 commit 4ad0ce7

File tree

8 files changed

+694
-174
lines changed

8 files changed

+694
-174
lines changed

packages/selenium-ide/package.json

+7-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "selenium-ide",
3-
"version": "4.0.1-beta.3",
3+
"version": "4.0.1-beta.4",
44
"private": false,
55
"description": "Selenium IDE electron app",
66
"author": "Todd <[email protected]>",
@@ -18,7 +18,7 @@
1818
"publish:electron:mac": "CSC_IDENTITY_AUTO_DISCOVERY=false electron-builder -m --publish always",
1919
"publish:electron:windows": "electron-builder -w --publish always",
2020
"release": "electron-builder",
21-
"watch": "webpack --watch"
21+
"watch": "webpack serve"
2222
},
2323
"bin": {
2424
"selenium-ide": "bin.js"
@@ -114,6 +114,7 @@
114114
"@fontsource/roboto": "^5.0.8",
115115
"@mui/icons-material": "^5.15.13",
116116
"@mui/material": "^5.15.13",
117+
"@pmmmwh/react-refresh-webpack-plugin": "^0.5.11",
117118
"@seleniumhq/code-export-csharp-nunit": "^4.0.1",
118119
"@seleniumhq/code-export-csharp-xunit": "^4.0.1",
119120
"@seleniumhq/code-export-java-junit": "^4.0.1",
@@ -124,7 +125,7 @@
124125
"@seleniumhq/side-api": "^4.0.3",
125126
"@seleniumhq/side-commons": "^4.0.1",
126127
"@seleniumhq/side-model": "^4.0.1",
127-
"@seleniumhq/side-runtime": "^4.0.1",
128+
"@seleniumhq/side-runtime": "^4.0.2",
128129
"dnd-core": "^16.0.1",
129130
"electron-chromedriver": "^28.0.0",
130131
"electron-log": "^5.1.0",
@@ -163,6 +164,7 @@
163164
"html-webpack-plugin": "^5.5.3",
164165
"mini-css-extract-plugin": "^2.7.6",
165166
"npm-run-all": "^4.1.5",
167+
"react-refresh-typescript": "^2.0.9",
166168
"run-script-os": "^1.1.6",
167169
"source-map-loader": "^4.0.1",
168170
"source-map-support": "^0.5.21",
@@ -171,6 +173,7 @@
171173
"ts-node": "^10.9.1",
172174
"typescript": "^5.2.2",
173175
"webpack": "^5.89.0",
174-
"webpack-cli": "^5.1.4"
176+
"webpack-cli": "^5.1.4",
177+
"webpack-dev-server": "^5.0.4"
175178
}
176179
}

packages/selenium-ide/webpack.config.ts

+57-14
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,23 @@
1+
import ReactRefreshWebpackPlugin from '@pmmmwh/react-refresh-webpack-plugin'
12
import ForkTsCheckerWebpackPlugin from 'fork-ts-checker-webpack-plugin'
23
import fs from 'fs'
34
import CopyWebpackPlugin from 'copy-webpack-plugin'
45
import HtmlWebpackPlugin from 'html-webpack-plugin'
56
import kebabCase from 'lodash/fp/kebabCase'
67
import MiniCssExtractPlugin from 'mini-css-extract-plugin'
78
import path from 'path'
9+
// eslint-disable-next-line node/no-unpublished-import
10+
import ReactRefreshTypeScript from 'react-refresh-typescript'
811
import {
912
Configuration,
1013
SourceMapDevToolPlugin,
1114
WebpackPluginInstance,
1215
} from 'webpack'
16+
// eslint-disable-next-line node/no-unpublished-import
17+
import type { Configuration as DevServerConfiguration } from 'webpack-dev-server'
1318

1419
const isProduction = process.env.NODE_ENV === 'production'
20+
const isDevelopment = !isProduction
1521

1622
const commonPlugins: WebpackPluginInstance[] = [
1723
new ForkTsCheckerWebpackPlugin(),
@@ -22,11 +28,20 @@ const commonPlugins: WebpackPluginInstance[] = [
2228
if (isProduction) {
2329
commonPlugins.push(new MiniCssExtractPlugin())
2430
}
31+
if (isDevelopment) {
32+
commonPlugins.push(new ReactRefreshWebpackPlugin())
33+
}
2534

2635
const commonConfig: Pick<
2736
Configuration,
2837
'devtool' | 'externals' | 'mode' | 'module' | 'resolve' | 'output'
29-
> = {
38+
> & {
39+
devServer?: DevServerConfiguration
40+
} = {
41+
devServer: {
42+
hot: isDevelopment,
43+
port: 8081,
44+
},
3045
devtool: 'source-map',
3146
externals: ['utf-8-validate', 'bufferutil'],
3247
mode: isProduction ? 'production' : 'development',
@@ -39,9 +54,13 @@ const commonConfig: Pick<
3954
},
4055
{
4156
test: /\.tsx?$/,
42-
loader: 'ts-loader',
4357
exclude: /node_modules/,
58+
// eslint-disable-next-line node/no-unpublished-require
59+
loader: require.resolve('ts-loader'),
4460
options: {
61+
getCustomTransformers: () => ({
62+
before: [isDevelopment && ReactRefreshTypeScript()].filter(Boolean),
63+
}),
4564
transpileOnly: true,
4665
},
4766
},
@@ -96,6 +115,10 @@ const preloadEntries = windowData
96115

97116
const preloadConfig: Configuration = {
98117
...commonConfig,
118+
devServer: {
119+
...commonConfig.devServer,
120+
port: 8083,
121+
},
99122
entry: Object.fromEntries(preloadEntries),
100123
plugins: commonPlugins,
101124
target: 'electron-preload',
@@ -111,6 +134,10 @@ const rendererEntries = windowData
111134

112135
const rendererConfig: Configuration = {
113136
...commonConfig,
137+
devServer: {
138+
...commonConfig.devServer,
139+
port: 8084,
140+
},
114141
entry: Object.fromEntries(rendererEntries),
115142
plugins: commonPlugins.concat(
116143
Object.values(rendererEntries).map(
@@ -123,6 +150,10 @@ const rendererConfig: Configuration = {
123150

124151
const playbackPreloadBidiConfig: Configuration = {
125152
...commonConfig,
153+
devServer: {
154+
...commonConfig.devServer,
155+
port: 8085,
156+
},
126157
entry: {
127158
'playback-window-bidi-preload': path.join(
128159
__dirname,
@@ -139,6 +170,10 @@ const playbackPreloadBidiConfig: Configuration = {
139170

140171
const playbackRendererBidiConfig: Configuration = {
141172
...commonConfig,
173+
devServer: {
174+
...commonConfig.devServer,
175+
port: 8086,
176+
},
142177
entry: {
143178
'playback-window-bidi-renderer': path.join(
144179
__dirname,
@@ -149,23 +184,31 @@ const playbackRendererBidiConfig: Configuration = {
149184
'renderer.tsx'
150185
),
151186
},
152-
plugins: commonPlugins.concat(
153-
getBrowserPlugin('playback-window-bidi') as unknown as WebpackPluginInstance
154-
).concat(
155-
new CopyWebpackPlugin({
156-
patterns: [
157-
{
158-
from: 'src/browser/*.css',
159-
to: '[name].css',
160-
},
161-
],
162-
})
163-
),
187+
plugins: commonPlugins
188+
.concat(
189+
getBrowserPlugin(
190+
'playback-window-bidi'
191+
) as unknown as WebpackPluginInstance
192+
)
193+
.concat(
194+
new CopyWebpackPlugin({
195+
patterns: [
196+
{
197+
from: 'src/browser/*.css',
198+
to: '[name].css',
199+
},
200+
],
201+
})
202+
),
164203
target: 'web',
165204
}
166205

167206
const mainConfig: Configuration = {
168207
...commonConfig,
208+
devServer: {
209+
...commonConfig.devServer,
210+
port: 8087,
211+
},
169212
entry: {
170213
main: path.join(__dirname, 'src', 'main', 'index.ts'),
171214
},

packages/side-api/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
"@seleniumhq/browser-info": "^4.0.1",
2424
"@seleniumhq/get-driver": "^4.0.1",
2525
"@seleniumhq/side-model": "^4.0.1",
26-
"@seleniumhq/side-runtime": "^4.0.1",
26+
"@seleniumhq/side-runtime": "^4.0.2",
2727
"lodash": "^4.17.21"
2828
},
2929
"devDependencies": {

packages/side-code-export/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"types": "dist/index.d.ts",
2222
"dependencies": {
2323
"@seleniumhq/side-model": "^4.0.1",
24-
"@seleniumhq/side-runtime": "^4.0.1",
24+
"@seleniumhq/side-runtime": "^4.0.2",
2525
"commander": "^9.4.0"
2626
},
2727
"gitHead": "f58e327e7616e23a3e926e4b80cf9952164e5744"

packages/side-runner/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "selenium-side-runner",
3-
"version": "4.0.1",
3+
"version": "4.0.2",
44
"private": false,
55
"description": "Run Selenium IDE projects in cli",
66
"repository": "https://github.com/SeleniumHQ/selenium-ide",
@@ -24,7 +24,7 @@
2424
"license": "Apache-2.0",
2525
"dependencies": {
2626
"@seleniumhq/side-model": "^4.0.1",
27-
"@seleniumhq/side-runtime": "^4.0.1",
27+
"@seleniumhq/side-runtime": "^4.0.2",
2828
"commander": "^11.0.0",
2929
"glob": "^10.3.1",
3030
"jest": "^29.6.0",

packages/side-runtime/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@seleniumhq/side-runtime",
3-
"version": "4.0.1",
3+
"version": "4.0.2",
44
"private": false,
55
"description": "Selenium IDE playback and execution",
66
"author": "Tomer <[email protected]>",

packages/side-runtime/src/webdriver.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1521,8 +1521,8 @@ export default class WebDriverExecutor {
15211521
this.withCancel(async () => {
15221522
const el = await this.elementIsLocated(locator, fallback)
15231523
if (!el) return null
1524-
const elText = await el.getText()
1525-
return elText === text
1524+
const elText = (await el.getText()).replace(/\u00A0/g, ' ').trim()
1525+
return elText === text.replace(/\u00A0/g, ' ').trim()
15261526
})
15271527
)
15281528
await this.driver.wait<boolean>(textCondition, timeout)

0 commit comments

Comments
 (0)